From owner-freebsd-current@FreeBSD.ORG Thu Feb 19 22:44:41 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E58D51065672 for ; Thu, 19 Feb 2009 22:44:41 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by mx1.freebsd.org (Postfix) with ESMTP id D64098FC18 for ; Thu, 19 Feb 2009 22:44:39 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp3-g21.free.fr (localhost [127.0.0.1]) by smtp3-g21.free.fr (Postfix) with ESMTP id 5F7AD818096; Thu, 19 Feb 2009 23:44:34 +0100 (CET) Received: from endor.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp3-g21.free.fr (Postfix) with ESMTP id 46D418180AB; Thu, 19 Feb 2009 23:44:32 +0100 (CET) Received: from obiwan.tataz.chchile.org (endor.tataz.chchile.org [192.168.1.25]) by endor.tataz.chchile.org (Postfix) with ESMTP id D08713406D; Thu, 19 Feb 2009 22:44:31 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id B725B5082A; Thu, 19 Feb 2009 23:44:31 +0100 (CET) Date: Thu, 19 Feb 2009 23:44:31 +0100 From: Jeremie Le Hen To: freebsd-current@FreeBSD.org Message-ID: <20090219224431.GC70440@obiwan.tataz.chchile.org> References: <20090113202046.GH41799@obiwan.tataz.chchile.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <20090113202046.GH41799@obiwan.tataz.chchile.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: ru@FreeBSD.org Subject: Re: WITH_SSP in src.conf(5) breaks the build X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 22:44:42 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ruslan, Could you commit the attached patch please (third try :)). Thanks. Regards, Jeremie On Tue, Jan 13, 2009 at 09:20:46PM +0100, Jeremie Le Hen wrote: > Hi list, > > I'd like to have SSP MFC'd for 7.2. However, there is still a problem: > WITH_SSP breaks the build if set in src.conf(5). See my previous mail > explaining this below. > > On Thu, Sep 04, 2008 at 04:17:05PM +0200, Jeremie Le Hen wrote: > > We indeed already have WITH_SSP/WITHOUT_SSP knob which is turned into > > MK_SSP="yes" or MK_SSP="no" respectively. > > > > The actual problem lies in Makefiles that define WITHOUT_SSP for some > > reason. For instance, in Makefile.inc1 the toolchain (namely > > bootstrap-tools, build-tools, cross-tools and a few other things) is > > built without SSP thanks to -DWITHOUT_SSP. For example: > > > > 224 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ > > 225 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ > > 226 DESTDIR= \ > > 227 BOOTSTRAPPING=${OSRELDATE} \ > > 228 -DWITHOUT_SSP \ > > 229 -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ > > 230 -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ > > 231 -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF > > > > There is a problem is the user defines WITH_SSP in src.conf or on > > command-line. In this case, bsd.own.mk screams because both WITH_SSP > > and WITHOUT_SSP are defined. > > The attached patch fixes this by using the trick proposed by Ruslan [1] > where possible, or overriding SSP_CFLAGS otherwise. > > Once committed, I expect to provide a patch to introduce SSP for > RELENG_7 a few weeks later. > > Thank you. > Best regards, > > [1] http://lists.freebsd.org/pipermail/freebsd-hackers/2008-September/025891.html -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > --EVF5PPMfhYS0aIcm 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 --EVF5PPMfhYS0aIcm--