[dpdk-users] DPDK library link issue with __attribute__((constructor))
Hui Liu
onlyflyer at gmail.com
Mon Mar 5 06:08:45 CET 2018
Hi Guys,
I am using DPDK with the yocto build system.
I found some static library is not linked because of the linker's as-needed
decision.
Some .a file use __attribute__((constructor)) to register their APIs,
we only know if we use these APIs at runtime, but linker make the decision
early and then discarded them.
I tried a lot to link the library I need:
1, use -Wl, --no-as-needed, for example:
gcc a.c *-Wl, --no-as-needed* -ldl -ldpdk
2, Put the library explicitly to the linker like this:
gcc a.c -Wl, --no-as-needed -ldl -ldpdk *-lrte_mempool*
At last, I still didn't find my library in the elf file.
Is there anything else I can try to link these library?
--
Thanks & Best Regards
Liu Hui
--
More information about the users
mailing list