Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Sep 2008 14:46:53 +0200
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        freebsd-hackers@FreeBSD.org
Subject:   Creation of the NO_SSP build knob
Message-ID:  <20080904124653.GK72107@obiwan.tataz.chchile.org>

next in thread | raw e-mail | index | archive | help

--5/uDoXvLw7AC5HRs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

There is currently a knob to enable/disable SSP: WITH_SSP or
WITHOUT_SSP.  WITH_SSP is the default on -CURRENT, so no one had to put
WITH_SSP= in src.conf(5).  This has hidden the following bug so far:

When buildworld is run with WITH_SSP= on command-line or in src.conf(5),
it fails immediately with the following message, because the toolchain
is built with WITHOUT_SSP:

% "/usr/src/share/mk/bsd.own.mk", line 365: WITH_SSP and WITHOUT_SSP can't both be set.

My leaning is to create an additional knob NO_SSP, much like
NO_CPU_CFLAGS, that could be set internally.  However I'm not sure it
complies with the src.conf(5) policy.  Any objection to the patch below?

Thank you!
Best regards,
-- 
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >

--5/uDoXvLw7AC5HRs
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="NO_SSP.diff"

Index: Makefile.inc1
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/Makefile.inc1,v
retrieving revision 1.610
diff -u -p -r1.610 Makefile.inc1
--- Makefile.inc1	19 Aug 2008 14:23:26 -0000	1.610
+++ Makefile.inc1	4 Sep 2008 12:42:50 -0000
@@ -225,7 +225,7 @@ BMAKE=		MAKEOBJDIRPREFIX=${WORLDTMP} \
 		${BMAKEENV} ${MAKE} -f Makefile.inc1 \
 		DESTDIR= \
 		BOOTSTRAPPING=${OSRELDATE} \
-		-DWITHOUT_SSP \
+		-DNO_SSP \
 		-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
 		-DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \
 		-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF
@@ -236,7 +236,7 @@ TMAKE=		MAKEOBJDIRPREFIX=${OBJTREE} \
 		TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
 		DESTDIR= \
 		BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \
-		-DNO_WARNS -DNO_CTF -DWITHOUT_SSP
+		-DNO_WARNS -DNO_CTF -DNO_SSP
 
 # cross-tools stage
 XMAKE=		TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
@@ -453,7 +453,7 @@ build32:
 .if ${MK_KERBEROS} != "no"
 .for _t in obj depend all
 	cd ${.CURDIR}/kerberos5/tools; \
-	    MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DWITHOUT_SSP DESTDIR= \
+	    MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DNO_SSP DESTDIR= \
 	    ${_t}
 .endfor
 .endif
@@ -476,7 +476,7 @@ build32:
 .endfor
 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
 	cd ${.CURDIR}/${_dir}; \
-	    MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DWITHOUT_SSP DESTDIR= \
+	    MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DNO_SSP DESTDIR= \
 	    build-tools
 .endfor
 	cd ${.CURDIR}; \
@@ -765,14 +765,14 @@ buildkernel:
 	@echo "--------------------------------------------------------------"
 	cd ${KRNLOBJDIR}/${_kernel}; \
 	    MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
-	    ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF \
+	    ${MAKE} -DNO_SSP -DNO_CPU_CFLAGS -DNO_CTF \
 	    -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
 # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
 .for target in obj depend all
 	cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
 	    MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
-	    ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target}
+	    ${MAKE} -DNO_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target}
 .endfor
 .endif
 .if !defined(NO_KERNELDEPEND)
Index: gnu/lib/csu/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/gnu/lib/csu/Makefile,v
retrieving revision 1.29
diff -u -p -r1.29 Makefile
--- gnu/lib/csu/Makefile	25 Jun 2008 21:33:28 -0000	1.29
+++ gnu/lib/csu/Makefile	4 Sep 2008 12:42:50 -0000
@@ -19,7 +19,7 @@ CFLAGS+=	-I${GCCLIB}/include -I${GCCDIR}
 		-I${CCDIR}/cc_tools
 CRTS_CFLAGS=	-DCRTSTUFFS_O -DSHARED ${PICFLAG}
 MKDEP=		-DCRT_BEGIN
-WITHOUT_SSP=
+NO_SSP=
 
 .if ${MACHINE_ARCH} == "ia64"
 BEGINSRC=	crtbegin.asm
