[PATCH] D28791: [compiler-rt][crt] Simple crtbegin and crtend implementation

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 31 16:50:58 PST 2018


phosek added a comment.

In D28791#1343021 <https://reviews.llvm.org/D28791#1343021>, @krytarowski wrote:

> > We're currently building an entire Linux system using Clang but we still need to pull in libgcc for `crtbegin.o`/`crtend.o`, so this isn't an ambition, it's the last remaining blocker.
>
> What are the technical reasons for this to reimplement it in Clang instead of pulling it from libgcc?


GCC's build system is quite monolithic and fragile and AFAIK it's not possible to build just `crtbegin.o`/`crtend.o` or libgcc without building the rest of GCC. `crtbegin.o`/`crtend.o` is produced by building `crtstuff.c` multiple times with different flags so building it outside of GCC's build system would mean replicating portion of GCC's build system and then keeping it up-to-date. I'm not saying that it's not possible to do this, but I'd like to be able to produce a fully working toolchain entirely from LLVM's build system, and neither of the two options outlined above get us any closer to that goal.


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D28791/new/

https://reviews.llvm.org/D28791





More information about the llvm-commits mailing list