summaryrefslogtreecommitdiff
path: root/tools/build
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2020-08-07 16:26:56 +0000
committerWarner Losh <imp@FreeBSD.org>2020-08-07 16:26:56 +0000
commit33176cdc87a6c7d2993b4e6b95e9ce8b016454b4 (patch)
treec4b9f2f7c4519cdc515542695b5ffc0b2e800aa0 /tools/build
parent1f325602e470231d230d79526e98c4000403ca41 (diff)
downloadsrc-test-33176cdc87a6c7d2993b4e6b95e9ce8b016454b4.tar.gz
src-test-33176cdc87a6c7d2993b4e6b95e9ce8b016454b4.zip
The practice of creating symbolic links is somewhat fragile. Always
make copies instead. There's too many times that we can't run the new binaries with old libraries. Making the links when things are known to be 'safe' is a nice optimization, but a copy of all the binaries is only 30MB, so saving the copies at the cost of increased support when new symbols are added and used as part of the bootstrap seems to be unwise. There may be additional optimizations possible here, especially for !FreeBSD hosts. However, that's beyond the scope of the problem I'm trying to fix with make failing mid-way through an installworld across change r363679. This optimization there caused us to run a new binary with an old library once a new make was installed due to the symbolic link. One could just copy make, but then other binaries fail as well, so rather than play whack-a-mole, I opted to take us back to the old way. Before r340157 or so we did copies (thogh of a lot fewer artifacts), and we didn't have issues like this. Reviewed by: arichards@ Differential Revision: https://reviews.freebsd.org/D25967
Notes
Notes: svn path=/head/; revision=364030
Diffstat (limited to 'tools/build')
-rw-r--r--tools/build/Makefile27
1 files changed, 13 insertions, 14 deletions
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 0db3f8b2f11b7..73eeac3ee09a4 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -119,26 +119,25 @@ _host_abs_tools_to_symlink= ${_make_abs}:make ${_make_abs}:bmake
host-symlinks:
@echo "Linking host tools into ${DESTDIR}/bin"
.for _tool in ${_host_tools_to_symlink}
- @if [ ! -e "${DESTDIR}/bin/${_tool}" ]; then \
- source_path=`which ${_tool}`; \
- if [ ! -e "$${source_path}" ] ; then \
- echo "Cannot find host tool '${_tool}'"; false; \
- fi; \
- ln -sfnv "$${source_path}" "${DESTDIR}/bin/${_tool}"; \
- fi
+ @source_path=`which ${_tool}`; \
+ if [ ! -e "$${source_path}" ] ; then \
+ echo "Cannot find host tool '${_tool}'"; false; \
+ fi; \
+ rm -f "${DESTDIR}/bin/${_tool}"; \
+ cp -f "$${source_path}" "${DESTDIR}/bin/${_tool}"
.endfor
.for _tool in ${_host_abs_tools_to_symlink}
@source_path="${_tool:S/:/ /:[1]}"; \
target_path="${DESTDIR}/bin/${_tool:S/:/ /:[2]}"; \
- if [ ! -e "$${target_path}" ] ; then \
- if [ ! -e "$${source_path}" ] ; then \
- echo "Host tool '${src_path}' is missing"; false; \
- fi; \
- ln -sfnv "$${source_path}" "$${target_path}"; \
- fi
+ if [ ! -e "$${source_path}" ] ; then \
+ echo "Host tool '${src_path}' is missing"; false; \
+ fi; \
+ rm -f "$${target_path}"; \
+ cp -f "$${source_path}" "$${target_path}"
.endfor
.if exists(/usr/libexec/flua)
- ln -sf /usr/libexec/flua ${DESTDIR}/usr/libexec/flua
+ rm -f ${DESTDIR}/usr/libexec/flua
+ cp -f /usr/libexec/flua ${DESTDIR}/usr/libexec/flua
.endif
# Create all the directories that are needed during the legacy, bootstrap-tools