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/sparcv9/Makefile.com
          +++ new/usr/src/lib/libc/sparcv9/Makefile.com
↓ open down ↓ 992 lines elided ↑ open up ↑
 993  993          $(COMSYSOBJS)           \
 994  994          $(SYSOBJS)              \
 995  995          $(COMSYSOBJS64)         \
 996  996          $(SYSOBJS64)            \
 997  997          $(VALUES)
 998  998  
 999  999  TRACEOBJS=                      \
1000 1000          plockstat.o
1001 1001  
1002 1002  # NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
1003      -# modules whose source is provided in the $(SRC)/lib/common directory.
     1003 +# modules whose source is provided in the $(SRC)/lib/crt directory.
1004 1004  # This must be done because otherwise the Sun C compiler would insert
1005 1005  # its own versions of these modules and those versions contain code
1006 1006  # to call out to C++ initialization functions.  Such C++ initialization
1007 1007  # functions can call back into libc before thread initialization is
1008 1008  # complete and this leads to segmentation violations and other problems.
1009 1009  # Since libc contains no C++ code, linking with the minimal crti.o and
1010 1010  # crtn.o modules is safe and avoids the problems described above.
1011 1011  OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1012      -CRTSRCS= ../../common/sparcv9
     1012 +CRTSRCS= ../../crt/sparcv9
1013 1013  
1014 1014  # include common library definitions
1015 1015  include $(SRC)/lib/Makefile.lib
1016 1016  include $(SRC)/lib/Makefile.lib.64
1017 1017  
1018 1018  # we need to override the default SONAME here because we might
1019 1019  # be building a variant object (still libc.so.1, but different filename)
1020 1020  SONAME = libc.so.1
1021 1021  
1022 1022  CFLAGS64 += $(CCVERBOSE)
↓ open down ↓ 305 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX