aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2020-03-24 23:25:54 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2020-03-24 23:25:54 +0000
commit52de22cae7f1dd2f9655c2ceb4fc27538c4c8a99 (patch)
tree506d886fc21a2a364a6b1aa87d8ddd8ed2d3aea1 /Makefile.inc1
parent7522682e5eef46309814914f5e72915a65fbec45 (diff)
downloadsrc-52de22cae7f1dd2f9655c2ceb4fc27538c4c8a99.tar.gz
src-52de22cae7f1dd2f9655c2ceb4fc27538c4c8a99.zip
Makefile.inc1: override MACHINE for native-xtools
For the final step of the native-xtools target, "everything" is built with TARGET and TARGET_ARCH set to the architecture we wish to cross-build for. However, CROSSENV overwrites the values of MACHINE and MACHINE_ARCH, setting them to be identical to TARGET and TARGET_ARCH. For native-xtools this is undesirable since we are building binaries to run on the host architecture, that can cross compile for the target architecture. When building native-xtools for RISC-V, this issue manifests as an invalid argument for "-march". The compiler is invoked with the target triple of the host architecture, but the CFLAGS inherited from bsd.cpu.mk are that of the target architecture. Reviewed by: imp, bdrewery MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23838
Notes
Notes: svn path=/head/; revision=359289
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc11
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 68ef5f34b285..7b04a2e7bd81 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2650,6 +2650,7 @@ NXBMAKE+= XCC="${NXBOBJTOP}/tmp/usr/bin/cc" \
XCPP="${NXBOBJTOP}/tmp/usr/bin/cpp"
.endif
NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \
+ MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} \
TARGET=${NXB_TARGET} TARGET_ARCH=${NXB_TARGET_ARCH} \
TARGET_TRIPLE=${MACHINE_TRIPLE:Q}
# NXBDIRS is improperly based on MACHINE rather than NXB_TARGET. Need to