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 <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
# 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
#
ifeq ($(NO_AUTOLIBS),)
+LDLIBS += --whole-archive
+
ifeq ($(CONFIG_RTE_LIBRTE_KNI),y)
ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
LDLIBS += -lrte_kni
LDLIBS += --end-group
+LDLIBS += --no-whole-archive
+
endif # ifeq ($(NO_AUTOLIBS),)
LDLIBS += $(CPU_LDLIBS)