[llvm] [llvm] Disable some LLVM arguments in runtimes mode (PR #73031)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 13:50:13 PST 2023


================
@@ -151,6 +151,9 @@ endif()
 # Avoid checking whether the compiler is working.
 set(LLVM_COMPILER_CHECKED ON)
 
+# This can be used to detect whether we're in the runtimes build.
+set(LLVM_RUNTIMES_BUILD ON)
+
 # Handle common options used by all runtimes.
 include(AddLLVM)
 include(HandleLLVMOptions)
----------------
petrhosek wrote:

It's been a few years since I last looked into this, but I tried removing it (since I agree that it can be actively harmful) and the issue I hit was that many of the runtimes builds were assuming variables and options set by `HandleLLVMOptions` because those were always present when building with `LLVM_ENABLE_PROJECTS`.

I'm not sure how much the situation has improved since then, I expect it won't be a big issue for libunwind, libc++abi, libc++ which no longer support `LLVM_ENABLE_PROJECTS`, but might still be an issue for compiler-rt and libc which do support building with `LLVM_ENABLE_PROJECTS` (although I hope that won't be the case for too long).

Probably the best path forward would be to try and remove it, see what fails and address each of those cases separately. The main issue is that many of those failures would be silent (e.g. a check that was passing before might be failing now but the build itself would still continue, except the build outputs might be different).

https://github.com/llvm/llvm-project/pull/73031


More information about the llvm-commits mailing list