From: Olivier Matz Date: Fri, 28 Feb 2014 17:25:40 +0000 (+0100) Subject: mk: use whole-archive option to keep unused symbols X-Git-Tag: spdx-start~10900 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=20afd76a504155e947c770783ef5023e87136ad8;p=dpdk.git mk: use whole-archive option to keep unused symbols 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 Acked-by: Thomas Monjalon --- diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 9c70ce0124..072718a9d4 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 @@ -177,6 +180,8 @@ LDLIBS += $(EXECENV_LDLIBS) LDLIBS += --end-group +LDLIBS += --no-whole-archive + endif # ifeq ($(NO_AUTOLIBS),) LDLIBS += $(CPU_LDLIBS)