[llvm] Disable HandleLLVMOptions in runtimes mode by jhuber6 · Pull Request #73031 · llvm/llvm-project (original) (raw)

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).