From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: [PATCH 01/11] mk: use whole-archive option when creating dpdk binaries Date: Fri, 28 Feb 2014 18:25:40 +0100 Message-ID: <1393608350-4431-2-git-send-email-olivier.matz@6wind.com> References: <1393608350-4431-1-git-send-email-olivier.matz@6wind.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1393608350-4431-1-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@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" To fully support dpdk extensions (loading of .so), all symbols provided by dpdk libraries must be available in the binaries: before this patch, unused functions/variables from dpdk static libraries could be stripped by the linker because they are not used. These symbols can be used by a dpdk extension that is loaded at runtime with the -d option. Adding --whole-archive when generating a binary solves this issue. Signed-off-by: Olivier Matz --- mk/rte.app.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index d90a0b0..6f21e16 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -1,6 +1,7 @@ # BSD LICENSE # # Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +# Copyright(c) 2014 6WIND S.A. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -58,6 +59,8 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib # ifeq ($(NO_AUTOLIBS),) +LDLIBS += --whole-archive + ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) LDLIBS += -lrte_kni @@ -180,6 +183,8 @@ LDLIBS += $(EXECENV_LDLIBS) LDLIBS += --end-group +LDLIBS += --no-whole-archive + endif # ifeq ($(NO_AUTOLIBS),) LDLIBS += $(CPU_LDLIBS) -- 1.8.5.3