[llvm] [flang-rt][build] Add support for building flang-rt as a standalone project (PR #168321)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 24 07:00:46 PST 2025


Meinersbur wrote:

> I even think that these two build mode(runtime-default and standalone), will not add any extra maintenance costs. 

As someone who works on keep working all the ways that flang-rt, offload, and openmp could be built, I disagree.

> otherwise, the compiler-rt community would likely only allowed the runtime-default build mode(There may be other reasons).

LLVM_ENABLE_PROJECTS=compiler-rt (to compile all at once) and standalone mode (to use an existing LLVM installation) exist from before LLVM_ENABLE_RUNTIMES was introduced. At that time there was a discussion on what is the difference was between "runtimes" (such as libc++, compiler-rt, libunwind, openmp, ...) and and "tools" (such as Clang, MLIR, lld, ..). It was decided that the runtimes should by default be built by Clang itself, not by the host compiler. For instance, libc++, compiler-rt do not support being compiled with MSVC, but the "tools" do.  As such, for the runtimes, LLVM_ENABLE_RUNTIMES=compile-rt (bootstrapping build) was to replace LLVM_ENABLE_PROJECTS=compiler-rt and the runtimes-default build takes over the purpose of the standalone build. I don't think we want to maintain those legacy build modes forever.

Even before LLVM_ENABLE_RUNTIMES, we try to [reduce the matrix of configurations](https://discourse.llvm.org/t/rfc-llvm-build-system-future-direction/53430). Fewer build modes is a part of it. Years ago, LLVM supported an autoconf-based build mode (which was there forst) in addition to a CMake one. Imagine if we still had to support that.

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


More information about the llvm-commits mailing list