On Wed, 3 Jun 2026 at 17:56, Stephen Hemminger <[email protected]> wrote: > > On Wed, 3 Jun 2026 12:01:48 +0200 > David Marchand <[email protected]> wrote: > > > Hello, > > > > On Wed, 3 Jun 2026 at 00:57, Stephen Hemminger > > <[email protected]> wrote: > > > > > > When using function versioning and building with Link Time Optimization, > > > the compiler does not see the __asm__ annotation of symbols and > > > therefore thinks there are two versions of the same symbol. > > > > > > The fix is to use compiler symver attribute on the function which > > > was added in GCC 10. Keep the older method for backward compatibility > > > with older compilers. > > > > > > Bugzilla ID: 1949 > > > Fixes: e30e194c4d06 ("eal: rework function versioning macros") > > > > We never used the symver stuff, so it seems unlikely the issue was > > introduced with this rework. > > > > The fact that clang does not support this attribute is a concern. > > Clang doesn't have this problem. It works as is.
The Fixes: tag is wrong regardless. The issue is probably present since introduction of the versioning macros, or introduction of LTO in DPDK (not sure which came first). > > > Cc: [email protected] > > > > Why do we need to backport? > > Well LTO has worked for a long time, it is not experimental just > not commonly done since it takes so long to build. > > We were doing it years ago at MSFT. Well, sorry, but every time I enable LTO, I end up with some warnings somewhere. I don't think I am doing stuff really exotic though. Looking at bugzilla, we had various fixes for LTO over the years. We still have one open bz btw: https://bugs.dpdk.org/show_bug.cgi?id=1709 Hence my feeling this feature is not something used by many people around. And without a CI, we will keep on having to fix bugs/issues. > > LTO is kind of experimental, so it seems good enough to reply "not > > expected to work in older LTS" if someone reported an issue. > > > > And in practice, no LTS release call the versioning macros, since a > > LTS drops all compatibility. Just to be clear, we don't need fixing the macros in LTS: every time we prepare a LTS rc0, we drop any kind of symbol compat. > > > > > Signed-off-by: Stephen Hemminger <[email protected]> > > > > I would like to reproduce, but I can't build main with LTO. > > What patches did you apply locally to avoid warnings on the hash library? > I use Debian testing and GCC 15 but shows up on older versions as well > I get no warnings building main Building from scratch, I do avoid the warnings I hit yesterday. The fix looks correct, my problem is with the form. Fixes: tags accuracy is important. And I prefer we stick to "It is not broken, don't fix it". Thanks. > > $ git am > ~/Downloads/v2-ethdev-add-buffer-size-parameter-to-rte_eth_dev_get_name_by_port.patch > $ meson setup build-lto -Db_lto=true > $ ninja -C build-lto > ninja: Entering directory `build-lto' > [620/3781] Linking target lib/librte_ethdev.so.26.2 > FAILED: [code=1] lib/librte_ethdev.so.26.2 > cc -o lib/librte_ethdev.so.26.2 > lib/librte_ethdev.so.26.2.p/ethdev_ethdev_driver.c.o > lib/librte_ethdev.so.26.2.p/ethdev_ethdev_private.c.o > lib/librte_ethdev.so.26.2.p/ethdev_ethdev_profile.c.o > lib/librte_ethdev.so.26.2.p/ethdev_ethdev_trace_points.c.o > lib/librte_ethdev.so.26.2.p/ethdev_rte_class_eth.c.o > lib/librte_ethdev.so.26.2.p/ethdev_rte_ethdev.c.o > lib/librte_ethdev.so.26.2.p/ethdev_rte_ethdev_cman.c.o > lib/librte_ethdev.so.26.2.p/ethdev_rte_ethdev_telemetry.c.o > lib/librte_ethdev.so.26.2.p/ethdev_rte_flow.c.o > lib/librte_ethdev.so.26.2.p/ethdev_rte_mtr.c.o > lib/librte_ethdev.so.26.2.p/ethdev_rte_tm.c.o > lib/librte_ethdev.so.26.2.p/ethdev_sff_telemetry.c.o > lib/librte_ethdev.so.26.2.p/ethdev_sff_common.c.o > lib/librte_ethdev.so.26.2.p/ethdev_sff_8079.c.o > lib/librte_ethdev.so.26.2.p/ethdev_sff_8472.c.o > lib/librte_ethdev.so.26.2.p/ethdev_sff_8636.c.o > lib/librte_ethdev.so.26.2.p/ethdev_ethdev_linux_ethtool.c.o -flto=auto > -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -shared -fPIC > -Wl,-soname,librte_ethdev.so.26 -Wl,--no-as-needed -Wl,--undefined-version > -pthread -Wl,--start-group -lm -ldl -lnuma -lfdt '-Wl,-rpath,$ORIGIN/' > lib/librte_eal.so.26.2 lib/librte_kvargs.so.26.2 lib/librte_log.so.26.2 > lib/librte_telemetry.so.26.2 lib/librte_argparse.so.26.2 > lib/librte_net.so.26.2 lib/librte_mbuf.so.26.2 lib/librte_mempool.so.26.2 > lib/librte_ring.so.26.2 lib/librte_meter.so.26.2 > -Wl,--version-script=/home/shemminger/DPDK/lto/build-lto/lib/ethdev_exports.map > /usr/lib/x86_64-linux-gnu/libbsd.so /usr/lib/x86_64-linux-gnu/libarchive.so > -Wl,--end-group > /tmp/cc3RQyqL.s: Assembler messages: > /tmp/cc3RQyqL.s: Error: invalid attempt to declare external version name as > default in symbol `rte_eth_dev_get_name_by_port@@DPDK_27' > make: *** [/tmp/ccVzgiZ2.mk:2: /tmp/ccTlGfA9.ltrans0.ltrans.o] Error 1 > make: *** Waiting for unfinished jobs.... > lto-wrapper: fatal error: make returned 2 exit status > compilation terminated. > -- David Marchand

