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.
This commit is contained in:
Martin Storsjö committed 2025-06-30 14:12:02 +03:00
1 parent ee2239a2b8
commit 9d5860a02d
1 file changed
+1
+1
View File
@@ -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