about summary refs log tree commit diff homepage
path: root/Makefile.common
diff options
context:
space:
mode:
authorMate Soos <soos.mate@gmail.com>2015-12-02 21:28:12 +0000
committerMate Soos <soos.mate@gmail.com>2015-12-02 21:28:12 +0000
commit59ee7b15e3ffc20a60a4a4c6dfa6f3375c1b5592 (patch)
tree1735e046d2db90e17c84671512d2d79ffdb84d76 /Makefile.common
parent6b0082b01e60ea2361da401694ea5aa7f7a6e966 (diff)
downloadklee-59ee7b15e3ffc20a60a4a4c6dfa6f3375c1b5592.tar.gz
Removing -fstack-protector-strong for clang <= 3.4
It's not supported and breaks compilation. This affects in particular
Debian Jessie and probably all derived distros, too
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile.common b/Makefile.common
index d3fd1e76..7b210118 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -5,6 +5,13 @@ include $(LEVEL)/Makefile.config
 # Include LLVM's Master Makefile config and rules.
 include $(LLVM_OBJ_ROOT)/Makefile.config
 
+# Filters out -fstack-protector-strong which is not understood by clang 3.4 or below
+# yet is present in Makefile.config of some distros such as Debian Jessie
+ifeq ($(shell test $(LLVM_VERSION_MAJOR) -le 3 -a $(LLVM_VERSION_MINOR) -le 4; echo $$?),0)
+  CFLAGS := $(filter-out -fstack-protector-strong,$(CFLAGS))
+  CXXFLAGS := $(filter-out -fstack-protector-strong,$(CXXFLAGS))
+endif
+
 # Assertions should be enabled by default for KLEE (but they can still
 # be disabled by running make with DISABLE_ASSERTIONS=1
 DISABLE_ASSERTIONS := 0