From 14a17396dfc53d01e82f9125c4da86203aa40a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 22 Oct 2026 16:11:17 +0300 Subject: [PATCH] build-llvm: Disable CLANG_ENABLE_CIR In recent git versions of llvm-project, this option (enabling the new experimental ClangIR feature) defaults to true. Disable it in our builds; ClangIR is still experimental. Building with ClangIR enabled currently breaks builds for a mingw target, if dylibs is enabled. (Dylibs are enabled in all builds of llvm-mingw currently. Dylibs makes the build significantly smaller, ending up at a zip file size around 156 MB instead of 399 MB, for one sample.) If building with ClangIR enabled, with dylibs, for a mingw target, the build fails with "ld.lld: error: too many exported symbols (got 94721, max 65535)", for libclang-cpp.dll. Without ClangIR enabled, the number of exported symbols from libclang-cpp.dll currently is around 43306. --- build-llvm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-llvm.sh b/build-llvm.sh index aed7379..1abf45e 100755 --- a/build-llvm.sh +++ b/build-llvm.sh @@ -403,6 +403,7 @@ cmake \ -DLLVM_TARGETS_TO_BUILD="ARM;AArch64;X86;NVPTX" \ -DLLVM_INSTALL_TOOLCHAIN_ONLY=$TOOLCHAIN_ONLY \ -DLLVM_LINK_LLVM_DYLIB=$LINK_DYLIB \ + -DCLANG_ENABLE_CIR=OFF \ -DLLVM_TOOLCHAIN_TOOLS="llvm-ar;llvm-ranlib;llvm-objdump;llvm-rc;llvm-cvtres;llvm-nm;llvm-strings;llvm-readobj;llvm-dlltool;llvm-pdbutil;llvm-objcopy;llvm-strip;llvm-cov;llvm-profdata;llvm-addr2line;llvm-symbolizer;llvm-windres;llvm-ml;llvm-readelf;llvm-size;llvm-cxxfilt;llvm-lib" \ ${HOST+-DLLVM_HOST_TRIPLE=$HOST} \ -DLLVM_BUILD_INSTRUMENTED=$INSTRUMENTED \