From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Horman Subject: [PATCH 02/15] make: include whole archive on static link Date: Tue, 15 Apr 2014 14:05:56 -0400 Message-ID: <1397585169-14537-3-git-send-email-nhorman@tuxdriver.com> References: <1397585169-14537-1-git-send-email-nhorman@tuxdriver.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1397585169-14537-1-git-send-email-nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" This happens automatically on dyanmic linking, but when linking an archive we need to to include the whole archive to make sure we call all the constructors. Not doing this causes them to be discarded due to the fact theres no symbolic reference connecting the pmds to the application. Signed-off-by: Neil Horman --- mk/rte.app.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 072718a..5a0ef0c 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -206,6 +206,8 @@ endif ifeq ($(LINK_USING_CC),1) comma := , LDLIBS := $(addprefix -Wl$(comma),$(LDLIBS)) +LDLIBS := -Wl$(comma)--whole-archive $(LDLIBS) +LDLIBS += -Wl,--no-whole-archive -Wl,-z -Wl,muldefs LDFLAGS := $(addprefix -Wl$(comma),$(LDFLAGS)) override EXTRA_LDFLAGS := $(addprefix -Wl$(comma),$(EXTRA_LDFLAGS)) O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \ -- 1.8.3.1