emmericp / MoonGen

MoonGen is a fully scriptable high-speed packet generator built on DPDK and LuaJIT. It can saturate a 10 Gbit/s connection with 64 byte packets on a single CPU core while executing user-provided Lua scripts for each packet. Multi-core support allows for even higher rates. It also features precise and accurate timestamping and rate control.
MIT License
1.05k stars 235 forks source link

Multiple Definitions #322

Closed gierens closed 2 years ago

gierens commented 2 years ago

I tried to compile this on Debian 11 with GCC version 10.2.1, and it appears that newer versions of the C compiler are less forgiving with multiple definitions during linking. In my case linking fails due to quite a few multiple definitions in libmoon:

admin@test:/tmp/MoonGen$ ./build.sh 2>&1 | grep 'multiple definition'
/usr/bin/ld: /tmp/MoonGen/libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/lib/librte_pmd_e1000.a(igb_rxtx.o):(.bss+0x0): multiple definition of `igb_flow_list'; /tmp/MoonGen/libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/lib/librte_pmd_e1000.a(igb_ethdev.o):(.bss+0x0): first defined here
/usr/bin/ld: /tmp/MoonGen/libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/lib/librte_pmd_e1000.a(igb_rxtx.o):(.bss+0x10): multiple definition of `igb_filter_flex_list'; /tmp/MoonGen/libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/lib/librte_pmd_e1000.a(igb_ethdev.o):(.bss+0x10): first defined here
/usr/bin/ld: /tmp/MoonGen/libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/lib/librte_pmd_e1000.a(igb_rxtx.o):(.bss+0x20): multiple definition of `igb_filter_syn_list'; /tmp/MoonGen/libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/lib/librte_pmd_e1000.a(igb_ethdev.o):(.bss+0x20): first defined here
...

I already opened an issue in the libmoon project, see https://github.com/libmoon/libmoon/issues/120, and there it may be fixed in my PR https://github.com/libmoon/libmoon/pull/121, but since MoonGen overwrites the CMake configuration this issue will prevail here even after.