From 9b0895e864a36c8a3b26cc9da3f685996bb41602 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Fri, 2 Jan 2015 14:58:57 -0500 Subject: [PATCH] mk: fix link to static combined library When building static archives with CONFIG_COMBINED_LIBS, we still need to specify --whole-archive to pull in all the proper constructors. Signed-off-by: Neil Horman Reported-by: Lyn M Tested-by: Lyn M Acked-by: Thomas Monjalon --- mk/rte.app.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index e1a0dbfb30..40afb2ca77 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -61,6 +61,10 @@ ifeq ($(NO_AUTOLIBS),) LDLIBS += --whole-archive +ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) +LDLIBS += -l$(RTE_LIBNAME) +endif + ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) @@ -251,10 +255,6 @@ build: _postbuild exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) -LDLIBS += -l$(RTE_LIBNAME) -endif - ifeq ($(LINK_USING_CC),1) override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \ -- 2.20.1