git: 702e1e5d1ef6 - stable/12 - native-xtools: avoid libllvm while populating the sysroot

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Thu, 19 May 2022 15:12:53 UTC
The branch stable/12 has been updated by kevans:

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

commit 702e1e5d1ef6b019db926a4bc714bed013a2392e
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-10-13 09:21:28 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-05-19 15:12:42 +0000

    native-xtools: avoid libllvm while populating the sysroot
    
    Prior to 021385aba562, MK_CLANG=no was sufficient to avoid descending
    into lib/clang, but the referenced change added a couple of other
    enabling knobs. Turn those off, too, to continue avoiding libllvm.
    
    With this change, we no longer end up with a libllvm using the wrong
    default target triple; `poudriere jail -cx` works once again.
    
    Reported by:    bhughes, imp, probably others
    Fixes:  021385aba562 ("Add WITH_LLVM_BINUTILS to install LLVM ...")
    
    (cherry picked from commit e2e2c622c35f3e54dbae88e3de3e48c51dbb4ebd)
---
 Makefile.inc1 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index a714302a5744..3bfe99f2e6c3 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2544,6 +2544,10 @@ NXBMAKEARGS+= \
 	MK_WARNS=no \
 	MK_ZFS=no
 
+# This should match all of the knobs in lib/Makefile that it takes to avoid
+# descending into lib/clang!
+NXBTNOTOOLS=	MK_CLANG=no MK_LLD=no MK_LLDB=no MK_LLVM_BINUTILS=no MK_GCC=no
+
 .if make(native-xtools*) && \
     (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH))
 .error Missing NXB_TARGET / NXB_TARGET_ARCH
@@ -2588,8 +2592,8 @@ native-xtools: .PHONY
 	# polluting the cross-compiler build.  The LLVM/GCC libs are skipped
 	# here to avoid the problem but are kept in 'toolchain' so that
 	# needed build tools are built.
-	${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no MK_GCC=no
-	${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no MK_GCC=no
+	${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes ${NXBTNOTOOLS}
+	${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries ${NXBTNOTOOLS}
 	# Clean out improper TARGET=MACHINE files
 	${_+_}cd ${.CURDIR}/gnu/usr.bin/cc/cc_tools; ${NXBTMAKE} cleandir
 .if !defined(NO_OBJWALK)