summaryrefslogtreecommitdiff
path: root/Makefile.cross
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-03-10 08:50:43 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-03-10 08:50:43 +0000
commitd2440e6b97c3e339ce0b3b2c3bb67927edbb5593 (patch)
tree5845aa9cd04b7173751664b8a728d058dc6e2c1e /Makefile.cross
parent98a271535e6d3271dc0526469542d53a8ffe3d4d (diff)
Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper PIE_DEFAULT value for the target. ok millert@ deraadt@
Diffstat (limited to 'Makefile.cross')
-rw-r--r--Makefile.cross17
1 files changed, 13 insertions, 4 deletions
diff --git a/Makefile.cross b/Makefile.cross
index 31ffcf92ef3..7528614cade 100644
--- a/Makefile.cross
+++ b/Makefile.cross
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.cross,v 1.60 2013/02/02 13:38:41 miod Exp $
+# $OpenBSD: Makefile.cross,v 1.61 2013/03/10 08:50:42 miod Exp $
cross-tools: cross-includes cross-binutils cross-gcc cross-lib
cross-distrib: cross-tools cross-bin cross-share cross-sys cross-etc-root-var
@@ -105,6 +105,15 @@ BINUTILS_VERSION=binutils-2.17
BINUTILS_VERSION=binutils
.endif
+.if !empty(PIE_ARCH:M${_arch})
+NOPIE_FLAGS=-fno-pie
+NOPIE_LDFLAGS=-nopie
+PIE_DEFAULT=${DEFAULT_PIE_DEF}
+.else
+NOPIE_FLAGS=
+PIE_DEFAULT=
+.endif
+
.if !empty(OLD_BINUTILS_ARCH:M${_arch})
NEW_BINUTILS?= No
BINUTILS= ar as ld nm ranlib objcopy objdump strings strip
@@ -198,17 +207,17 @@ ${CROSSINCLUDES}: ${CROSSOBJ}
${CROSSBINUTILS}: ${CROSSINCLUDES}
(cd ${.CURDIR}/${BINUTILS_DIR}; \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
- USING_NEW_BINUTILS=${NEW_BINUTILS} \
+ USING_NEW_BINUTILS=${NEW_BINUTILS} PIE_DEFAULT=${PIE_DEFAULT} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
PATH=${CROSSPATH} \
${MAKE} -f Makefile.bsd-wrapper depend && \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
- USING_NEW_BINUTILS=${NEW_BINUTILS} \
+ USING_NEW_BINUTILS=${NEW_BINUTILS} PIE_DEFAULT=${PIE_DEFAULT} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
${MAKE} -f Makefile.bsd-wrapper all && \
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
COMPILER_VERSION=${COMPILER_VERSION} \
- USING_NEW_BINUTILS=${NEW_BINUTILS} \
+ USING_NEW_BINUTILS=${NEW_BINUTILS} PIE_DEFAULT=${PIE_DEFAULT} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
USING_NEW_BINUTILS=${NEW_BINUTILS} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \