summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2013-11-09 00:15:36 +0000
committerian <ian@FreeBSD.org>2013-11-09 00:15:36 +0000
commitbacc1e5cc3b2c42104ad2ed826889efd4f6e77d4 (patch)
tree72dc5161aa47a7013ab206403738a39e3907f05e /Makefile.inc1
parent2eebadc77296c17ca85830ccf83afc4a5ec7d32e (diff)
downloadFreeBSD-src-bacc1e5cc3b2c42104ad2ed826889efd4f6e77d4.zip
FreeBSD-src-bacc1e5cc3b2c42104ad2ed826889efd4f6e77d4.tar.gz
This change builds kernel tools based on the same assumption as building
the kernel itself: If building for the same architecture as the build host, the kernel build assumes that the host toolchain is capable of building the kernel. If it's not, "make kernel-toolchain" will bootstrap a new set of tools that will work. With this change the same assumptions are made for building kernel tools, and the existing host toolchain is used to do the build (notably, the build doesn't link the tools with the legacy libraries, which may not even exist). If ever for some reason the host toolchain isn't capable of building the kernel tools, then doing a "make kernel-toolchain" will bootstrap newer tools to get the job done. So when built as part of buildworld or kernel-toolchain, the kernel tools are built using the XMAKE (via BMAKE) commands and environment. When built as part of building just the kernel on a same-target host, the tools are built using the new KTMAKE commands and environment. What doesn't jump out at you in the diffs is that the difference between BMAKE and KTMAKE is that BMAKE contains this magic line which changes how the build is done because it changes what files get included for .include <bsd.prog.mk> and other standard includes: MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" and KTMAKE doesn't, and contains this instead: TOOLS_PREFIX=${WORLDTMP} Hopefully this brings the "how to build aicasm with the right toolchain" saga to a conclusion that works in all usage scenarios that have historically been supported.
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc117
1 files changed, 16 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 32a44ec..862f827 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -263,6 +263,21 @@ XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
-DWITHOUT_GDB
+# kernel-tools stage
+KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
+ PATH=${BPATH}:${PATH} \
+ WORLDTMP=${WORLDTMP} \
+ VERSION="${VERSION}" \
+ COMPILER_TYPE=${COMPILER_TYPE}
+KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
+ ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
+ DESTDIR= \
+ BOOTSTRAPPING=${OSRELDATE} \
+ SSP_CFLAGS= \
+ -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
+ -DNO_PIC -DNO_PROFILE -DNO_SHARED \
+ -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
+
# world stage
WMAKEENV= ${CROSSENV} \
_SHLIBDIRPREFIX=${WORLDTMP} \
@@ -1020,7 +1035,7 @@ buildkernel:
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.3: build tools"
@echo "--------------------------------------------------------------"
- ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
+ ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
.if !defined(NO_KERNELDEPEND)
@echo
@echo "--------------------------------------------------------------"
OpenPOWER on IntegriCloud