pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   khorben
Date:           Sun Jul  9 14:30:07 UTC 2017

Modified Files:
        pkgsrc/mk: bsd.prefs.mk
        pkgsrc/mk/compiler: gcc.mk
        pkgsrc/mk/defaults: mk.conf
        pkgsrc/mk/platform: NetBSD.mk

Log Message:
Register support for PKGSRC_USE_STACK_CHECK

This adds -fstack-check to the CFLAGS (with GCC on NetBSD x86). Only
tested on NetBSD/amd64 so far.

Disabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.392 -r1.393 pkgsrc/mk/bsd.prefs.mk
cvs rdiff -u -r1.179 -r1.180 pkgsrc/mk/compiler/gcc.mk
cvs rdiff -u -r1.277 -r1.278 pkgsrc/mk/defaults/mk.conf
cvs rdiff -u -r1.51 -r1.52 pkgsrc/mk/platform/NetBSD.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/bsd.prefs.mk
diff -u pkgsrc/mk/bsd.prefs.mk:1.392 pkgsrc/mk/bsd.prefs.mk:1.393
--- pkgsrc/mk/bsd.prefs.mk:1.392        Thu Jun  1 02:15:10 2017
+++ pkgsrc/mk/bsd.prefs.mk      Sun Jul  9 14:30:07 2017
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.392 2017/06/01 02:15:10 jlam Exp $
+# $NetBSD: bsd.prefs.mk,v 1.393 2017/07/09 14:30:07 khorben Exp $
 #
 # This file includes the mk.conf file, which contains the user settings.
 #
@@ -717,6 +717,12 @@ _PKGSRC_USE_SSP=   no
 _PKGSRC_USE_SSP=       yes
 .endif
 
+_PKGSRC_USE_STACK_CHECK=no
+.if (${PKGSRC_USE_STACK_CHECK:tl} != "no") && \
+    (${_OPSYS_SUPPORTS_STACK_CHECK:Uno} == "yes")
+_PKGSRC_USE_STACK_CHECK=yes
+.endif
+
 # Enable cwrappers if not building the wrappers themselves, and if the user has
 # explicitly requested them, or if they haven't but the compiler/platform is
 # known to support them.

Index: pkgsrc/mk/compiler/gcc.mk
diff -u pkgsrc/mk/compiler/gcc.mk:1.179 pkgsrc/mk/compiler/gcc.mk:1.180
--- pkgsrc/mk/compiler/gcc.mk:1.179     Sun Jun 25 01:41:15 2017
+++ pkgsrc/mk/compiler/gcc.mk   Sun Jul  9 14:30:07 2017
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.179 2017/06/25 01:41:15 joerg Exp $
+# $NetBSD: gcc.mk,v 1.180 2017/07/09 14:30:07 khorben Exp $
 #
 # This is the compiler definition for the GNU Compiler Collection.
 #
@@ -372,6 +372,12 @@ _SSP_CFLAGS=               -fstack-protector-strong
 _SSP_CFLAGS=           -fstack-protector
 .endif
 
+_STACK_CHECK_CFLAGS=   -fstack-check
+
+.if ${_PKGSRC_USE_STACK_CHECK} == "yes"
+_GCC_CFLAGS+=          ${_STACK_CHECK_CFLAGS}
+.endif
+
 # GCC has this annoying behaviour where it advocates in a multi-line
 # banner the use of "#include" over "#import" when including headers.
 # This generates a huge number of warnings when building practically all

Index: pkgsrc/mk/defaults/mk.conf
diff -u pkgsrc/mk/defaults/mk.conf:1.277 pkgsrc/mk/defaults/mk.conf:1.278
--- pkgsrc/mk/defaults/mk.conf:1.277    Wed Jul  5 15:58:30 2017
+++ pkgsrc/mk/defaults/mk.conf  Sun Jul  9 14:30:07 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mk.conf,v 1.277 2017/07/05 15:58:30 khorben Exp $
+# $NetBSD: mk.conf,v 1.278 2017/07/09 14:30:07 khorben Exp $
 #
 
 # This file provides default values for variables that may be overridden
@@ -258,6 +258,13 @@ PKGSRC_USE_SSP?= yes
 #      all:    Pass -fstack-protector-all
 # Default: yes
 
+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
+# Default: no
+
 # The default PREFER_PKGSRC should be empty, but due to historical reasons we have the list below.
 # Please add your platform here once you have confirmed it is correct
 .if ${OPSYS} == "OpenBSD" || ${OPSYS} == "Bitrig"

Index: pkgsrc/mk/platform/NetBSD.mk
diff -u pkgsrc/mk/platform/NetBSD.mk:1.51 pkgsrc/mk/platform/NetBSD.mk:1.52
--- pkgsrc/mk/platform/NetBSD.mk:1.51   Tue Jul  4 18:29:24 2017
+++ pkgsrc/mk/platform/NetBSD.mk        Sun Jul  9 14:30:07 2017
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.mk,v 1.51 2017/07/04 18:29:24 khorben Exp $
+# $NetBSD: NetBSD.mk,v 1.52 2017/07/09 14:30:07 khorben Exp $
 #
 # Variable definitions for the NetBSD operating system.
 
@@ -154,6 +154,12 @@ _OPSYS_SUPPORTS_RELRO=     yes
 _OPSYS_SUPPORTS_SSP=   yes
 .endif
 
+# Register support for stack check on supported architectures (with GCC)
+.if (${MACHINE_ARCH} == "i386") || \
+    (${MACHINE_ARCH} == "x86_64")
+_OPSYS_SUPPORTS_STACK_CHECK=   yes
+.endif
+
 _OPSYS_SUPPORTS_CWRAPPERS=     yes
 
 # use readelf in check/bsd.check-vars.mk



Home | Main Index | Thread Index | Old Index