[compiler-rt] [compiler-rt] allow removing libc dependency on Android (PR #152394)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 09:35:34 PDT 2025


efriedma-quic wrote:

> What exactly are you worried about going wrong with a bare-metal build in a non-bare platform? Yes, I could imagine there being something that uses a privileged instruction or whatever.

For example, in compiler-rt/lib/builtins/cpu_model/aarch64.c, for baremetal targets, we skip resolving CPU features.  So we might break CPU feature detection if you use the library in the wrong place.  If you want a compiler-rt subset, you need to completely exclude that file.

> If a new flag is the approach that is the most likely to be accepted, some way to get to the intersection of the freestanding and hosted built-ins sets (only ones that would appear in both), then I think we would be happy to contribute that.

If there's a distinct flag for it, and the resulting library has a different name from the regular compiler-rt.builtins.a, I think I'm fine with it.

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


More information about the llvm-commits mailing list