From b6b58d96d9ff4680733bbd88407fac38cfe46ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 6 Sep 2024 12:23:58 +0300 Subject: [PATCH] build-llvm: Add an option --no-llvm-tool-reuse This allows using the build-llvm.sh script for doing a cross build of LLVM, while the same directory may contain a native build which can be out of sync with the actual source. --- build-cross-tools.sh | 3 +++ build-llvm.sh | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build-cross-tools.sh b/build-cross-tools.sh index ee72284..1aa9480 100755 --- a/build-cross-tools.sh +++ b/build-cross-tools.sh @@ -31,6 +31,9 @@ while [ $# -gt 0 ]; do --disable-clang-tools-extra) LLVM_ARGS="$LLVM_ARGS $1" ;; + --no-llvm-tool-reuse) + LLVM_ARGS="$LLVM_ARGS $1" + ;; --disable-mingw-w64-tools) NO_MINGW_W64_TOOLS=1 ;; diff --git a/build-llvm.sh b/build-llvm.sh index 2cf52cd..080a487 100755 --- a/build-llvm.sh +++ b/build-llvm.sh @@ -65,6 +65,9 @@ while [ $# -gt 0 ]; do --disable-clang-tools-extra) unset CLANG_TOOLS_EXTRA ;; + --no-llvm-tool-reuse) + NO_LLVM_TOOL_REUSE=1 + ;; *) PREFIX="$1" ;; @@ -186,7 +189,7 @@ if [ -n "$HOST" ]; then fi - if [ -n "$native" ]; then + if [ -n "$native" ] && [ -z "$NO_LLVM_TOOL_REUSE" ]; then CMAKEFLAGS="$CMAKEFLAGS -DLLVM_NATIVE_TOOL_DIR=$native" fi CROSS_ROOT=$(cd $(dirname $(command -v $HOST-gcc))/../$HOST && pwd)