Since [1] duplicates in LDLIBS are removed. The side effect is that it
does not distinguish between libraries or linker flags.
This patch allows multiple linker flags in LDLIBS, such as
--whole-archive.
[1] Commit:
edf4d331dcdb ("mk: eliminate duplicates from libraries list")
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
# Eliminate duplicates without sorting
LDLIBS := $(shell echo $(LDLIBS) | \
- awk '{for (i = 1; i <= NF; i++) { if (!seen[$$i]++) print $$i }}')
+ awk '{for (i = 1; i <= NF; i++) { \
+ if ($$i !~ /^-l.*/ || !seen[$$i]++) print $$i }}')
ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy)
LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib