Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Nov 2025 11:25:47 +0000
From:      Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: fcca6e11694d - stable/14 - Use install instead of cp to copy bootstrap tools
Message-ID:  <691efabb.e693.4858a0fa@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/14 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=fcca6e11694dbfc24abed7b484fe8cc8fc9affa1

commit fcca6e11694dbfc24abed7b484fe8cc8fc9affa1
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2025-11-15 03:18:35 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2025-11-20 11:25:15 +0000

    Use install instead of cp to copy bootstrap tools
    
    We need to preserve modification times on bootstrap tools, but `cp -p`
    also tries to preserve flags, which fails if OBJROOT is on NFS.  A -N
    option was added to cp for this purpose, but trying to use that would
    break cross-building on hosts that don't have that option.  The best
    remaining option is `install -p`, which we already assume is present.
    
    PR:             275030
    Reviewed by:    imp, emaste
    Differential Revision:  https://reviews.freebsd.org/D53751
    
    (cherry picked from commit f3cf4c0af5af6ce95065a615f998117ec1cd63aa)
---
 Makefile.inc1        | 2 +-
 tools/build/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index e3a451b72b10..f4396b839e9a 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2704,7 +2704,7 @@ ${_bt}-link-${_tool}: .PHONY
 	if [ ! -e "$${source_path}" ] ; then \
 		echo "Cannot find host tool '${_tool}'"; false; \
 	fi; \
-	cp -pf "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"
+	install -p "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"
 ${_bt}-links: ${_bt}-link-${_tool}
 .endfor
 
diff --git a/tools/build/Makefile b/tools/build/Makefile
index aff664f2a68b..cee54fb71403 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -331,7 +331,7 @@ _LINK_HOST_TOOL=	ln -sfn
 # When building on FreeBSD we always copy the host tools instead of linking
 # into WORLDTMP to avoid issues with incompatible libraries (see r364030).
 # Note: we could create links if we don't intend to update the current machine.
-_COPY_HOST_TOOL=	cp -pf
+_COPY_HOST_TOOL=	install -p
 .else
 # However, this is not necessary on Linux/macOS. Additionally, copying the host
 # tools to another directory with cp -p results in freezes on macOS Big Sur for


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?691efabb.e693.4858a0fa>