From 9d5860a02d58162b1e689a7052528249b32ccddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 27 Jun 2025 16:51:55 +0300 Subject: [PATCH] build-llvm: Set CMAKE_ASM_COMPILER_TARGET when cross compiling with Clang CMAKE_ASM_COMPILER is set implicitly from CMAKE_C_COMPILER, but the target flags aren't implied in the same way. This fixes cross compiling LLVM with clang for an x86_64 target. This wasn't an issue when cross compiling LLVM with clang for an aarch64 target, because the BLAKE3 aarch64 SIMD is in the form of a C file (with intrinsics), not a standalone .S file. --- build-llvm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-llvm.sh b/build-llvm.sh index c950cfa..ecd55db 100755 --- a/build-llvm.sh +++ b/build-llvm.sh @@ -191,6 +191,7 @@ if [ -n "$HOST" ]; then CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER=clang" CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER=clang++" CMAKEFLAGS="$CMAKEFLAGS -DLLVM_USE_LINKER=lld" + CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_ASM_COMPILER_TARGET=$HOST" CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER_TARGET=$HOST" CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER_TARGET=$HOST" else