git: 70c04943208f - stable/13 - Avoid using TARGET_ARCH in llvm.build.mk

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 21 Aug 2022 11:28:55 UTC
The branch stable/13 has been updated by dim:

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

commit 70c04943208fd5441024d0cf6e0486ea4bfb0f4e
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-08-14 11:10:48 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-08-21 11:10:22 +0000

    Avoid using TARGET_ARCH in llvm.build.mk
    
    Apparently the TARGET_ARCH macro is not supposed to be used outside of
    the top-level Makefiles. Directly use MACHINE_ARCH instead.
    
    Noticed by:     imp, jrtc27
    MFC after:      1 week
    
    (cherry picked from commit 8534e6be8110a8126268a38dc0557a2d15615ce9)
---
 lib/clang/llvm.build.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk
index 888e240de43e..e1f9c05de729 100644
--- a/lib/clang/llvm.build.mk
+++ b/lib/clang/llvm.build.mk
@@ -26,15 +26,14 @@ CFLAGS+=	-DHAVE_VCS_VERSION_INC
 CFLAGS+=	-DNDEBUG
 .endif
 
-TARGET_ARCH?=	${MACHINE_ARCH}
 BUILD_ARCH?=	${MACHINE_ARCH}
 
 # Armv6 and armv7 uses hard float abi, unless the CPUTYPE has soft in it.
 # arm (for armv4 and armv5 CPUs) always uses the soft float ABI.
 # For all other targets, we stick with 'unknown'.
-.if ${TARGET_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
+.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
 TARGET_ABI=	-gnueabihf
-.elif ${TARGET_ARCH:Marm*}
+.elif ${MACHINE_ARCH:Marm*}
 TARGET_ABI=	-gnueabi
 .else
 TARGET_ABI=
@@ -42,7 +41,7 @@ TARGET_ABI=
 VENDOR=		unknown
 OS_VERSION=	freebsd13.1
 
-LLVM_TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-${OS_VERSION}${TARGET_ABI}
+LLVM_TARGET_TRIPLE?=	${MACHINE_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-${OS_VERSION}${TARGET_ABI}
 LLVM_BUILD_TRIPLE?=	${BUILD_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-${OS_VERSION}
 
 CFLAGS+=	-DLLVM_DEFAULT_TARGET_TRIPLE=\"${LLVM_TARGET_TRIPLE}\"