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/sparc/Makefile.com
          +++ new/usr/src/lib/libc/sparc/Makefile.com
↓ open down ↓ 1053 lines elided ↑ open up ↑
1054 1054          $(COMSYSOBJS)           \
1055 1055          $(SYSOBJS)              \
1056 1056          $(COMSYSOBJS64)         \
1057 1057          $(SYSOBJS64)            \
1058 1058          $(VALUES)
1059 1059  
1060 1060  TRACEOBJS=                      \
1061 1061          plockstat.o
1062 1062  
1063 1063  # NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
1064      -# modules whose source is provided in the $(SRC)/lib/common directory.
     1064 +# modules whose source is provided in the $(SRC)/lib/crt directory.
1065 1065  # This must be done because otherwise the Sun C compiler would insert
1066 1066  # its own versions of these modules and those versions contain code
1067 1067  # to call out to C++ initialization functions.  Such C++ initialization
1068 1068  # functions can call back into libc before thread initialization is
1069 1069  # complete and this leads to segmentation violations and other problems.
1070 1070  # Since libc contains no C++ code, linking with the minimal crti.o and
1071 1071  # crtn.o modules is safe and avoids the problems described above.
1072 1072  OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1073      -CRTSRCS= ../../common/sparc
     1073 +CRTSRCS= ../../crt/sparcv7
1074 1074  
1075 1075  # include common library definitions
1076 1076  include $(SRC)/lib/Makefile.lib
1077 1077  
1078 1078  # we need to override the default SONAME here because we might
1079 1079  # be building a variant object (still libc.so.1, but different filename)
1080 1080  SONAME = libc.so.1
1081 1081  
1082 1082  CFLAGS += $(CCVERBOSE)
1083 1083  
↓ open down ↓ 333 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX