Hi, While linking OVS to Windows DPDK library, static link to librte_eal.a, we hit some error about rte_dump_stack(). I don't know why other symbols work, but only a couple symbols showed errors here. Any suggestions about how to debug/fix this? Thank you! [5/15] Linking target utilities/ovs-vsctl.exeFAILED: utilities/ovs-vsctl.exe"clang" -Wl,/MACHINE:X64 -Wl,/OUT:utilities/ovs-vsctl.exe utilities/ovs-vsctl.exe.p/ovs-vsctl.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/OPT:REF" "lib\libopenvswitch.a" "-Wl,--no-undefined" "C:/dpdk/install/lib/librte_eal.a" "C:/dpdk/install/lib/librte_ethdev.a" "C:/dpdk/install/lib/librte_mempool.a" "C:/dpdk/install/lib/librte_mbuf.a" "C:/dpdk/install/lib/librte_meter.a""C:/dpdk/install/lib/librte_telemetry.a" "C:/dpdk/install/lib/librte_kvargs.a" "C:/PTHREADS-BUILT/lib/libpthreadVC3.lib" "-lWs2_32" "-lWbemUuid" "-lShlwapi" "-lIphlpapi" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32" "-ladvapi32" LINK : warning LNK4044: unrecognized option '/-no-undefined'; ignored librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved external symbol __imp_SymInitialize referenced in function rte_dump_stack librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved external symbol __imp_SymSetOptions referenced in function rte_dump_stack librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved external symbol __imp_SymFromAddr referenced in function rte_dump_stack librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved external symbol __imp_SymGetLineFromAddr64 referenced in function rte_dump_stack librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved external symbol __imp_SymCleanup referenced in function rte_dump_stack librte_eal.a(eal_windows_eal_memory.c.obj) : error LNK2019: unresolved external symbol __imp_SetupDiGetClassDevsA referenced in function eal_mem_virt2iova_init Running dumpbin, I can see the rte_dump_stack symbol. c:\dpdk\install\lib>dumpbin /ALL librte_eal.a | grep rte_dump_stack D9E52 rte_dump_stack 00000045 REL32 00000000 139 rte_dump_stack 139 00000000 UNDEF notype External | rte_dump_stack 00000000 ADDR32NB 00000000 145 rte_dump_stack 00000004 ADDR32NB 00000239 145 rte_dump_stack 145 00000000 SECT1 notype () External | rte_dump_stack other symbols look similar... c:\dpdk\install\lib>dumpbin /ALL librte_eal.a | grep rte_eal_cleanup CE92C rte_eal_cleanup 00000099 REL32 00000000 13C rte_eal_cleanup 13C 00000000 UNDEF notype External | rte_eal_cleanup 0000000C ADDR32NB 00000000 1B6 rte_eal_cleanup 00000010 ADDR32NB 00000027 1B6 rte_eal_cleanup 1B6 00000100 SECT1 notype () External | rte_eal_cleanup Thank you William
2021-08-08 10:45 (UTC-0700), William Tu:
> Hi,
>
> While linking OVS to Windows DPDK library, static link to
> librte_eal.a, we hit some error about rte_dump_stack().
> I don't know why other symbols work, but only a couple symbols showed
> errors here.
> Any suggestions about how to debug/fix this? Thank you!
>
> [5/15] Linking target utilities/ovs-vsctl.exeFAILED:
> utilities/ovs-vsctl.exe"clang" -Wl,/MACHINE:X64
> -Wl,/OUT:utilities/ovs-vsctl.exe
> utilities/ovs-vsctl.exe.p/ovs-vsctl.c.obj "-Wl,/nologo" "-Wl,/release"
> "-Wl,/nologo" "-Wl,/OPT:REF" "lib\libopenvswitch.a"
> "-Wl,--no-undefined" "C:/dpdk/install/lib/librte_eal.a"
> "C:/dpdk/install/lib/librte_ethdev.a"
> "C:/dpdk/install/lib/librte_mempool.a"
> "C:/dpdk/install/lib/librte_mbuf.a"
> "C:/dpdk/install/lib/librte_meter.a""C:/dpdk/install/lib/librte_telemetry.a"
> "C:/dpdk/install/lib/librte_kvargs.a"
> "C:/PTHREADS-BUILT/lib/libpthreadVC3.lib" "-lWs2_32" "-lWbemUuid"
> "-lShlwapi" "-lIphlpapi" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32"
> "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32"
> "-luuid" "-lcomdlg32" "-ladvapi32"
> LINK : warning LNK4044: unrecognized option '/-no-undefined'; ignored
> librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved
> external symbol __imp_SymInitialize referenced in function
> rte_dump_stack
Hi William,
`rte_dump_stack()` implementation requires linking DbgHelp system library.
There are other required libraries, see `add_project_link_arguments()` in
`config/meson.build`.
I also noticed that these libraries are not added to pkg-config
`Libs.private`. We must use `ext_deps` and `cc.find_library()`
instead of `add_project_link_arguments('-l...')`. IIRC you don't use
pkg-config, but still.
On Sun, Aug 8, 2021 at 12:52 PM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> wrote: > > 2021-08-08 10:45 (UTC-0700), William Tu: > > Hi, > > > > While linking OVS to Windows DPDK library, static link to > > librte_eal.a, we hit some error about rte_dump_stack(). > > I don't know why other symbols work, but only a couple symbols showed > > errors here. > > Any suggestions about how to debug/fix this? Thank you! > > > > [5/15] Linking target utilities/ovs-vsctl.exeFAILED: > > utilities/ovs-vsctl.exe"clang" -Wl,/MACHINE:X64 > > -Wl,/OUT:utilities/ovs-vsctl.exe > > utilities/ovs-vsctl.exe.p/ovs-vsctl.c.obj "-Wl,/nologo" "-Wl,/release" > > "-Wl,/nologo" "-Wl,/OPT:REF" "lib\libopenvswitch.a" > > "-Wl,--no-undefined" "C:/dpdk/install/lib/librte_eal.a" > > "C:/dpdk/install/lib/librte_ethdev.a" > > "C:/dpdk/install/lib/librte_mempool.a" > > "C:/dpdk/install/lib/librte_mbuf.a" > > "C:/dpdk/install/lib/librte_meter.a""C:/dpdk/install/lib/librte_telemetry.a" > > "C:/dpdk/install/lib/librte_kvargs.a" > > "C:/PTHREADS-BUILT/lib/libpthreadVC3.lib" "-lWs2_32" "-lWbemUuid" > > "-lShlwapi" "-lIphlpapi" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" > > "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" > > "-luuid" "-lcomdlg32" "-ladvapi32" > > LINK : warning LNK4044: unrecognized option '/-no-undefined'; ignored > > librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved > > external symbol __imp_SymInitialize referenced in function > > rte_dump_stack > > Hi William, > > `rte_dump_stack()` implementation requires linking DbgHelp system library. > There are other required libraries, see `add_project_link_arguments()` in > `config/meson.build`. Thanks, pass linking stage now. > > I also noticed that these libraries are not added to pkg-config > `Libs.private`. We must use `ext_deps` and `cc.find_library()` > instead of `add_project_link_arguments('-l...')`. IIRC you don't use > pkg-config, but still. Thanks, and yes, the pkg-config on my system still doesn't work. Regards, William