pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk mk: add stack-clash option to PKGSRC_USE_STACK_CHECK
details: https://anonhg.NetBSD.org/pkgsrc/rev/4d66d36f3908
branches: trunk
changeset: 382583:4d66d36f3908
user: wiz <wiz%pkgsrc.org@localhost>
date: Mon Aug 01 07:58:21 2022 +0000
description:
mk: add stack-clash option to PKGSRC_USE_STACK_CHECK
diffstat:
mk/bsd.prefs.mk | 6 +++++-
mk/compiler/gcc.mk | 8 +++++---
mk/defaults/mk.conf | 7 ++++---
3 files changed, 14 insertions(+), 7 deletions(-)
diffs (65 lines):
diff -r dce468348e2a -r 4d66d36f3908 mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk Mon Aug 01 07:58:05 2022 +0000
+++ b/mk/bsd.prefs.mk Mon Aug 01 07:58:21 2022 +0000
@@ -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 @@
.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 -r dce468348e2a -r 4d66d36f3908 mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk Mon Aug 01 07:58:05 2022 +0000
+++ b/mk/compiler/gcc.mk Mon Aug 01 07:58:21 2022 +0000
@@ -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,-z,common-page-size=0x10000
.endif
+.if ${_PKGSRC_USE_STACK_CHECK} == "yes"
_STACK_CHECK_CFLAGS= -fstack-check
-
-.if ${_PKGSRC_USE_STACK_CHECK} == "yes"
+_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 -r dce468348e2a -r 4d66d36f3908 mk/defaults/mk.conf
--- a/mk/defaults/mk.conf Mon Aug 01 07:58:05 2022 +0000
+++ b/mk/defaults/mk.conf Mon Aug 01 07:58:21 2022 +0000
@@ -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_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.
Home |
Main Index |
Thread Index |
Old Index