From 2d11044217edd9168eafea1c8c60603f87b0e00d Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Thu, 24 Sep 2015 08:51:39 +0000 Subject: 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 --- libgcc/configure.ac | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'libgcc/configure.ac') diff --git a/libgcc/configure.ac b/libgcc/configure.ac index dfabd808d11..9d831a76997 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -292,6 +292,31 @@ mips*-*-*) [libgcc_cv_mips_hard_float=no])]) esac +case ${host} in +*-*-solaris2*) + # Check for system-provided CRTs on Solaris 11.x and Solaris 12. + AC_CACHE_CHECK([system-provided CRTs on Solaris], + [libgcc_cv_solaris_crts], + [libgcc_cv_solaris_crts=no + libgcc_sysroot="`${CC} -print-sysroot`" + libgcc_libdir="$libgcc_sysroot/usr/lib" + # At the time they were added, gcrt1.o became a symlink for backwards + # compatibility on x86, while crt1.o was added on sparc, so check for that. + case ${host} in + i?86-*-solaris2* | x86_64-*-solaris2*) + if test -h "$libgcc_libdir/gcrt1.o"; then libgcc_cv_solaris_crts=yes; fi + ;; + sparc*-*-solaris2*) + if test -f "$libgcc_libdir/crt1.o"; then libgcc_cv_solaris_crts=yes; fi + ;; + esac]) + if test $libgcc_cv_solaris_crts = yes; then + AC_DEFINE(HAVE_SOLARIS_CRTS, 1, + [Define if the system-provided CRTs are present on Solaris.]) + fi + ;; +esac + # Determine the version of glibc, if any, used on the target. AC_MSG_CHECKING([for target glibc version]) AC_ARG_WITH([glibc-version], -- cgit v1.2.1