summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-05-23 16:24:34 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-05-23 16:24:34 +0000
commit62dc16af9990c7ed2d0ad80da282ec71427e8556 (patch)
tree96028c9a98889c94ec6119cfc6e76b2ac848b552
parent2404d6db8a6db4d252d6434b06430b2d19e946f7 (diff)
downloadFreeBSD-src-62dc16af9990c7ed2d0ad80da282ec71427e8556.zip
FreeBSD-src-62dc16af9990c7ed2d0ad80da282ec71427e8556.tar.gz
Move binutils handling after src.opts.mk.
This fixes the arm64 build after r300348. Sponsored by: EMC / Isilon Storage Division
-rw-r--r--Makefile.inc150
1 files changed, 27 insertions, 23 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index a1c9498..b68a0d8 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -59,20 +59,6 @@ CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}"
.endif
.if defined(CROSS_TOOLCHAIN_PREFIX)
CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
-CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
-.endif
-# If we do not have a bootstrap binutils (because the in-tree one does not
-# support the target architecture), provide a default cross-binutils prefix.
-# This allows aarch64 builds, for example, to automatically use the
-# aarch64-binutils port or package.
-.if !make(showconfig)
-.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
- !defined(CROSS_BINUTILS_PREFIX)
-CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
-.if !exists(${CROSS_BINUTILS_PREFIX})
-.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX.
-.endif
-.endif
.endif
XCOMPILERS= CC CXX CPP
@@ -83,15 +69,6 @@ X${COMPILER}?= ${CROSS_COMPILER_PREFIX}${${COMPILER}}
X${COMPILER}?= ${${COMPILER}}
.endif
.endfor
-XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS
-.for BINUTIL in ${XBINUTILS}
-.if defined(CROSS_BINUTILS_PREFIX) && \
- exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}})
-X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
-.else
-X${BINUTIL}?= ${${BINUTIL}}
-.endif
-.endfor
# If a full path to an external cross compiler is given, don't build
# a cross compiler.
.if ${XCC:N${CCACHE_BIN}:M/*}
@@ -151,6 +128,33 @@ CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \
.endif # ${_expected_compiler_type} == ${COMPILER_TYPE}
.endif # ${XCC:N${CCACHE_BIN}:M/*}
+# Handle external binutils.
+.if defined(CROSS_TOOLCHAIN_PREFIX)
+CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
+.endif
+# If we do not have a bootstrap binutils (because the in-tree one does not
+# support the target architecture), provide a default cross-binutils prefix.
+# This allows aarch64 builds, for example, to automatically use the
+# aarch64-binutils port or package.
+.if !make(showconfig)
+.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
+ !defined(CROSS_BINUTILS_PREFIX)
+CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
+.if !exists(${CROSS_BINUTILS_PREFIX})
+.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX.
+.endif
+.endif
+.endif
+XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS
+.for BINUTIL in ${XBINUTILS}
+.if defined(CROSS_BINUTILS_PREFIX) && \
+ exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}})
+X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
+.else
+X${BINUTIL}?= ${${BINUTIL}}
+.endif
+.endfor
+
# We must do lib/ and libexec/ before bin/ in case of a mid-install error to
# keep the users system reasonably usable. For static->dynamic root upgrades,
OpenPOWER on IntegriCloud