diff options
| author | Lexi Winter <ivy@FreeBSD.org> | 2025-10-04 16:50:56 +0000 |
|---|---|---|
| committer | Lexi Winter <ivy@FreeBSD.org> | 2025-10-04 17:52:39 +0000 |
| commit | b09dd586518aaa0ac24b70ca522f4054165c8031 (patch) | |
| tree | 3ba09063972ef03a372fcdb0f790d10fb761f5d3 | |
| parent | 026707768f673518c2fe9bcd9020d53a0d02fc7e (diff) | |
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
| -rwxr-xr-x | release/scripts/make-pkg-package.sh | 7 |
1 files changed, 7 insertions, 0 deletions
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) |
