[dpdk-dev] 16.07-rc2 issue with rte_rtm_init(void) constructor

Thomas Monjalon thomas.monjalon at 6wind.com
Thu Jul 14 10:20:31 CEST 2016


2016-07-13 22:58, Damjan Marion:
> I have issues with linking application to 16.07-rc2.
> 
> Looks like reason is constructor function in include file,
> so our unit test apps are failing to link as they are not linked with dpdk libs.
> (and they should not be as they are not calling any dpdk function).

I don't understand:
Why are you linking DPDK if you do not use any DPDK function?

> static inline void __attribute__((constructor))
> rte_rtm_init(void)
> {
>         rtm_supported = rte_cpu_get_flag_enabled(RTE_CPUFLAG_RTM);
> }
> 
> linking fails with:
> dpdk/include/rte_spinlock.h:103: undefined reference to `rte_cpu_get_flag_enabled’
> 
> Is there any chance that this one is moved to some .c file, so it is loaded
> only when it is really needed?

Yes it could be moved to lib/librte_eal/common/arch/x86/.



More information about the dev mailing list