Hi Kefu,
As a followup to my previous message, adding -Wl,--no-whole-archive -nodefaultlibs seems to help for building seastar-dpdk.o. However, I could not build the complete seastar, as I got some errors with clang-10 on dpdk_rte.cc . Also, I removed the target_link_libraries as I believe they aren't necessary now that everything is in seastar-dpdk.o
On Tuesday, October 19, 2021 at 5:08:35 AM UTC+8 nicolas.l...@broadpeak.tv wrote:
Hi Kefu,
As a followup to my previous message, adding -Wl,--no-whole-archive -nodefaultlibs seems to help for building seastar-dpdk.o. However, I could not build the complete seastar, as I got some errors with clang-10 on dpdk_rte.cc . Also, I removed the target_link_libraries as I believe they aren't necessary now that everything is in seastar-dpdk.o
much appreciated, Nicolas! i just added the missing "-Wl,--no-whole-archive" to the ldflags. and the tests build just fine. let's see how things go on the reviewers' (hey Avi!) side.
I thought it worked, but a clean build (removing .cooking_memory) gets me this:
FAILED: seastar-dpdk.o
cd /home/avi/scylla-maint/build/release/seastar && clang
-r -o seastar-dpdk.o
-L/home/avi/scylla-maint/build/release/seastar/_cooking/stow/dpdk/lib64
-L/usr/usr/lib64 -L/usr/usr/lib64 -L/usr/usr/lib64
-Wl,--whole-archive
-L/home/avi/scylla-maint/build/release/seastar/_cooking/stow/dpdk/lib64
-l:librte_common_cpt.a -l:librte_common_dpaax.a
-l:librte_common_iavf.a -l:librte_common_octeontx.a
-l:librte_common_octeontx2.a -l:librte_bus_auxiliary.a
-l:librte_bus_dpaa.a -l:librte_bus_fslmc.a -l:librte_bus_ifpga.a
-l:librte_bus_pci.a -l:librte_bus_vdev.a -l:librte_bus_vmbus.a
-l:librte_common_cnxk.a -l:librte_common_mlx5.a
-l:librte_common_qat.a -l:librte_common_sfc_efx.a
-l:librte_mempool_bucket.a -l:librte_mempool_cnxk.a
-l:librte_mempool_dpaa.a -l:librte_mempool_dpaa2.a
-l:librte_mempool_octeontx.a -l:librte_mempool_octeontx2.a
-l:librte_mempool_ring.a -l:librte_mempool_stack.a
-l:librte_net_af_packet.a -l:librte_net_ark.a
-l:librte_net_atlantic.a -l:librte_net_avp.a -l:librte_net_axgbe.a
-l:librte_net_bnx2x.a -l:librte_net_bnxt.a -l:librte_net_bond.a
-l:librte_net_cnxk.a -l:librte_net_cxgbe.a -l:librte_net_dpaa.a
-l:librte_net_dpaa2.a -l:librte_net_e1000.a -l:librte_net_ena.a
-l:librte_net_enetc.a -l:librte_net_enic.a
-l:librte_net_failsafe.a -l:librte_net_fm10k.a
-l:librte_net_hinic.a -l:librte_net_hns3.a -l:librte_net_i40e.a
-l:librte_net_iavf.a -l:librte_net_ice.a -l:librte_net_igc.a
-l:librte_net_ionic.a -l:librte_net_ixgbe.a -l:librte_net_kni.a
-l:librte_net_liquidio.a -l:librte_net_memif.a
-l:librte_net_mlx4.a -l:librte_net_mlx5.a -l:librte_net_netvsc.a
-l:librte_net_nfp.a -l:librte_net_ngbe.a -l:librte_net_null.a
-l:librte_net_octeontx.a -l:librte_net_octeontx2.a
-l:librte_net_octeontx_ep.a -l:librte_net_pfe.a
-l:librte_net_qede.a -l:librte_net_ring.a -l:librte_net_sfc.a
-l:librte_net_softnic.a -l:librte_net_tap.a
-l:librte_net_thunderx.a -l:librte_net_txgbe.a
-l:librte_net_vdev_netvsc.a -l:librte_net_vhost.a
-l:librte_net_virtio.a -l:librte_net_vmxnet3.a
-l:librte_raw_cnxk_bphy.a -l:librte_raw_dpaa2_cmdif.a
-l:librte_raw_dpaa2_qdma.a -l:librte_raw_ioat.a
-l:librte_raw_ntb.a -l:librte_raw_octeontx2_dma.a
-l:librte_raw_octeontx2_ep.a -l:librte_raw_skeleton.a
-l:librte_crypto_bcmfs.a -l:librte_crypto_caam_jr.a
-l:librte_crypto_cnxk.a -l:librte_crypto_dpaa_sec.a
-l:librte_crypto_dpaa2_sec.a -l:librte_crypto_mlx5.a
-l:librte_crypto_nitrox.a -l:librte_crypto_null.a
-l:librte_crypto_octeontx.a -l:librte_crypto_octeontx2.a
-l:librte_crypto_scheduler.a -l:librte_crypto_virtio.a
-l:librte_compress_mlx5.a -l:librte_compress_octeontx.a
-l:librte_compress_zlib.a -l:librte_regex_mlx5.a
-l:librte_regex_octeontx2.a -l:librte_vdpa_ifc.a
-l:librte_vdpa_mlx5.a -l:librte_event_cnxk.a
-l:librte_event_dlb2.a -l:librte_event_dpaa.a
-l:librte_event_dpaa2.a -l:librte_event_dsw.a
-l:librte_event_octeontx2.a -l:librte_event_opdl.a
-l:librte_event_skeleton.a -l:librte_event_sw.a
-l:librte_event_octeontx.a -l:librte_baseband_acc100.a
-l:librte_baseband_fpga_5gnr_fec.a
-l:librte_baseband_fpga_lte_fec.a -l:librte_baseband_null.a
-l:librte_baseband_turbo_sw.a -l:librte_node.a -l:librte_graph.a
-l:librte_bpf.a -l:librte_flow_classify.a -l:librte_pipeline.a
-l:librte_table.a -l:librte_port.a -l:librte_fib.a
-l:librte_ipsec.a -l:librte_vhost.a -l:librte_stack.a
-l:librte_security.a -l:librte_sched.a -l:librte_reorder.a
-l:librte_rib.a -l:librte_regexdev.a -l:librte_rawdev.a
-l:librte_pdump.a -l:librte_member.a -l:librte_lpm.a
-l:librte_latencystats.a -l:librte_kni.a -l:librte_jobstats.a
-l:librte_ip_frag.a -l:librte_gso.a -l:librte_gro.a
-l:librte_eventdev.a -l:librte_efd.a -l:librte_distributor.a
-l:librte_cryptodev.a -l:librte_compressdev.a -l:librte_cfgfile.a
-l:librte_bitratestats.a -l:librte_bbdev.a -l:librte_acl.a
-l:librte_timer.a -l:librte_hash.a -l:librte_metrics.a
-l:librte_cmdline.a -l:librte_pci.a -l:librte_ethdev.a
-l:librte_meter.a -l:librte_net.a -l:librte_mbuf.a
-l:librte_mempool.a -l:librte_rcu.a -l:librte_ring.a
-l:librte_eal.a -l:librte_telemetry.a -l:librte_kvargs.a
-Wl,--no-whole-archive
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find -lgcc_s
clang-12: error: linker command failed with exit code 1 (use -v to
see invocation)
ninja: build stopped: subcommand failed.
To view this discussion on the web visit https://groups.google.com/d/msgid/seastar-dev/ea6f4438-b95e-4008-bbf9-578cc3b6dc4an%40googlegroups.com.
On 19/10/2021 03.16, tcha...@gmail.com wrote:
On Tuesday, October 19, 2021 at 5:08:35 AM UTC+8 nicolas.l...@broadpeak.tv wrote:
Hi Kefu,
As a followup to my previous message, adding -Wl,--no-whole-archive -nodefaultlibs seems to help for building seastar-dpdk.o. However, I could not build the complete seastar, as I got some errors with clang-10 on dpdk_rte.cc . Also, I removed the target_link_libraries as I believe they aren't necessary now that everything is in seastar-dpdk.o
much appreciated, Nicolas! i just added the missing "-Wl,--no-whole-archive" to the ldflags. and the tests build just fine. let's see how things go on the reviewers' (hey Avi!) side.
I thought it worked, but a clean build (removing .cooking_memory) gets me this:
FAILED: seastar-dpdk.o
cd /home/avi/scylla-maint/build/release/seastar && clang -r -o seastar-dpdk.o -L/home/avi/scylla-maint/build/release/seastar/_cooking/stow/dpdk/lib64 -L/usr/usr/lib64 -L/usr/usr/lib64 -L/usr/usr/lib64 -Wl,--whole-archive -L/home
Replacing clang with gcc in this command makes it work. So
there's some difference between gcc and clang in partial links.
On 19/10/2021 17.29, Avi Kivity wrote:
On 19/10/2021 03.16, tcha...@gmail.com wrote:
On Tuesday, October 19, 2021 at 5:08:35 AM UTC+8 nicolas.l...@broadpeak.tv wrote:
Hi Kefu,
As a followup to my previous message, adding -Wl,--no-whole-archive -nodefaultlibs seems to help for building seastar-dpdk.o. However, I could not build the complete seastar, as I got some errors with clang-10 on dpdk_rte.cc . Also, I removed the target_link_libraries as I believe they aren't necessary now that everything is in seastar-dpdk.o
much appreciated, Nicolas! i just added the missing "-Wl,--no-whole-archive" to the ldflags. and the tests build just fine. let's see how things go on the reviewers' (hey Avi!) side.
I thought it worked, but a clean build (removing .cooking_memory) gets me this:
FAILED: seastar-dpdk.o
cd /home/avi/scylla-maint/build/release/seastar && clang -r -o seastar-dpdk.o -L/home/avi/scylla-maint/build/release/seastar/_cooking/stow/dpdk/lib64 -L/usr/usr/lib64 -L/usr/usr/lib64 -L/usr/usr/lib64 -Wl,--whole-archive -L/home
Replacing clang with gcc in this command makes it work. So there's some difference between gcc and clang in partial links.
Adding -nostdlib to the command line makes it work with both
clang and gcc!
On 19/10/2021 03.16, tcha...@gmail.com wrote:
On Tuesday, October 19, 2021 at 5:08:35 AM UTC+8 nicolas.l...@broadpeak.tv wrote:
Hi Kefu,
As a followup to my previous message, adding -Wl,--no-whole-archive -nodefaultlibs seems to help for building seastar-dpdk.o. However, I could not build the complete seastar, as I got some errors with clang-10 on dpdk_rte.cc . Also, I removed the target_link_libraries as I believe they aren't necessary now that everything is in seastar-dpdk.o
much appreciated, Nicolas! i just added the missing "-Wl,--no-whole-archive" to the ldflags. and the tests build just fine. let's see how things go on the reviewers' (hey Avi!) side.
I thought it worked, but a clean build (removing .cooking_memory) gets me this:
Hi,
I also tested and indeed -nostdlib seems to do the trick. In addition, on my machine I have a few “dependencies” installed such as libbsd, libpcap, libopenssl, Mellanox drivers, … which ends up missing in the final link (this will not occur on “clean” build machines as DPDK’s meson will automatically disable the corresponding drivers/libraries). This is the part of the pkg-config that is not “fetched” by the static linking command and that should be put in CMake, but also in the “Libs” section of seatar.pc.in (pkg-config).
PKG_CONFIG_PATH=build/release/_cooking/installed/lib/x86_64-linux-gnu/pkgconfig pkg-config --static --libs libdpdk
...
-latomic -lmlx5 -lpthread -libverbs -lmlx5 -libverbs -lpthread -lnl-route-3 -lnl-3 -lcrypto -ldl -pthread -lz -lpcap -pthread -lm -ldl -lnuma -lpcap -lbsd
I see two “evolutions”
1) Adding CMake stuff to handle -lbsd/-lpcap/-lmlx5/-libverbs (directly getting them from DPDK pkg-config – although in our project we hardcoded them temporarily)
dpdk_deps=-lmlx5 -lpthread -libverbs -lmlx5 -libverbs -lpthread -lnl-route-3 -lnl-3 -lz -lbsd -lpcap -lnuma
…
Libs: ${seastar_libs} ${boost_program_options_libs} ${boost_thread_libs} ${c_ares_libs} ${cryptopp_libs} ${fmt_libs} ${gnutls_libs} ${hwloc_libs} ${rt_libs} ${dpdk_deps}
2) Disabling more drivers/libs that are not used/exposed through seastar (obviously disabling mlx5 as it’s a NIC driver wouldn’t make sense). For this, we’re using the following in cooking.recipes, that disable compressdev/cryptodev/regex/… to reduce dependencies.
-Ddisable_drivers="net/softnic,net/bonding,common/dpaax,common/octeontx,common/octeontx2,common/sfc_efx,common/qat,common/cpt,bus/dpaa,net/sfc,bus/ifpga,bus/fslmc,compress/*,crypto/*,baseband/*,regex/*,vdpa/*,event/*"
-Ddisable_libs="kni,jobstats,lpm,acl,power,ip_frag,distributor,reorder,port,table,pipeline,flow_classify,bpf,efd,member, compressdev, cryptodev"
Best regards,
To view this discussion on the web visit https://groups.google.com/d/msgid/seastar-dev/d220d9ab-ccd1-e100-7255-f39682f82289%40scylladb.com.
I'm seeing this too now. I'll revert the dpdk changes for now,
and we can reapply after both Nicolas and me see that it works for
our uses. There's too much shrapnel flying.
I'm seeing this too now. I'll revert the dpdk changes for now, and we can reapply after both Nicolas and me see that it works for our uses. There's too much shrapnel flying.