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 <bsd.own.mk> > 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 >
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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +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 <bsd.own.mk> +MK_SSP= no PROG= loader NEWVERSWHAT= "bootstrap loader" sparc64
_______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"