[compiler-rt] [Fuchsia][cmake] Avoid referencing cxx_shared in compiler-rt (PR #112257)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 23:32:28 PDT 2024


petrhosek wrote:

> > Does someone understand how the layering works for compiler-rt? Libc++ links against compiler-rt itself, so how can we depend on libc++ from compiler-rt?
> 
> Aren't the builtins the only dependency? IIRC builtins are special in the runtimes build, and is handled that way to break the cyclic dependency in the build graph. @petrhosek can speak more to that though.

That's correct, we build builtins separately by using https://github.com/llvm/llvm-project/tree/main/compiler-rt/lib/builtins as the top-level CMake build directory, and then build the rest of compiler-rt as part of the runtimes build.

libc++ is currently only used by libFuzzer, ORC and XRay plus all unit tests (since it's a dependency of GoogleTest), the other runtimes in compiler-rt like sanitizers only depend on libc++abi. libFuzzer is a bit special in that it build its own copy of libc++ (in a subbuild) which is statically linked into a relocatable object.

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


More information about the llvm-commits mailing list