From a41085f7d99c5d328807bdda70831cd4cf8b2790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 27 Jun 2025 17:21:38 +0300 Subject: [PATCH] build-llvm: Set CMAKE_STRIP when cross compiling with Clang If using Clang from /usr/bin, this makes it clear to CMake to use $HOST-strip, as it otherwise may pick plain /usr/bin/strip, which may not be able to strip the cross built executables. --- build-llvm.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-llvm.sh b/build-llvm.sh index ecd55db..4fb165e 100755 --- a/build-llvm.sh +++ b/build-llvm.sh @@ -194,6 +194,9 @@ if [ -n "$HOST" ]; then CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_ASM_COMPILER_TARGET=$HOST" CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER_TARGET=$HOST" CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER_TARGET=$HOST" + if command -v $HOST-strip >/dev/null; then + CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_STRIP=$(command -v $HOST-strip)" + fi else CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER=$HOST-gcc" CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER=$HOST-g++"