Source-Changes-HG archive

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

[src/trunk]: src/share/mk Enable Stack Smash Protection (SSP) by default for ...



details:   https://anonhg.NetBSD.org/src/rev/6a47e03d257e
branches:  trunk
changeset: 748951:6a47e03d257e
user:      tron <tron%NetBSD.org@localhost>
date:      Wed Nov 11 16:35:45 2009 +0000

description:
Enable Stack Smash Protection (SSP) by default for NetBSD/amd64 and
NetBSD/i386 as previously discussed on the "port-amd64" and
"port-i386" mailing lists. No objections from the core team.

Thanks a lot to Tobias Nygren for helping me with the benchmarking
and to Christos Zoulas for fixing SSP problems in cgd(4).

diffstat:

 share/mk/bsd.sys.mk |  7 ++++++-
 share/mk/bsd.x11.mk |  4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 60dce7c12991 -r 6a47e03d257e share/mk/bsd.sys.mk
--- a/share/mk/bsd.sys.mk       Wed Nov 11 16:08:31 2009 +0000
+++ b/share/mk/bsd.sys.mk       Wed Nov 11 16:35:45 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.sys.mk,v 1.181 2009/11/09 15:58:09 skrll Exp $
+#      $NetBSD: bsd.sys.mk,v 1.182 2009/11/11 16:35:45 tron Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -59,6 +59,11 @@
 HAS_SSP=       yes
 .endif
 
+.if ((${MACHINE_ARCH} == "amd64") || (${MACHINE_ARCH} == "i386") && \
+     (_SRC_TOP_ != ""))
+USE_SSP?=      yes
+.endif
+
 .if defined(USE_FORT) && (${USE_FORT} != "no")
 USE_SSP?=      yes
 .if !defined(KERNSRCDIR) && !defined(KERN) # not for kernels nor kern modules
diff -r 60dce7c12991 -r 6a47e03d257e share/mk/bsd.x11.mk
--- a/share/mk/bsd.x11.mk       Wed Nov 11 16:08:31 2009 +0000
+++ b/share/mk/bsd.x11.mk       Wed Nov 11 16:35:45 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.x11.mk,v 1.79 2009/11/09 07:38:14 mrg Exp $
+#      $NetBSD: bsd.x11.mk,v 1.80 2009/11/11 16:35:45 tron Exp $
 
 .include <bsd.init.mk>
 
@@ -8,6 +8,8 @@
 
 COPTS+=                        -fno-strict-aliasing
 
+.include <bsd.sys.mk>
+
 .if defined(USE_SSP) && (${USE_SSP} != "no")
 CPPFLAGS+=             -DNO_ALLOCA
 .endif



Home | Main Index | Thread Index | Old Index