Index: gnu/lib/libssp/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/gnu/lib/libssp/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- gnu/lib/libssp/Makefile	25 Jun 2008 21:33:28 -0000	1.3
+++ gnu/lib/libssp/Makefile	4 Sep 2008 12:42:50 -0000
@@ -10,7 +10,7 @@ LIB=		ssp
 SHLIB_MAJOR=	0
 SHLIBDIR?=	/lib
 NO_PROFILE=
-WITHOUT_SSP=
+NO_SSP=
 
 SRCS=	ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
 	memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \
Index: lib/csu/Makefile.inc
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/lib/csu/Makefile.inc,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile.inc
--- lib/csu/Makefile.inc	25 Jun 2008 21:33:28 -0000	1.1
+++ lib/csu/Makefile.inc	4 Sep 2008 12:42:50 -0000
@@ -1,3 +1,3 @@
 # $FreeBSD: src/lib/csu/Makefile.inc,v 1.1 2008/06/25 21:33:28 ru Exp $
 
-WITHOUT_SSP=
+NO_SSP=
Index: lib/libstand/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/lib/libstand/Makefile,v
retrieving revision 1.62
diff -u -p -r1.62 Makefile
--- lib/libstand/Makefile	25 Jun 2008 21:33:28 -0000	1.62
+++ lib/libstand/Makefile	4 Sep 2008 12:42:50 -0000
@@ -12,7 +12,7 @@ NO_PIC=
 INCS=		stand.h
 MAN=		libstand.3
 
-WITHOUT_SSP=
+NO_SSP=
 CFLAGS+= -ffreestanding -Wformat
 CFLAGS+= -I${.CURDIR}
 
Index: lib/libthr/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/lib/libthr/Makefile,v
retrieving revision 1.35
diff -u -p -r1.35 Makefile
--- lib/libthr/Makefile	25 Jun 2008 21:33:28 -0000	1.35
+++ lib/libthr/Makefile	4 Sep 2008 12:42:50 -0000
@@ -8,7 +8,7 @@
 # (for system call stubs) to CFLAGS below.  -DSYSLIBC_SCCS affects just the
 # system call stubs.
 
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: libexec/rtld-elf/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/libexec/rtld-elf/Makefile,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile
--- libexec/rtld-elf/Makefile	25 Jun 2008 21:33:28 -0000	1.42
+++ libexec/rtld-elf/Makefile	4 Sep 2008 12:42:50 -0000
@@ -1,6 +1,6 @@
 # $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.42 2008/06/25 21:33:28 ru Exp $
 
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: rescue/librescue/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/rescue/librescue/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- rescue/librescue/Makefile	25 Jun 2008 21:33:28 -0000	1.10
+++ rescue/librescue/Makefile	4 Sep 2008 12:42:50 -0000
@@ -2,7 +2,7 @@
 # $FreeBSD: src/rescue/librescue/Makefile,v 1.10 2008/06/25 21:33:28 ru Exp $
 #
 
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: rescue/rescue/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/rescue/rescue/Makefile,v
retrieving revision 1.63
diff -u -p -r1.63 Makefile
--- rescue/rescue/Makefile	31 Aug 2008 14:27:59 -0000	1.63
+++ rescue/rescue/Makefile	4 Sep 2008 12:42:50 -0000
@@ -2,7 +2,7 @@
 #	@(#)Makefile	8.1 (Berkeley) 6/2/93
 
 NO_MAN=
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: share/mk/bsd.sys.mk
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/share/mk/bsd.sys.mk,v
retrieving revision 1.47
diff -u -p -r1.47 bsd.sys.mk
--- share/mk/bsd.sys.mk	23 Jul 2008 06:14:21 -0000	1.47
+++ share/mk/bsd.sys.mk	4 Sep 2008 12:39:22 -0000
@@ -74,8 +74,9 @@ CWARNFLAGS	+=	-Werror
 CWARNFLAGS	+=	-Wno-unknown-pragmas
 .endif
 
