summaryrefslogtreecommitdiff
path: root/mk/platform
diff options
context:
space:
mode:
authorkhorben <khorben@pkgsrc.org>2015-07-26 22:13:17 +0000
committerkhorben <khorben@pkgsrc.org>2015-07-26 22:13:17 +0000
commit3098266ee9c6f169aeaa48359ab80d32a2150d59 (patch)
treed2a51992cf041582786d2ec545c7cb45584d560c /mk/platform
parent6d02600cec5fee755bb72c3bf720d6408083ee58 (diff)
downloadpkgsrc-3098266ee9c6f169aeaa48359ab80d32a2150d59.tar.gz
Add support for compiling with stack-smashing protection
This is enabled with PKGSRC_USE_SSP in mk.conf(5), as documented there. Most NetBSD platforms are supported (when compiling with gcc). After consensus on tech-pkg@.
Diffstat (limited to 'mk/platform')
-rw-r--r--mk/platform/NetBSD.mk12
1 files changed, 11 insertions, 1 deletions
diff --git a/mk/platform/NetBSD.mk b/mk/platform/NetBSD.mk
index c83b5d5c5dc..8a0cda4dd43 100644
--- a/mk/platform/NetBSD.mk
+++ b/mk/platform/NetBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.mk,v 1.42 2015/05/26 10:08:37 joerg Exp $
+# $NetBSD: NetBSD.mk,v 1.43 2015/07/26 22:13:17 khorben Exp $
#
# Variable definitions for the NetBSD operating system.
@@ -128,6 +128,16 @@ FFLAGS+= -mieee
PKG_HAVE_KQUEUE= # defined
.endif
+.if (${MACHINE_ARCH} != "alpha") && \
+ (${MACHINE_ARCH} != "hppa") && \
+ (${MACHINE_ARCH} != "ia64") && \
+ (${MACHINE_ARCH} != "mips")
+. if ${PKGSRC_USE_SSP:Uno} != "no"
+# build with stack protection (with GCC)
+_GCC_CFLAGS+= -fstack-protector
+. endif
+.endif
+
_OPSYS_CAN_CHECK_SHLIBS= yes # use readelf in check/bsd.check-vars.mk
# check for maximum command line length and set it in configure's environment,