From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 5 18:24:01 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E85BE106564A; Fri, 5 Sep 2008 18:24:01 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp4-g19.free.fr (smtp4-g19.free.fr [212.27.42.30]) by mx1.freebsd.org (Postfix) with ESMTP id 43E2C8FC14; Fri, 5 Sep 2008 18:24:00 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp4-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp4-g19.free.fr (Postfix) with ESMTP id A2AF83EA141; Fri, 5 Sep 2008 20:23:59 +0200 (CEST) Received: from tatooine.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp4-g19.free.fr (Postfix) with ESMTP id 4D5E23EA134; Fri, 5 Sep 2008 20:23:59 +0200 (CEST) Received: from obiwan.tataz.chchile.org (unknown [192.168.1.25]) by tatooine.tataz.chchile.org (Postfix) with ESMTP id 4BCE69B497; Fri, 5 Sep 2008 18:16:34 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id 3628F4089; Fri, 5 Sep 2008 20:16:34 +0200 (CEST) Date: Fri, 5 Sep 2008 20:16:34 +0200 From: Jeremie Le Hen To: Ruslan Ermilov Message-ID: <20080905181634.GC11644@obiwan.tataz.chchile.org> References: <20080904124653.GK72107@obiwan.tataz.chchile.org> <20080904135200.GC31289@alpha.local> <86ljy857zz.fsf@ds4.des.no> <20080904141705.GL72107@obiwan.tataz.chchile.org> <86hc8w55mr.fsf@ds4.des.no> <20080904154138.GM72107@obiwan.tataz.chchile.org> <8663pbzp97.fsf@ds4.des.no> <20080905070028.GN72107@obiwan.tataz.chchile.org> <20080905140204.GA6498@edoofus.dev.vega.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <20080905140204.GA6498@edoofus.dev.vega.ru> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Dag-Erling Smorgrav , freebsd-hackers@FreeBSD.org Subject: Re: Creation of the NO_SSP build knob X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2008 18:24:02 -0000 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Ruslan, On Fri, Sep 05, 2008 at 06:02:04PM +0400, Ruslan Ermilov wrote: > This is not the way the things were designed to work. > > http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html > > WITH_*/WITHOUT_* are for users, and MK_* are for makefiles. > > NO_*'s are mainly for backwards compatibility and (to the lesser > extent) to support some of the makefile buzzwords like NO_MAN. > > There's no possibility to easily make what you want, i.e., disable > SSP for some parts of the tree. Doing it for particular makefiles > OTOH should be pretty easy, by starting a makefile with the > following two lines: > > .include > MK_SSP=no > > bsd.own.mk will set MK_SSP as per default ("yes"), then possibly > reset it to "no" if a user set WITHOUT_SSP (either on a command > line, in /etc/make.conf, or in environment), and then the second > line will unconditionally reset it to "no". > > This will work in the SSP case, but may not work in general > because some options have dependencies. Fortunately, cases like > this are rare. (There are several makefiles in the tree that > already do this; "grep ^MK_" to see them.) Thank you for this clarification. Unfortunately, I can't use MK_SSP in Makefile.inc1. The only option I see is to override SSP_CFLAGS on ${BMAKE} and ${TMAKE} command-line. There is also a problem with some Makefile.inc containing NO_SSP. It's not possible to turn those to "MK_SSP= no" because bsd.init.mk includes ../Makefile.inc before bsd.own.mk. Would you agree with the attached patch? Or would you prefer to use SSP_CFLAGS everywhere? Thank you! -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > --liOOAslEiF7prFVr Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="MK_SSP=no.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 5 Sep 2008 15:16:25 -0000 @@ -225,7 +225,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ - -DWITHOUT_SSP \ + SSP_CFLAGS= \ -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF @@ -235,8 +235,9 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ DESTDIR= \ + SSP_CFLAGS= \ BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \ - -DNO_WARNS -DNO_CTF -DWITHOUT_SSP + -DNO_WARNS -DNO_CTF # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -453,7 +454,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} SSP_CFLAGS= DESTDIR= \ ${_t} .endfor .endif @@ -476,7 +477,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} SSP_CFLAGS= DESTDIR= \ build-tools .endfor cd ${.CURDIR}; \ @@ -765,14 +766,14 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF \ + ${MAKE} SSP_CFLAGS= -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} SSP_CFLAGS= -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 5 Sep 2008 15:24:07 -0000 @@ -1,5 +1,8 @@ # $FreeBSD: src/gnu/lib/csu/Makefile,v 1.29 2008/06/25 21:33:28 ru Exp $ +.include +MK_SSP= no + GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs CCDIR= ${.CURDIR}/../../usr.bin/cc @@ -19,7 +22,6 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR} -I${CCDIR}/cc_tools CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} MKDEP= -DCRT_BEGIN -WITHOUT_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 5 Sep 2008 15:24:00 -0000 @@ -1,5 +1,8 @@ # $FreeBSD: src/gnu/lib/libssp/Makefile,v 1.3 2008/06/25 21:33:28 ru Exp $ +.include +MK_SSP= no + GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs SRCDIR= ${GCCLIB}/libssp @@ -10,7 +13,6 @@ LIB= ssp SHLIB_MAJOR= 0 SHLIBDIR?= /lib NO_PROFILE= -WITHOUT_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 5 Sep 2008 15:17:19 -0000 @@ -1,3 +1,3 @@ # $FreeBSD: src/lib/csu/Makefile.inc,v 1.1 2008/06/25 21:33:28 ru Exp $ -WITHOUT_SSP= +SSP_CFLAGS= 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 5 Sep 2008 15:23:52 -0000 @@ -6,13 +6,15 @@ # quite large. # +.include +MK_SSP= no + LIB= stand NO_PROFILE= NO_PIC= INCS= stand.h MAN= libstand.3 -WITHOUT_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 5 Sep 2008 15:23:47 -0000 @@ -8,9 +8,8 @@ # (for system call stubs) to CFLAGS below. -DSYSLIBC_SCCS affects just the # system call stubs. -WITHOUT_SSP= - .include +MK_SSP= no .if ${SHLIBDIR} == "/usr/lib" SHLIBDIR= /lib 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 5 Sep 2008 15:23:40 -0000 @@ -1,8 +1,7 @@ # $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.42 2008/06/25 21:33:28 ru Exp $ -WITHOUT_SSP= - .include +MK_SSP= no PROG?= ld-elf.so.1 SRCS= rtld_start.S \ 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 5 Sep 2008 15:23:36 -0000 @@ -2,9 +2,8 @@ # $FreeBSD: src/rescue/librescue/Makefile,v 1.10 2008/06/25 21:33:28 ru Exp $ # -WITHOUT_SSP= - .include +MK_SSP= no # Certain library entries have hard-coded references to # /bin, /sbin, etc, that require those entries to be 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 5 Sep 2008 18:03:12 -0000 @@ -2,9 +2,9 @@ # @(#)Makefile 8.1 (Berkeley) 6/2/93 NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no PROG= rescue BINDIR?=/rescue 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 5 Sep 2008 15:23:21 -0000 @@ -1,3 +1,3 @@ # $FreeBSD: src/sys/boot/Makefile.inc,v 1.1 2008/06/25 21:33:28 ru Exp $ -WITHOUT_SSP= +SSP_CFLAGS= 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 5 Sep 2008 15:23:19 -0000 @@ -1,8 +1,7 @@ # $FreeBSD: src/sys/boot/i386/loader/Makefile,v 1.86 2008/06/25 21:33:28 ru Exp $ -WITHOUT_SSP= - .include +MK_SSP= no PROG= loader.sym INTERNALPROG= 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 5 Sep 2008 15:23:13 -0000 @@ -1,8 +1,7 @@ # $FreeBSD: src/sys/boot/ia64/common/Makefile,v 1.2 2008/06/25 21:33:28 ru Exp $ -WITHOUT_SSP= - .include +MK_SSP= no LIB= ia64 INTERNALLIB= 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 5 Sep 2008 15:23:09 -0000 @@ -1,9 +1,9 @@ # $FreeBSD: src/sys/boot/ia64/efi/Makefile,v 1.29 2008/06/25 21:33:28 ru Exp $ NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no PROG= loader.sym INTERNALPROG= 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 5 Sep 2008 15:23:03 -0000 @@ -1,9 +1,9 @@ # $FreeBSD: src/sys/boot/ia64/ski/Makefile,v 1.21 2008/06/25 21:33:28 ru Exp $ NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no PROG= skiload STRIP= # We must not strip skiload at install time. 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 5 Sep 2008 15:24:29 -0000 @@ -1,8 +1,7 @@ # $FreeBSD: src/sys/boot/pc98/loader/Makefile,v 1.42 2008/06/25 21:33:28 ru Exp $ -WITHOUT_SSP= - .include +MK_SSP= no PROG= loader.sym INTERNALPROG= 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 5 Sep 2008 15:24:37 -0000 @@ -1,8 +1,7 @@ # $FreeBSD: src/sys/boot/powerpc/ofw/Makefile,v 1.24 2008/06/25 21:33:28 ru Exp $ -WITHOUT_SSP= - .include +MK_SSP= no PROG= loader NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} 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 5 Sep 2008 15:24:46 -0000 @@ -1,8 +1,7 @@ # $FreeBSD: src/sys/boot/sparc64/loader/Makefile,v 1.21 2008/06/25 21:33:28 ru Exp $ -WITHOUT_SSP= - .include +MK_SSP= no PROG= loader NEWVERSWHAT= "bootstrap loader" sparc64 --liOOAslEiF7prFVr--