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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 18:59:02 PST 2019


phosek marked an inline comment as done.
phosek added inline comments.


================
Comment at: compiler-rt/lib/crt/CMakeLists.txt:81
+    SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtbegin.c
+    CFLAGS ${CRT_CFLAGS}
+    PARENT_TARGET crt)
----------------
MaskRay wrote:
> phosek wrote:
> > MaskRay wrote:
> > > Just to ask if my understanding is correct.
> > > 
> > > clang_rt.crtbegin.o: replacement of crtbegin.o
> > > (-fno-PIC can be used here as some toolchains default to -fPIC or -fPIE, but it doesn't matter much here)
> > > 
> > > clang_rt.crtbegin_shared.o: replacement of crtbeginS.o crtbeginT.o
> > > 
> > Correct, `crtbeginS.o` and `crtbeginT.o` don't match the naming conventions of other compiler-rt artifacts, so I came up with this scheme which should be a better fit for compiler-rt. I'm open to other suggestions though.
> Since `crtbeginT.o` is used by `-static` (`gcc -dumpspecs`: `%{static:crtbeginT.o%s;      shared|!no-pie:crtbeginS.o%s;      :crtbegin.o%s}`), `crtbegin_shared` may not be a good name. But I don't know of a better name, either...
> 
> Other than this, other parts look great! Thank you for doing this.
Android seems t be using `crtbegin_dynamic.o` but I don't know if that's much better?


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

https://reviews.llvm.org/D28791





More information about the llvm-commits mailing list