aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sol2.h
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2015-09-24 08:51:39 +0000
committerRainer Orth <ro@gcc.gnu.org>2015-09-24 08:51:39 +0000
commit2d11044217edd9168eafea1c8c60603f87b0e00d (patch)
tree025e93ec3292313d548bc0002efbee95ff405726 /gcc/config/sol2.h
parentfcb901cdfac9321b0202d800621f06b2aafd5bee (diff)
downloadgcc-2d11044217edd9168eafea1c8c60603f87b0e00d.zip
gcc-2d11044217edd9168eafea1c8c60603f87b0e00d.tar.gz
gcc-2d11044217edd9168eafea1c8c60603f87b0e00d.tar.bz2
Use CRTs provided by Solaris
gcc: * configure.ac (gcc_cv_solaris_crts): New test. * configure. Regenerate. * config.in: Regenerate. * config/sol2.h (STARTFILE_SPEC): Simplify, provide HAVE_SOLARIS_CRTS variant. libgcc: * configure.ac (libgcc_cv_solaris_crts): New test. * configure: Regenerate. * config.in: Regenerate. * config/sol2/crtp.c, config/sol2/crtpg.c: New files. * config/gmon-sol2.c: Rename to ... * config/sol2/gmon.c: ... this. Include auto-target.h. (internal_mcount): Wrap setup handling in !HAVE_SOLARIS_CRTS. * config/t-sol2: Rename to ... * config/sol2/t-sol2: ... this. (gmon.o): Reflect renaming. (crtp.o, crtpg.o): New rules. * config.host (*-*-solaris2*): Reflect renaming. Use system CRTs if present. Remove default CRT case. From-SVN: r228077
Diffstat (limited to 'gcc/config/sol2.h')
-rw-r--r--gcc/config/sol2.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index adf6f3b..d31a251 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -156,14 +156,24 @@ along with GCC; see the file COPYING3. If not see
/* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "%{!shared: \
- %{!symbolic: \
- %{p:mcrt1.o%s} \
- %{!p: \
- %{pg:gcrt1.o%s gmon.o%s} \
- %{!pg:crt1.o%s}}}} \
+#ifdef HAVE_SOLARIS_CRTS
+/* Since Solaris 11.x and Solaris 12, the OS delivers crt1.o, crti.o, and
+ crtn.o, with a hook for compiler-dependent stuff like profile handling. */
+#define STARTFILE_SPEC "%{!shared:%{!symbolic: \
+ crt1.o%s \
+ %{p:%e-p is not supported; \
+ pg:crtpg.o%s gmon.o%s; \
+ :crtp.o%s}}} \
crti.o%s %(startfile_arch) \
crtbegin.o%s"
+#else
+#define STARTFILE_SPEC "%{!shared:%{!symbolic: \
+ %{p:mcrt1.o%s; \
+ pg:gcrt1.o%s gmon.o%s; \
+ :crt1.o%s}}} \
+ crti.o%s %(startfile_arch) \
+ crtbegin.o%s"
+#endif
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \