summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2022-08-01 07:58:21 +0000
committerwiz <wiz@pkgsrc.org>2022-08-01 07:58:21 +0000
commit1c461a643d16df710341ee914c3850e08bfd3f2a (patch)
treefaf75d934bb6c03425269138fd860ea80663280f /mk
parent5ae6b4ec7e1e3ed610a6d124a87a2b6dbbdeb711 (diff)
downloadpkgsrc-1c461a643d16df710341ee914c3850e08bfd3f2a.tar.gz
mk: add stack-clash option to PKGSRC_USE_STACK_CHECK
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.prefs.mk6
-rw-r--r--mk/compiler/gcc.mk8
-rw-r--r--mk/defaults/mk.conf7
3 files changed, 14 insertions, 7 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index ffa241d251e..850a2575487 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.424 2022/07/22 09:27:01 nia Exp $
+# $NetBSD: bsd.prefs.mk,v 1.425 2022/08/01 07:58:21 wiz Exp $
#
# This file includes the mk.conf file, which contains the user settings.
#
@@ -855,7 +855,11 @@ _PKGSRC_USE_STACK_CHECK=no
.if ${PKGSRC_USE_STACK_CHECK:tl} != "no" && \
${STACK_CHECK_SUPPORTED:Uyes:tl} == "yes" && \
${_OPSYS_SUPPORTS_STACK_CHECK:Uno} == "yes"
+. if ${PKGSRC_USE_STACK_CHECK:tl} == "stack-clash"
+_PKGSRC_USE_STACK_CHECK=stack-clash
+. else
_PKGSRC_USE_STACK_CHECK=yes
+. endif
.endif
# Enable CTF conversion if the user requested it, the OPSYS supports it, there
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk
index 2f55ad9a7ce..bd1f43d5fc9 100644
--- a/mk/compiler/gcc.mk
+++ b/mk/compiler/gcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.245 2022/07/07 16:23:39 jperkin Exp $
+# $NetBSD: gcc.mk,v 1.246 2022/08/01 07:58:21 wiz Exp $
#
# This is the compiler definition for the GNU Compiler Collection.
#
@@ -443,9 +443,11 @@ _RELRO_LDFLAGS= -Wl,-zrelro
_RELRO_LDFLAGS+= -Wl,-z,common-page-size=0x10000
.endif
-_STACK_CHECK_CFLAGS= -fstack-check
-
.if ${_PKGSRC_USE_STACK_CHECK} == "yes"
+_STACK_CHECK_CFLAGS= -fstack-check
+_GCC_CFLAGS+= ${_STACK_CHECK_CFLAGS}
+.elif ${_PKGSRC_USE_STACK_CHECK} == "stack-clash"
+_STACK_CHECK_CFLAGS= -fstack-clash-protection
_GCC_CFLAGS+= ${_STACK_CHECK_CFLAGS}
.endif
diff --git a/mk/defaults/mk.conf b/mk/defaults/mk.conf
index 8743e01f641..40cb59e156a 100644
--- a/mk/defaults/mk.conf
+++ b/mk/defaults/mk.conf
@@ -1,4 +1,4 @@
-# $NetBSD: mk.conf,v 1.334 2022/06/07 10:04:25 jperkin Exp $
+# $NetBSD: mk.conf,v 1.335 2022/08/01 07:58:21 wiz Exp $
#
# This file provides default values for variables that may be overridden
@@ -305,8 +305,9 @@ PKGSRC_USE_SSP?= strong
PKGSRC_USE_STACK_CHECK?= no
# Configure this to enable stack boundary verification (on supported platforms).
# Possible values:
-# no: Do not pass any stack protection flags
-# yes: Pass -fstack-check
+# no: Do not pass any stack protection flags
+# yes: Pass -fstack-check
+# clash-protection: Pass -fstack-clash-protection
# Default: no
# The default PREFER_PKGSRC should be empty, but due to historical reasons we have the list below.