Print this page
crt: Need a position-independent CRT for PIE
- Implement the greatest possible part of the crt1 in C
- Implement SPARC versions of the ASM sections of crt1
- Build crt1 position-independently, minor ASM updates to be position
  independent
- Implement crt1 with the hook expected by modern GCC to support
  profiling, make gcrt1 a symlink for source compatibility (older GCC
  initializes profiling at firsnt use of _mcount if necessary, so
  doesn't need the gcrt)
- Split the CRT out of developer/library/lint into a separate c-runtime package

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/i386/Makefile.com
          +++ new/usr/src/lib/libc/i386/Makefile.com
↓ open down ↓ 1016 lines elided ↑ open up ↑
1017 1017          $(COMSYSOBJS)           \
1018 1018          $(SYSOBJS)              \
1019 1019          $(COMSYSOBJS64)         \
1020 1020          $(SYSOBJS64)            \
1021 1021          $(VALUES)
1022 1022  
1023 1023  TRACEOBJS=                      \
1024 1024          plockstat.o
1025 1025  
1026 1026  # NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
1027      -# modules whose source is provided in the $(SRC)/lib/common directory.
     1027 +# modules whose source is provided in the $(SRC)/lib/crt directory.
1028 1028  # This must be done because otherwise the Sun C compiler would insert
1029 1029  # its own versions of these modules and those versions contain code
1030 1030  # to call out to C++ initialization functions.  Such C++ initialization
1031 1031  # functions can call back into libc before thread initialization is
1032 1032  # complete and this leads to segmentation violations and other problems.
1033 1033  # Since libc contains no C++ code, linking with the minimal crti.o and
1034 1034  # crtn.o modules is safe and avoids the problems described above.
1035 1035  OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1036      -CRTSRCS= ../../common/i386
     1036 +CRTSRCS= ../../crt/i86
1037 1037  
1038 1038  LDPASS_OFF=     $(POUND_SIGN)
1039 1039  
1040 1040  # include common library definitions
1041 1041  include ../../Makefile.lib
1042 1042  
1043 1043  # we need to override the default SONAME here because we might
1044 1044  # be building a variant object (still libc.so.1, but different filename)
1045 1045  SONAME = libc.so.1
1046 1046  
↓ open down ↓ 291 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX