[llvm] [runtimes] Append `-nostd*++` flags only for Clang (PR #151930)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 7 06:17:19 PDT 2025
jhuber6 wrote:
> I think it was added because originally, LLVM_ENABLE_RUNTIMES was invented for libc++(abi). It is C++, but obviously cannot link against libc++.so before libc++.so is built. For any library that is not libc++ but uses the C++ standard library (flang-rt, hwloc through openmp, maybe others), as long as there is a libc++/libstdc++ installed on the system and found by Clang, it can use that.
>
> If we want those runtimes to link together with just-built libc++, we need a 4-stage bootstrapping build (clang -> compiler-rt builtins -> libc++ -> flang-rt/openmp). Or, at least this seems to be the current approach, make the configure step not depend on the existence of the C++ standard library, but for build-time, one can add a dependency to libc++ if built in the same runtimes build.
I don't think we fully need to bootstrap it, we already have `libc++` built on top of `libc` and I built `flang-rt` on top of `libc++` built on to of `libc`. Shouldn't these just be a list of CMake dependencies? The runtimes order is deterministic so we just move those libraries earlier in the chain. Having the builtins separate only makes sense because oftentimes those are necessary for passing some feature checks by the compiler.
https://github.com/llvm/llvm-project/pull/151930
More information about the llvm-commits
mailing list