diff options
author | Pascal Stumpf <pascal@cvs.openbsd.org> | 2012-08-29 17:45:01 +0000 |
---|---|---|
committer | Pascal Stumpf <pascal@cvs.openbsd.org> | 2012-08-29 17:45:01 +0000 |
commit | fc2d1b410f156ff5629550712411de61e1b77f19 (patch) | |
tree | 5d24f9069601433980ddf2fa8fc5562904cd9df9 /sys/arch/amd64 | |
parent | 79b60f44d251c04ed7f451d6c4b0bbaa8582576c (diff) |
Get rid of all NOPIE and NOPIE_FLAGS in amd64/stand and use -fno-pie and -nopie
directly instead. This will be the approach taken by every other arch too
in the near future. It is easier than relying on bsd.own.mk to set these
correctly.
discussed with and ok deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/stand/Makefile.inc | 3 | ||||
-rw-r--r-- | sys/arch/amd64/stand/biosboot/Makefile | 8 | ||||
-rw-r--r-- | sys/arch/amd64/stand/boot/Makefile | 9 | ||||
-rw-r--r-- | sys/arch/amd64/stand/cdboot/Makefile | 8 | ||||
-rw-r--r-- | sys/arch/amd64/stand/cdbr/Makefile | 6 | ||||
-rw-r--r-- | sys/arch/amd64/stand/mbr/Makefile | 6 | ||||
-rw-r--r-- | sys/arch/amd64/stand/pxeboot/Makefile | 9 |
7 files changed, 23 insertions, 26 deletions
diff --git a/sys/arch/amd64/stand/Makefile.inc b/sys/arch/amd64/stand/Makefile.inc index 3058ff81546..d844ffd6272 100644 --- a/sys/arch/amd64/stand/Makefile.inc +++ b/sys/arch/amd64/stand/Makefile.inc @@ -1,8 +1,7 @@ -# $OpenBSD: Makefile.inc,v 1.6 2012/08/21 14:46:18 pascal Exp $ +# $OpenBSD: Makefile.inc,v 1.7 2012/08/29 17:45:00 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/amd64/stand/biosboot/Makefile b/sys/arch/amd64/stand/biosboot/Makefile index efb92d2d53d..9c344feccef 100644 --- a/sys/arch/amd64/stand/biosboot/Makefile +++ b/sys/arch/amd64/stand/biosboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2012/08/21 14:46:18 pascal Exp $ +# $OpenBSD: Makefile,v 1.5 2012/08/29 17:45:00 pascal Exp $ MAN= biosboot.8 @@ -6,7 +6,7 @@ MAN= biosboot.8 PROG= biosboot SRCS= biosboot.S LD=ld -LDFLAGS=-melf_i386 -nostdlib -Ttext 0 -N -x -Bstatic +LDFLAGS=-melf_i386 -nostdlib -Ttext 0 -N -x -Bstatic -nopie LDFLAGS+=-L/usr/libdata INSTALL_STRIP= SADIR= ${.CURDIR}/.. @@ -18,9 +18,9 @@ ${PROG}: $(OBJS) $(DPADD) CPPFLAGS+=-DLOADADDR=$(LOADADDR) -DLINKADDR=$(LINKADDR) -DBOOTMAGIC=$(BOOTMAGIC) CPPFLAGS+=${DEBUGFLAGS} -CPPFLAGS+=${NOPIE_FLAGS} +CFLAGS+=-fno-pie AFLAGS+=-m32 # -Wa,-a -AFLAGS+=${NOPIE_FLAGS} +AFLAGS+=-fno-pie .else NOPROG= .endif diff --git a/sys/arch/amd64/stand/boot/Makefile b/sys/arch/amd64/stand/boot/Makefile index 279ffaddf6a..8005b060068 100644 --- a/sys/arch/amd64/stand/boot/Makefile +++ b/sys/arch/amd64/stand/boot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2012/08/21 14:46:18 pascal Exp $ +# $OpenBSD: Makefile,v 1.10 2012/08/29 17:45:00 pascal Exp $ .include "${.CURDIR}/../Makefile.inc" @@ -14,7 +14,7 @@ SRCS= srt0.S conf.c LD?= ld SIZE?= size LDFLAGS+=-melf_i386 -nostdlib -Bstatic -Ttext $(LINKADDR) -N -x -noinhibit-exec -LDFLAGS+=-L/usr/libdata +LDFLAGS+=-nopie -L/usr/libdata .PATH: ${SADIR}/libsa # i386 stuff (so, it will possibly load in the same 64k) @@ -56,8 +56,7 @@ NOPROG= 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} +CFLAGS+=-m32 $(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie AFLAGS+=-m32 # -Wa,-R -AFLAGS+=${NOPIE_FLAGS} +AFLAGS+=-fno-pie # AFLAGS+=-Wa,-a diff --git a/sys/arch/amd64/stand/cdboot/Makefile b/sys/arch/amd64/stand/cdboot/Makefile index 91fd4d8c59c..44cdd798b15 100644 --- a/sys/arch/amd64/stand/cdboot/Makefile +++ b/sys/arch/amd64/stand/cdboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.12 2012/08/21 14:46:18 pascal Exp $ +# $OpenBSD: Makefile,v 1.13 2012/08/29 17:45:00 pascal Exp $ .include "${.CURDIR}/../Makefile.inc" @@ -13,7 +13,7 @@ SRCS= srt0.S boot.c conf.c LD?= ld SIZE?= size LDFLAGS+=-melf_i386 -nostdlib -Bstatic -Ttext $(LINKADDR) -N -x -noinhibit-exec -LDFLAGS+=-L/usr/libdata +LDFLAGS+=-nopie -L/usr/libdata INSTALL_STRIP= .PATH: ${SADIR}/libsa @@ -64,6 +64,6 @@ CPPFLAGS+=-DLINKADDR=${LINKADDR} -I${S}/stand/boot CFLAGS+=-m32 ${SACFLAGS} -D__INTERNAL_LIBSA_CREAD CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\" CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\" -CFLAGS+=${NOPIE_FLAGS} +CFLAGS+=-fno-pie AFLAGS+=-m32 -AFLAGS+=${NOPIE_FLAGS} +AFLAGS+=-fno-pie diff --git a/sys/arch/amd64/stand/cdbr/Makefile b/sys/arch/amd64/stand/cdbr/Makefile index bb11cdd1350..9770d3fb362 100644 --- a/sys/arch/amd64/stand/cdbr/Makefile +++ b/sys/arch/amd64/stand/cdbr/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2012/08/21 14:46:18 pascal Exp $ +# $OpenBSD: Makefile,v 1.5 2012/08/29 17:45:00 pascal Exp $ # PROG= cdbr @@ -6,11 +6,11 @@ SRCS= cdbr.S AFLAGS+=-m32 -I${.CURDIR} -I${.CURDIR}/../../.. #-Wa,-a AFLAGS+=-DOSREV=\"${OSREV}\" AFLAGS+=-DMACH=\"${MACHINE}\" -DMACH_U=\"${MACHINE:U}\" -AFLAGS+=${NOPIE_FLAGS} +AFLAGS+=-fno-pie LD=ld ORG= 0x0000 LDFLAGS=-melf_i386 -nostdlib -Ttext ${ORG} -x -N -s -Bstatic -e start -LDFLAGS+=-L/usr/libdata +LDFLAGS+=-nopie -L/usr/libdata NOMAN= #MAN+= cdbr.8 diff --git a/sys/arch/amd64/stand/mbr/Makefile b/sys/arch/amd64/stand/mbr/Makefile index 7b2729f1b65..f2a8b480fa9 100644 --- a/sys/arch/amd64/stand/mbr/Makefile +++ b/sys/arch/amd64/stand/mbr/Makefile @@ -1,13 +1,13 @@ -# $OpenBSD: Makefile,v 1.4 2012/08/21 14:46:18 pascal Exp $ +# $OpenBSD: Makefile,v 1.5 2012/08/29 17:45:00 pascal Exp $ # PROG= mbr SRCS= mbr.S AFLAGS+=-m32 -I${.CURDIR} -I${.CURDIR}/../../.. #-Wa,-a -AFLAGS+=${NOPIE_FLAGS} +AFLAGS+=-fno-pie LD=ld LDFLAGS=-melf_i386 -nostdlib -Ttext 0 -x -N -s -Bstatic -e start -LDFLAGS+=-L/usr/libdata +LDFLAGS+=-nopie -L/usr/libdata NOMAN= #MAN+= mbr.8 diff --git a/sys/arch/amd64/stand/pxeboot/Makefile b/sys/arch/amd64/stand/pxeboot/Makefile index 2e6d054d195..f550a311c27 100644 --- a/sys/arch/amd64/stand/pxeboot/Makefile +++ b/sys/arch/amd64/stand/pxeboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2012/08/21 14:46:18 pascal Exp $ +# $OpenBSD: Makefile,v 1.10 2012/08/29 17:45:00 pascal Exp $ .include "${.CURDIR}/../Makefile.inc" @@ -13,7 +13,7 @@ SRCS= srt0.S conf.c devopen.c net.c open.c LD?= ld SIZE?= size LDFLAGS+=-melf_i386 -nostdlib -Bstatic -Ttext $(LINKADDR) -N -x -noinhibit-exec -LDFLAGS+=-L/usr/libdata +LDFLAGS+=-nopie -L/usr/libdata INSTALL_STRIP= .PATH: ${SADIR}/libsa @@ -62,8 +62,7 @@ NOPROG= 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} +CFLAGS+=-m32 $(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie AFLAGS+=-m32 # -Wa,-R -AFLAGS+=${NOPIE_FLAGS} +AFLAGS+=-fno-pie # AFLAGS+=-Wa,-a |