DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Linker error on rte_dump_stack() on Windows
@ 2021-08-08 17:45 William Tu
  2021-08-08 19:52 ` Dmitry Kozlyuk
  0 siblings, 1 reply; 3+ messages in thread
From: William Tu @ 2021-08-08 17:45 UTC (permalink / raw)
  To: dpdk-dev, Dmitry Kozliuk; +Cc: Sergey Madaminov

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Linker error on rte_dump_stack() on Windows
  2021-08-08 17:45 [dpdk-dev] Linker error on rte_dump_stack() on Windows William Tu
@ 2021-08-08 19:52 ` Dmitry Kozlyuk
  2021-08-09  2:30   ` William Tu
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Kozlyuk @ 2021-08-08 19:52 UTC (permalink / raw)
  To: William Tu; +Cc: dpdk-dev, Sergey Madaminov

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Linker error on rte_dump_stack() on Windows
  2021-08-08 19:52 ` Dmitry Kozlyuk
@ 2021-08-09  2:30   ` William Tu
  0 siblings, 0 replies; 3+ messages in thread
From: William Tu @ 2021-08-09  2:30 UTC (permalink / raw)
  To: Dmitry Kozlyuk; +Cc: dpdk-dev, Sergey Madaminov

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-09  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-08 17:45 [dpdk-dev] Linker error on rte_dump_stack() on Windows William Tu
2021-08-08 19:52 ` Dmitry Kozlyuk
2021-08-09  2:30   ` William Tu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).