Re: [PATCH 1/2] mk: move libs that don't dependent PMD libs out of whole archive
From: Thomas Monjalon <hidden>
Date: 2017-01-31 13:59:20
From: Thomas Monjalon <hidden>
Date: 2017-01-31 13:59:20
2017-01-31 11:59, Ferruh Yigit:
During app build with static library, some libraries wrapped with --whole-archive compiler flag. Wrapped libraries are mainly PMD libraries, this is required because PMD APIs not directly called but run through callbacks registered via constructor functions. Also some set of libraries, depends to the PMD libraries needs this, because of same reason.
All the libraries used by a plugin (any driver) must be in --whole-archive to ensure that every symbols will be available for the plugin. This should be explained in this patch (verbatim copy allowed).
But other libraries can be out of this flag, and this saves some size in final binary.
[...]
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer +_LDLIBS-$(CONFIG_RTE_LIBRTE_EFD) += -lrte_efd +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile + _LDLIBS-y += --whole-archive
Yes we can move these libraries out of --whole-archive as they are not used by any driver. Acked-by: Thomas Monjalon <redacted>