aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2018-11-05 19:51:10 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2018-11-05 19:51:10 +0000
commit8f62bca488fb2d07a7d4aa531b81e352d7e3e4c9 (patch)
treeee479fe4df80b4fea7557aa8188594be12993287 /Makefile
parent335a736a20939845bc64a26826039588487ceb90 (diff)
downloadsrc-8f62bca488fb2d07a7d4aa531b81e352d7e3e4c9.tar.gz
src-8f62bca488fb2d07a7d4aa531b81e352d7e3e4c9.zip
Allow building world without inheriting $PATH
Inheriting $PATH during the build phase can cause the build to fail when compiling on a different system due to missing build tools or incompatible versions somewhere in $PATH. This has cause build failures for us before due to the jenkins slaves still running FreeBSD 10. Listing the tools we depend on explicitly instead of just using whatever happens to be in $PATH allows us to check that we don't accidentally add a new build dependency. All tools that do no need to be bootstrapped will now be symlinked to ${WORLDTMP}/legacy/bin and during the build phase $PATH will only contain ${WORLDTMP}. There is also a new variable "BOOTSTRAP_ALL_TOOLS" which can be set to force compiling almost all bootstrap tools instead of symlinking them. This will not bootstrap tools such as cp,mv, etc. since they may be used during the build and for those we should really only be using POSIX compatible options. Furthermore, this change is required in order to be able to build on non-FreeBSD hosts. While the same binaries may exist on Linux/MacOS they often accept different flags or produce incompatible output. Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D16815
Notes
Notes: svn path=/head/; revision=340157
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 075c79a55b69..efcb11a2ba98 100644
--- a/Makefile
+++ b/Makefile
@@ -610,10 +610,13 @@ _need_lld_${target}_${target_arch} != \
# XXX: Passing HOST_OBJTOP into the PATH would allow skipping legacy,
# bootstrap-tools, and cross-tools. Need to ensure each tool actually
# supports all TARGETS though.
+# For now we only pass UNIVERSE_TOOLCHAIN_PATH which will be added at the end
+# of STRICTTMPPATH to ensure that the target-specific binaries come first.
MAKE_PARAMS_${target}+= \
XCC="${HOST_OBJTOP}/tmp/usr/bin/cc" \
XCXX="${HOST_OBJTOP}/tmp/usr/bin/c++" \
- XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp"
+ XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp" \
+ UNIVERSE_TOOLCHAIN_PATH=${HOST_OBJTOP}/tmp/usr/bin
.endif
.if defined(_need_lld_${target}_${target_arch}) && \
${_need_lld_${target}_${target_arch}} == "yes"