From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 3E9666936 for ; Thu, 10 Apr 2014 22:49:20 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1WYLvz-0004P3-6k; Thu, 10 Apr 2014 16:50:56 -0400 From: Neil Horman To: dev@dpdk.org Date: Thu, 10 Apr 2014 16:50:00 -0400 Message-Id: <1397163009-29950-10-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1397163009-29950-1-git-send-email-nhorman@tuxdriver.com> References: <1397162846-28912-1-git-send-email-nhorman@tuxdriver.com> <1397163009-29950-1-git-send-email-nhorman@tuxdriver.com> X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [PATCH 10/19] make: include whole archive on static link X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 20:49:20 -0000 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 2f2ff16..41eab08 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -198,6 +198,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