summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2012-09-11 17:12:05 +0000
committerderaadt <deraadt@openbsd.org>2012-09-11 17:12:05 +0000
commit8f81402df840f5fcc0d90ffd824e05364151f29a (patch)
tree9987e7fe3a7ebbad0565c27f530438427b8c4013
parentCope with PIE, if it is enabled (diff)
downloadwireguard-openbsd-8f81402df840f5fcc0d90ffd824e05364151f29a.tar.xz
wireguard-openbsd-8f81402df840f5fcc0d90ffd824e05364151f29a.zip
Cope with PIE, if it is enabled. Note that this has not been completely
tested, but it is time to get it in at least.
-rw-r--r--sys/arch/zaurus/stand/zboot/Makefile11
-rw-r--r--sys/arch/zaurus/stand/zbsdmod/Makefile6
2 files changed, 10 insertions, 7 deletions
diff --git a/sys/arch/zaurus/stand/zboot/Makefile b/sys/arch/zaurus/stand/zboot/Makefile
index 30460a411d8..a561e20e74f 100644
--- a/sys/arch/zaurus/stand/zboot/Makefile
+++ b/sys/arch/zaurus/stand/zboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.10 2012/08/21 14:46:20 pascal Exp $
+# $OpenBSD: Makefile,v 1.11 2012/09/11 17:12:05 deraadt Exp $
MAN= boot.8
MANSUBDIR=zaurus
@@ -6,8 +6,7 @@ MLINKS= boot.8 boot.conf.5
.if ${MACHINE} == "zaurus"
PROG= zboot
-LDFLAGS+=-nostdlib -Bstatic
-NOPIE=
+LDFLAGS+=-nostdlib -Bstatic -nopie
INSTALL_STRIP=
SRCS= crt0.c
@@ -40,6 +39,9 @@ SRCS+= alloc.c cmd.c devopen.c diskprobe.c exec.c exit.c loadfile.c \
.PATH: ${S}/stand/boot
.PATH: ${S}/lib/libsa
+${PROG}: ${OBJS} ${LIBSA}
+ ${LD} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBSA}
+
.else
NOPROG=
.endif
@@ -49,4 +51,5 @@ NOPROG=
AFLAGS+=-D_LOCORE
CPPFLAGS+=-D_STANDALONE
CPPFLAGS+=-I${S}/stand/boot -I${S}/lib/libsa -I. -I${.CURDIR} -I${S}
-CFLAGS+=-fno-stack-protector -fno-builtin -fpack-struct
+CFLAGS+=-fno-stack-protector -fno-builtin -fpack-struct -fno-pie
+AFLAGS+= -fno-pie
diff --git a/sys/arch/zaurus/stand/zbsdmod/Makefile b/sys/arch/zaurus/stand/zbsdmod/Makefile
index e139a11c201..f39c9dd2ca2 100644
--- a/sys/arch/zaurus/stand/zbsdmod/Makefile
+++ b/sys/arch/zaurus/stand/zbsdmod/Makefile
@@ -1,9 +1,8 @@
-# $OpenBSD: Makefile,v 1.4 2012/08/21 14:46:20 pascal Exp $
+# $OpenBSD: Makefile,v 1.5 2012/09/11 17:12:06 deraadt Exp $
OBJS= zbsdmod.o
SRCS= zbsdmod.c
NOMAN=
-NOPIE=
all: ${OBJS}
@@ -18,4 +17,5 @@ afterinstall:
CFLAGS= -fno-stack-protector -Wall
CFLAGS+= -DMACHINE=\"${MACHINE}\" -DUTS_RELEASE=\"2.4.20\"
-CPPFLAGS= -I${.CURDIR}/../include
+CPPFLAGS= -I${.CURDIR}/../include -fno-pie
+LDFLAGS+= -nopie