[Proposal] split built-ins from the rest of "compiler-rt"

Not sure I understand this.

  • The atomic helpers with locks are in libatomic.so. compiler-rt builtins has a CMake option to provide atomic helpers, but it’s off by default, with a very explicit warning next to the option that it will explode in environments with shared libraries.
  • The only floating-point routines compiler-rt provides are basic arithmetic; IEEE 754 requires those operations to be correctly rounded, so all implementations should return exactly the same thing.

Every target that supports C++ has a usable equivalent.


Using a command-line option to indicate the compiler runtime is fine as far as it goes, but then we’re still stuck with the issue that the set of APIs has been essentially frozen for the past 30 (?) years. This means if we want a new builtin for any reason, we can’t have it; we’re stuck emitting inline copies of the functionality everywhere in the user’s program.

I think embedding the implementations into object files is the best approach for any interface we want outside the historic libgcc ABI; it’s much less likely to cause weird issues for users compared to anything that requires prebuilt libraries.