Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Nov 2013 00:15:37 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257873 - head
Message-ID:  <201311090015.rA90Fbjx017643@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sat Nov  9 00:15:36 2013
New Revision: 257873
URL: http://svnweb.freebsd.org/changeset/base/257873

Log:
  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.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Fri Nov  8 23:11:04 2013	(r257872)
+++ head/Makefile.inc1	Sat Nov  9 00:15:36 2013	(r257873)
@@ -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 "--------------------------------------------------------------"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311090015.rA90Fbjx017643>