From 9ca34c714e9aa4d35bc359c03c5c917c81fdd21c Mon Sep 17 00:00:00 2001 From: David Mak Date: Fri, 13 Oct 2023 11:33:00 +0800 Subject: [PATCH] flake: Enable thread-safe mode for LLVM This is required as we use the LLVM APIs from multiple threads. --- nix/llvm/default.nix | 2 +- nix/windows/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/llvm/default.nix b/nix/llvm/default.nix index f33c16ca7..33a0e42e2 100644 --- a/nix/llvm/default.nix +++ b/nix/llvm/default.nix @@ -112,7 +112,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_UNWIND_TABLES=OFF" - "-DLLVM_ENABLE_THREADS=OFF" + "-DLLVM_ENABLE_THREADS=ON" "-DLLVM_INCLUDE_BENCHMARKS=OFF" "-DLLVM_BUILD_TOOLS=OFF" "-DLLVM_TARGETS_TO_BUILD=X86;ARM;RISCV" diff --git a/nix/windows/default.nix b/nix/windows/default.nix index b070af3e4..a8de76e98 100644 --- a/nix/windows/default.nix +++ b/nix/windows/default.nix @@ -65,7 +65,7 @@ in rec { ${silenceFontconfig} mkdir build cd build - wine64 cmake .. -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_UNWIND_TABLES=OFF -DLLVM_ENABLE_THREADS=OFF -DLLVM_TARGETS_TO_BUILD=X86\;ARM\;RISCV -DLLVM_LINK_LLVM_DYLIB=OFF -DLLVM_ENABLE_FFI=OFF -DFFI_INCLUDE_DIR=fck-cmake -DFFI_LIBRARY_DIR=fck-cmake -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_INSTALL_PREFIX=Z:$out + wine64 cmake .. -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_UNWIND_TABLES=OFF -DLLVM_ENABLE_THREADS=ON -DLLVM_TARGETS_TO_BUILD=X86\;ARM\;RISCV -DLLVM_LINK_LLVM_DYLIB=OFF -DLLVM_ENABLE_FFI=OFF -DFFI_INCLUDE_DIR=fck-cmake -DFFI_LIBRARY_DIR=fck-cmake -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_INSTALL_PREFIX=Z:$out ''; buildPhase = ''