diff options
author | jperkin <jperkin@pkgsrc.org> | 2017-09-11 09:06:41 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2017-09-11 09:06:41 +0000 |
commit | ad42fc375d8e5b67d53f13fd27fe2b3bff85e17b (patch) | |
tree | 6a5a4fceddadd5f59c39173e9fc251c8f0586b04 /mk/compiler | |
parent | bc1187d4c4814eff25401d1057c61bd2c6b2b3e9 (diff) | |
download | pkgsrc-ad42fc375d8e5b67d53f13fd27fe2b3bff85e17b.tar.gz |
Limit GCC SSP support to 4.x and newer.
Diffstat (limited to 'mk/compiler')
-rw-r--r-- | mk/compiler/gcc.mk | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index d3416828a4b..d6419e0822e 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -1,4 +1,4 @@ -# $NetBSD: gcc.mk,v 1.183 2017/08/25 01:43:17 khorben Exp $ +# $NetBSD: gcc.mk,v 1.184 2017/09/11 09:06:41 jperkin Exp $ # # This is the compiler definition for the GNU Compiler Collection. # @@ -372,12 +372,14 @@ CWRAPPERS_APPEND.ld+= ${_RELRO_LDFLAGS} .endif # The user can choose the level of stack smashing protection. -.if ${PKGSRC_USE_SSP} == "all" +.if ${_GCC_VERSION:C/\..*$//} >= 4 +. if ${PKGSRC_USE_SSP} == "all" _SSP_CFLAGS= -fstack-protector-all -.elif ${PKGSRC_USE_SSP} == "strong" +. elif ${PKGSRC_USE_SSP} == "strong" _SSP_CFLAGS= -fstack-protector-strong -.else +. else _SSP_CFLAGS= -fstack-protector +. endif .endif _STACK_CHECK_CFLAGS= -fstack-check |