Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Oct 2025 17:52:49 GMT
From:      Lexi Winter <ivy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b09dd586518a - main - Makefile.inc1: Fix package-pkg with CROSS_TOOLCHAIN
Message-ID:  <202510041752.594HqnZa090033@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by ivy:

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

commit b09dd586518aaa0ac24b70ca522f4054165c8031
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-04 16:50:56 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-10-04 17:52:39 +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
---
 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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510041752.594HqnZa090033>