summaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2024-08-16 12:18:15 -0400
committerEd Maste <emaste@FreeBSD.org>2025-08-27 17:34:12 -0400
commitac7ed266dc73a1d55f2bc1e90bfce3c93757e8b4 (patch)
treee66655984b3e3e6930ad18427cf7a7fa31ec2fec /Makefile.inc1
parenta93e46f15693b6962eefac2ffa962edb020f8b49 (diff)
Makefile.inc1: Avoid including cwd in path
Buildworld failed when objcopy tried to overwrite itself, with `objcopy: open objcopy failed: Text file busy`. The PATH ended up with `::`, effectively including the current directory, and we found the wrong objcopy. PR: 261215 Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc15
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index c6cbc411be80..3bbc4afed3fd 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -644,7 +644,10 @@ XPATH= ${WORLDTMP}/bin:${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
# When building we want to find the cross tools before the host tools in ${BPATH}.
# We also need to add UNIVERSE_TOOLCHAIN_PATH so that we can find the shared
# toolchain files (clang, lld, etc.) during make universe/tinderbox
-STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_PATH}
+STRICTTMPPATH= ${XPATH}:${BPATH}
+.if defined(UNIVERSE_TOOLCHAIN_PATH)
+STRICTTMPPATH:=${STRICTTMPPATH}:${UNIVERSE_TOOLCHAIN_PATH}
+.endif
# We should not be using tools from /usr/bin accidentally since this could cause
# the build to break on other systems that don't have that tool. For now we
# still allow using the old behaviour (inheriting $PATH) if