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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 3 20:20:18 PST 2019


MaskRay accepted this revision.
MaskRay 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)
----------------
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.


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

https://reviews.llvm.org/D28791





More information about the llvm-commits mailing list