summaryrefslogtreecommitdiffstats
path: root/share/mk
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-10-17 19:48:17 +0000
committerngie <ngie@FreeBSD.org>2015-10-17 19:48:17 +0000
commit91fe36c7aa76c619a34df6f68612a9527a2d5ade (patch)
treef1557d02894feb515c78b5165c5d3d82c02214ba /share/mk
parentef80c05a84f47c786279fd01f430ab1ba90ef4aa (diff)
downloadFreeBSD-src-91fe36c7aa76c619a34df6f68612a9527a2d5ade.zip
FreeBSD-src-91fe36c7aa76c619a34df6f68612a9527a2d5ade.tar.gz
Only use -fstack-protector-strong with supported compilers
This includes clang 3.5.0+, gcc 4.2.1, gcc 4.8.4+ This allows me to do subdirectory makes again after setting MAKESYSPATH on 10.2-RELEASE as it comes with clang 3.4.1. As a sidenote: this isn't technically correct for all vintages of gcc 4.2.1, but will be correct when gcc is rebuilt/reinstalled after r286074, so this version check should be good enough. X-MFC with: r288669 Differential Revision: https://reviews.freebsd.org/D3924 Reviewed by: emaste, pfg
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/bsd.sys.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index d5a4696..68351a0 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -148,9 +148,13 @@ CXXFLAGS.clang+= -Wno-c++11-extensions
.if ${MK_SSP} != "no" && \
${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
+.if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30500) || \
+ (${COMPILER_TYPE} == "gcc" && \
+ (${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40800))
# Don't use -Wstack-protector as it breaks world with -Werror.
SSP_CFLAGS?= -fstack-protector-strong
CFLAGS+= ${SSP_CFLAGS}
+.endif
.endif # SSP && !ARM && !MIPS
# Allow user-specified additional warning flags, plus compiler specific flag overrides.
OpenPOWER on IntegriCloud