Add NO{SSP,FORTIFY}

This commit is contained in:
christos 2016-03-13 17:56:56 +00:00
parent 72fae1ce63
commit 54d5052a6c
4 changed files with 13 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.README,v 1.352 2016/02/21 03:34:27 christos Exp $
# $NetBSD: bsd.README,v 1.353 2016/03/13 17:56:56 christos Exp $
# @(#)bsd.README 8.2 (Berkeley) 4/2/94
This is the README file for the make "include" files for the NetBSD
@ -487,6 +487,9 @@ USE_SSP If "no", disables GCC stack protection code, which
of about 5%.
Default: "no", unless "USE_FORT" is set to "yes"
NOSSP Don't compile with stack protector during build.
It is set internally for standalone programs.
USE_FORT If "yes" turns on substitute wrappers for commonly used
functions that do not do bounds checking regularly, but
they could in some cases by using the gcc
@ -495,6 +498,9 @@ USE_FORT If "yes" turns on substitute wrappers for commonly used
These substitute functions are in /usr/include/ssp.
Default: depends on the part of the source tree
NOFORT Don't compile with substitute wrappers during build.
It is set internally for standalone programs.
USE_YP If "no", disables building YP (NIS) support into
various system utilities/libraries that support it.
If ${MKYP} is "no", USE_YP will also be forced to "no".

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk,v 1.906 2016/03/13 01:06:51 mrg Exp $
# $NetBSD: bsd.own.mk,v 1.907 2016/03/13 17:56:56 christos Exp $
# This needs to be before bsd.init.mk
.if defined(BSD_MK_COMPAT_FILE)
@ -122,7 +122,7 @@ HAVE_LIBGCC_EH?= yes
HAVE_SSP?= no
.else
HAVE_SSP?= yes
.if ${USE_FORT:Uno} != "no"
.if !defined(NOFORT) && ${USE_FORT:Uno} != "no"
USE_SSP?= yes
.endif
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.sys.mk,v 1.254 2016/03/12 23:08:58 mrg Exp $
# $NetBSD: bsd.sys.mk,v 1.255 2016/03/13 17:56:56 christos Exp $
#
# Build definitions used for NetBSD source tree builds.
@ -114,7 +114,7 @@ _NOWERROR= ${defined(NOGCCERROR) || (${ACTIVE_CC} == "clang" && defined(NOCLANGE
CFLAGS+= ${${_NOWERROR} == "no" :?-Werror:} ${CWARNFLAGS}
LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include}
.if (${USE_SSP:Uno} != "no") && (${BINDIR:Ux} != "/usr/mdec")
.if !defined(NOSSP) && (${USE_SSP:Uno} != "no") && (${BINDIR:Ux} != "/usr/mdec")
.if !defined(KERNSRCDIR) && !defined(KERN) # not for kernels nor kern modules
CPPFLAGS+= -D_FORTIFY_SOURCE=2
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.x11.mk,v 1.117 2015/07/23 08:03:26 mrg Exp $
# $NetBSD: bsd.x11.mk,v 1.118 2016/03/13 17:56:56 christos Exp $
.include <bsd.init.mk>
@ -10,7 +10,7 @@ COPTS+= -fno-strict-aliasing
.include <bsd.sys.mk>
.if defined(USE_SSP) && (${USE_SSP} != "no")
.if !defined(NOSSP) && (${USE_SSP:Uno} != "no")
CPPFLAGS+= -DNO_ALLOCA
.endif