summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2016-07-25 13:55:49 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-25 17:48:35 +0200
commit29361d4c91eddaf7798076322345ef2b151e0241 (patch)
tree5d748ba3236be31e78b140d9590956114951d61e
parent50e315fca2c0af4a0382ad5cb71c61aff968c543 (diff)
downloaddpdk-29361d4c91eddaf7798076322345ef2b151e0241.zip
dpdk-29361d4c91eddaf7798076322345ef2b151e0241.tar.gz
dpdk-29361d4c91eddaf7798076322345ef2b151e0241.tar.xz
mk: fix build with clang < 3.5
clang version < 3.5 doesn't support -z linker option, and some FreeBSD box still has clang versions < 3.5 as default version. compile error: clang: error: unknown argument: '-z' Fixes: fd591c4c4e35 ("mk: check shared library dependencies") Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Tested-by: Bruce Richardson <bruce.richardson@intel.com>
-rw-r--r--mk/rte.lib.mk6
-rw-r--r--mk/toolchain/clang/rte.toolchain-compat.mk4
2 files changed, 9 insertions, 1 deletions
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 0187ae8..830f81a 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -93,8 +93,12 @@ O_TO_A_DO = @set -e; \
$(O_TO_A) && \
echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))
+ifneq ($(CC_SUPPORTS_Z),false)
+NO_UNDEFINED := -z defs
+endif
+
O_TO_S = $(LD) -L$(RTE_SDK_BIN)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) \
- -shared $(OBJS-y) -z defs $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB)
+ -shared $(OBJS-y) $(NO_UNDEFINED) $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB)
O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)"," LD $(@)")
O_TO_S_DO = @set -e; \
diff --git a/mk/toolchain/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk
index 03e5a97..b734413 100644
--- a/mk/toolchain/clang/rte.toolchain-compat.mk
+++ b/mk/toolchain/clang/rte.toolchain-compat.mk
@@ -43,3 +43,7 @@ CLANG_VERSION := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]
CLANG_MAJOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f1 -d.)
CLANG_MINOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f2 -d.)
+
+ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 35 && echo 1), 1)
+ CC_SUPPORTS_Z := false
+endif