-.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_ARCH} != "ia64" && \
-	${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
+.if ${MK_SSP} != "no" && !defined(NO_SSP) && ${CC} != "icc" && \
+	${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "arm" && \
+	${MACHINE_ARCH} != "mips"
 # Don't use -Wstack-protector as it breaks world with -Werror.
 SSP_CFLAGS	?=	-fstack-protector
 CFLAGS		+=	${SSP_CFLAGS}
Index: sys/boot/Makefile.inc
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/sys/boot/Makefile.inc,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile.inc
--- sys/boot/Makefile.inc	25 Jun 2008 21:33:28 -0000	1.1
+++ sys/boot/Makefile.inc	4 Sep 2008 12:42:50 -0000
@@ -1,3 +1,3 @@
 # $FreeBSD: src/sys/boot/Makefile.inc,v 1.1 2008/06/25 21:33:28 ru Exp $
 
-WITHOUT_SSP=
+NO_SSP=
Index: sys/boot/i386/loader/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/sys/boot/i386/loader/Makefile,v
retrieving revision 1.86
diff -u -p -r1.86 Makefile
--- sys/boot/i386/loader/Makefile	25 Jun 2008 21:33:28 -0000	1.86
+++ sys/boot/i386/loader/Makefile	4 Sep 2008 12:42:50 -0000
@@ -1,6 +1,6 @@
 # $FreeBSD: src/sys/boot/i386/loader/Makefile,v 1.86 2008/06/25 21:33:28 ru Exp $
 
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: sys/boot/ia64/common/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/sys/boot/ia64/common/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- sys/boot/ia64/common/Makefile	25 Jun 2008 21:33:28 -0000	1.2
+++ sys/boot/ia64/common/Makefile	4 Sep 2008 12:42:50 -0000
@@ -1,6 +1,6 @@
 # $FreeBSD: src/sys/boot/ia64/common/Makefile,v 1.2 2008/06/25 21:33:28 ru Exp $
 
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: sys/boot/ia64/efi/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/sys/boot/ia64/efi/Makefile,v
retrieving revision 1.29
diff -u -p -r1.29 Makefile
--- sys/boot/ia64/efi/Makefile	25 Jun 2008 21:33:28 -0000	1.29
+++ sys/boot/ia64/efi/Makefile	4 Sep 2008 12:42:50 -0000
@@ -1,7 +1,7 @@
 # $FreeBSD: src/sys/boot/ia64/efi/Makefile,v 1.29 2008/06/25 21:33:28 ru Exp $
 
 NO_MAN=
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: sys/boot/ia64/ski/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/sys/boot/ia64/ski/Makefile,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile
--- sys/boot/ia64/ski/Makefile	25 Jun 2008 21:33:28 -0000	1.21
+++ sys/boot/ia64/ski/Makefile	4 Sep 2008 12:42:50 -0000
@@ -1,7 +1,7 @@
 # $FreeBSD: src/sys/boot/ia64/ski/Makefile,v 1.21 2008/06/25 21:33:28 ru Exp $
 
 NO_MAN=
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: sys/boot/pc98/loader/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/sys/boot/pc98/loader/Makefile,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile
--- sys/boot/pc98/loader/Makefile	25 Jun 2008 21:33:28 -0000	1.42
+++ sys/boot/pc98/loader/Makefile	4 Sep 2008 12:42:50 -0000
@@ -1,6 +1,6 @@
 # $FreeBSD: src/sys/boot/pc98/loader/Makefile,v 1.42 2008/06/25 21:33:28 ru Exp $
 
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: sys/boot/powerpc/ofw/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/sys/boot/powerpc/ofw/Makefile,v
retrieving revision 1.24
diff -u -p -r1.24 Makefile
--- sys/boot/powerpc/ofw/Makefile	25 Jun 2008 21:33:28 -0000	1.24
+++ sys/boot/powerpc/ofw/Makefile	4 Sep 2008 12:42:50 -0000
@@ -1,6 +1,6 @@
 # $FreeBSD: src/sys/boot/powerpc/ofw/Makefile,v 1.24 2008/06/25 21:33:28 ru Exp $
 
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 
Index: sys/boot/sparc64/loader/Makefile
===================================================================
RCS file: /mnt/octobre/space/freebsd-cvs/src/sys/boot/sparc64/loader/Makefile,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile
--- sys/boot/sparc64/loader/Makefile	25 Jun 2008 21:33:28 -0000	1.21
+++ sys/boot/sparc64/loader/Makefile	4 Sep 2008 12:42:50 -0000
@@ -1,6 +1,6 @@
 # $FreeBSD: src/sys/boot/sparc64/loader/Makefile,v 1.21 2008/06/25 21:33:28 ru Exp $
 
-WITHOUT_SSP=
+NO_SSP=
 
 .include <bsd.own.mk>
 

--5/uDoXvLw7AC5HRs--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080904124653.GK72107>