git: e42935e5871b - stable/15 - Makefile.inc1: Fix package-pkg with CROSS_TOOLCHAIN
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 05 Oct 2025 05:33:52 UTC
The branch stable/15 has been updated by ivy:
URL: https://cgit.FreeBSD.org/src/commit/?id=e42935e5871be01246133674427c682fa152a5fd
commit e42935e5871be01246133674427c682fa152a5fd
Author: Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-04 16:50:56 +0000
Commit: Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-10-05 05:25:04 +0000
Makefile.inc1: Fix package-pkg with CROSS_TOOLCHAIN
CROSS_TOOLCHAIN is used to build src with a different toolchain than
the bundled one. Ports also has a CROSS_TOOLCHAIN option, but it has
a different meaning. When building ports-mgmt/pkg from ports for the
package-pkg target, unset CROSS_TOOLCHAIN to prevent ports from being
confused.
This fixes 'make CROSS_TOOLCHAIN=llvm19 package-pkg' for the native
target, but cross-building (e.g., targetting powerpc from amd64) is
still broken due to an issue in pkg itself.
MFC after: 3 seconds
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52902
(cherry picked from commit b09dd586518aaa0ac24b70ca522f4054165c8031)
---
release/scripts/make-pkg-package.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/release/scripts/make-pkg-package.sh b/release/scripts/make-pkg-package.sh
index a1e006bd6964..3a1b163bd591 100755
--- a/release/scripts/make-pkg-package.sh
+++ b/release/scripts/make-pkg-package.sh
@@ -8,6 +8,13 @@ PKG_ABI=$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)
unset PKG_VERSION
unset MAKEFLAGS
unset PKGBASE
+# Ports interprets CROSS_TOOLCHAIN differently from src, and having this set
+# breaks the package-pkg build. For now, forcibly unset this and hope ports
+# can find a working compiler.
+if [ -n "$CROSS_TOOLCHAIN" ]; then
+ printf >&2 '%s: WARNING: CROSS_TOOLCHAIN will be ignored for the pkg build.\n' "$0"
+ unset CROSS_TOOLCHAIN
+fi
export WRKDIRPREFIX=/tmp/ports.${TARGET}
export DISTDIR=/tmp/distfiles
export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg I_DONT_CARE_IF_MY_BUILDS_TARGET_THE_WRONG_RELEASE=YES -V WRKDIR)