diff options
author | Pascal Stumpf <pascal@cvs.openbsd.org> | 2012-08-21 14:46:21 +0000 |
---|---|---|
committer | Pascal Stumpf <pascal@cvs.openbsd.org> | 2012-08-21 14:46:21 +0000 |
commit | 9333c875627ad69d46ab3793263036ff3b45cc49 (patch) | |
tree | 697841a9433248956f025a7d1b3cd8019dfef64c /sys/arch/i386 | |
parent | 1caaeac6aae64a980b30cd0f00e3d491be174c97 (diff) |
Add NOPIE= bits for sys/arch/*/stand to ensure that bootblocks will always be
built with -fno-pie. This gets the hairiest part of PIE out of the way ...
ok deraadt@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/stand/Makefile.inc | 3 | ||||
-rw-r--r-- | sys/arch/i386/stand/biosboot/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/boot/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/cdboot/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/cdbr/Makefile | 3 | ||||
-rw-r--r-- | sys/arch/i386/stand/etc/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/Makefile | 3 | ||||
-rw-r--r-- | sys/arch/i386/stand/libz/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/mbr/Makefile | 3 | ||||
-rw-r--r-- | sys/arch/i386/stand/pxeboot/Makefile | 4 |
10 files changed, 26 insertions, 10 deletions
diff --git a/sys/arch/i386/stand/Makefile.inc b/sys/arch/i386/stand/Makefile.inc index 1cbd414aeb0..76b01abcfcc 100644 --- a/sys/arch/i386/stand/Makefile.inc +++ b/sys/arch/i386/stand/Makefile.inc @@ -1,7 +1,8 @@ -# $OpenBSD: Makefile.inc,v 1.40 2007/11/26 10:26:02 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.41 2012/08/21 14:46:18 pascal Exp $ CFLAGS=${DEBUG} ${COPTS} -Os -Wall -Werror CFLAGS+= -fno-stack-protector +CFLAGS+= ${NOPIE_FLAGS} CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR} SACFLAGS=-D_STANDALONE DEBUGLIBS=no diff --git a/sys/arch/i386/stand/biosboot/Makefile b/sys/arch/i386/stand/biosboot/Makefile index 853b57203c3..82a08d90348 100644 --- a/sys/arch/i386/stand/biosboot/Makefile +++ b/sys/arch/i386/stand/biosboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.21 2003/04/17 03:43:18 drahn Exp $ +# $OpenBSD: Makefile,v 1.22 2012/08/21 14:46:18 pascal Exp $ MAN= biosboot.8 @@ -17,7 +17,9 @@ ${PROG}: $(OBJS) $(DPADD) CPPFLAGS+=-DLOADADDR=$(LOADADDR) -DLINKADDR=$(LINKADDR) -DBOOTMAGIC=$(BOOTMAGIC) CPPFLAGS+=${DEBUGFLAGS} +CFLAGS+=${NOPIE_FLAGS} #AFLAGS+=-Wa,-a +AFLAGS+=${NOPIE_FLAGS} .else NOPROG= .endif diff --git a/sys/arch/i386/stand/boot/Makefile b/sys/arch/i386/stand/boot/Makefile index 277b0eb7e17..cafad2f16c9 100644 --- a/sys/arch/i386/stand/boot/Makefile +++ b/sys/arch/i386/stand/boot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.36 2011/11/06 13:39:43 jsing Exp $ +# $OpenBSD: Makefile,v 1.37 2012/08/21 14:46:18 pascal Exp $ .include "${.CURDIR}/../Makefile.inc" @@ -67,5 +67,7 @@ CPPFLAGS+=-DBOOTMAGIC=$(BOOTMAGIC) ${DEBUGFLAGS} -DLINKADDR=${LINKADDR} CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO_GZIP -DDYNAMIC_CRC_TABLE CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT} -I${S}/stand/boot #-DCOMPAT_UFS CFLAGS+=-m32 $(SACFLAGS) -D__INTERNAL_LIBSA_CREAD +CFLAGS+=${NOPIE_FLAGS} AFLAGS+=-m32 # -Wa,-R # AFLAGS+=-Wa,-a +AFLAGS+=${NOPIE_FLAGS} diff --git a/sys/arch/i386/stand/cdboot/Makefile b/sys/arch/i386/stand/cdboot/Makefile index 97912f9cb1c..94b663c40ae 100644 --- a/sys/arch/i386/stand/cdboot/Makefile +++ b/sys/arch/i386/stand/cdboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2010/07/10 17:09:15 deraadt Exp $ +# $OpenBSD: Makefile,v 1.9 2012/08/21 14:46:18 pascal Exp $ .include "${.CURDIR}/../Makefile.inc" @@ -48,5 +48,7 @@ CPPFLAGS+=-DLINKADDR=${LINKADDR} CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_CREAD CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\" CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\" +CFLAGS+=${NOPIE_FLAGS} #AFLAGS+=-Wa,-R # AFLAGS+=-Wa,-a +AFLAGS+=${NOPIE_FLAGS} diff --git a/sys/arch/i386/stand/cdbr/Makefile b/sys/arch/i386/stand/cdbr/Makefile index 468e58aa8f4..ae0757e2e32 100644 --- a/sys/arch/i386/stand/cdbr/Makefile +++ b/sys/arch/i386/stand/cdbr/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.2 2004/08/24 15:24:05 tom Exp $ +# $OpenBSD: Makefile,v 1.3 2012/08/21 14:46:18 pascal Exp $ # PROG= cdbr @@ -6,6 +6,7 @@ SRCS= cdbr.S AFLAGS+=-I${.CURDIR} -I${.CURDIR}/../../.. #-Wa,-a AFLAGS+=-DOSREV=\"${OSREV}\" AFLAGS+=-DMACH=\"${MACHINE}\" -DMACH_U=\"${MACHINE:U}\" +AFLAGS+=${NOPIE_FLAGS} LD=ld ORG= 0x0000 LDFLAGS=-nostdlib -Ttext ${ORG} -x -N -s -Bstatic -e start diff --git a/sys/arch/i386/stand/etc/Makefile b/sys/arch/i386/stand/etc/Makefile index 3f4a565455d..444592b8477 100644 --- a/sys/arch/i386/stand/etc/Makefile +++ b/sys/arch/i386/stand/etc/Makefile @@ -1,8 +1,10 @@ -# $OpenBSD: Makefile,v 1.9 1998/05/28 20:52:37 mickey Exp $ +# $OpenBSD: Makefile,v 1.10 2012/08/21 14:46:18 pascal Exp $ S= ${.CURDIR}/../../../.. I386= ${.CURDIR}/../.. +NOPIE= + all depend:: assym.h assym.h: $S/kern/genassym.sh ${.CURDIR}/genassym.cf diff --git a/sys/arch/i386/stand/libsa/Makefile b/sys/arch/i386/stand/libsa/Makefile index edff079b1f6..ec1d45d794a 100644 --- a/sys/arch/i386/stand/libsa/Makefile +++ b/sys/arch/i386/stand/libsa/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.47 2007/05/30 01:25:43 tom Exp $ +# $OpenBSD: Makefile,v 1.48 2012/08/21 14:46:18 pascal Exp $ .include "${.CURDIR}/../Makefile.inc" @@ -47,6 +47,7 @@ SRCS+= debug.c NOPROFILE=noprofile NOPIC=nopic +NOPIE= .PATH: $S/lib/libsa diff --git a/sys/arch/i386/stand/libz/Makefile b/sys/arch/i386/stand/libz/Makefile index 525c7141bf2..2503a62a549 100644 --- a/sys/arch/i386/stand/libz/Makefile +++ b/sys/arch/i386/stand/libz/Makefile @@ -1,10 +1,12 @@ -# $OpenBSD: Makefile,v 1.11 2003/12/18 02:27:13 millert Exp $ +# $OpenBSD: Makefile,v 1.12 2012/08/21 14:46:18 pascal Exp $ # $NetBSD: Makefile,v 1.2 1997/01/22 01:36:30 cgd Exp $ S=${.CURDIR}/../../../.. ZDST=${.OBJDIR} SADIR=${.CURDIR}/.. +NOPIE= + .PATH: ${S}/lib/libz .include "${S}/lib/libz/Makefile" diff --git a/sys/arch/i386/stand/mbr/Makefile b/sys/arch/i386/stand/mbr/Makefile index f69b5c19828..60ec96c73aa 100644 --- a/sys/arch/i386/stand/mbr/Makefile +++ b/sys/arch/i386/stand/mbr/Makefile @@ -1,9 +1,10 @@ -# $OpenBSD: Makefile,v 1.14 2003/04/17 03:43:19 drahn Exp $ +# $OpenBSD: Makefile,v 1.15 2012/08/21 14:46:18 pascal Exp $ # PROG= mbr SRCS= mbr.S AFLAGS+=-I${.CURDIR} -I${.CURDIR}/../../.. #-Wa,-a +AFLAGS+=${NOPIE_FLAGS} LD=ld LDFLAGS=-nostdlib -Ttext 0 -x -N -s -Bstatic -e start diff --git a/sys/arch/i386/stand/pxeboot/Makefile b/sys/arch/i386/stand/pxeboot/Makefile index cc03b319b58..db948d380eb 100644 --- a/sys/arch/i386/stand/pxeboot/Makefile +++ b/sys/arch/i386/stand/pxeboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.5 2010/07/10 17:04:22 deraadt Exp $ +# $OpenBSD: Makefile,v 1.6 2012/08/21 14:46:19 pascal Exp $ .include "${.CURDIR}/../Makefile.inc" @@ -46,5 +46,7 @@ NOPROG= CPPFLAGS+=-DBOOTMAGIC=$(BOOTMAGIC) ${DEBUGFLAGS} CPPFLAGS+=-DLINKADDR=${LINKADDR} CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_CREAD +CFLAGS+=${NOPIE_FLAGS} #AFLAGS+=-Wa,-R # AFLAGS+=-Wa,-a +AFLAGS+=${NOPIE_FLAGS} |