aboutsummaryrefslogtreecommitdiffstats
path: root/mk
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-07-26 14:11:48 -0300
committerRicardo Salveti <ricardo.salveti@linaro.org>2016-07-26 14:12:04 -0300
commit6380daca5bd4e1740ad8afd0224f7bcbe5626ec7 (patch)
tree483ec63053763494272e9ef1018261eb77fd97b8 /mk
parent7b53c036e6bf56623b8273018ff1c8cc62847857 (diff)
Imported Upstream version 16.07-rc5
Change-Id: I3f93dd2982ddb9c0209bc44466d05a2320175938 Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/rte.lib.mk6
-rw-r--r--mk/toolchain/clang/rte.toolchain-compat.mk10
2 files changed, 13 insertions, 3 deletions
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 0187ae85..830f81a6 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 f995b0b0..b734413b 100644
--- a/mk/toolchain/clang/rte.toolchain-compat.mk
+++ b/mk/toolchain/clang/rte.toolchain-compat.mk
@@ -38,6 +38,12 @@
# find out CLANG version
-CLANG_MAJOR_VERSION = $(shell $(CC) -dumpversion | cut -f1 -d.)
+CLANG_VERSION := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/")
-CLANG_MINOR_VERSION = $(shell $(CC) -dumpversion | cut -f2 -d.)
+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