[build] Move i386/crtprec to toplevel libgcc

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Tue Jul 12 16:51:00 GMT 2011


The next easy step in toplevel libgcc migration is moving
i386/crtprec.c.  I noticed that -mpc{32, 64, 80} wasn't supported on
Solaris/x86 yet and corrected that.  The only testcase using the switch
was adapted to also do so on Darwin/x86 (which already has the support,
but didn't exercise it).

For the reasons already described, I'm not yet removing crtprec??.o from
gcc/config/i386/t-linux64 (EXTRA_MULTILIB_PARTS).

Bootstrapped without regressions on i386-pc-solaris2.11,
x86_64-unknown-linux-gnu.  Bootstrap on i386-apple-darwin9.8.0 is
currently running.

Ok for mainline?

Thanks.
	Rainer


2011-07-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* config/i386/crtprec.c: Move to ../libgcc/config/i386.
	* config/i386/t-crtpc: Remove.
	* config/t-darwin (EXTRA_MULTILIB_PARTS): Remove.
	* config.gcc (i[34567]86-*-darwin*): Remove i386/t-crtpc from
	tmake_file.
	(x86_64-*-darwin*): Likewise.
	(i[34567]86-*-linux*): Likewise.
	(x86_64-*-linux*): Likewise.

	* config/i386/sol2.h (ENDFILE_SPEC): Redefine.
	Handle -mpc32, -mpc64, -mpc80.

	libgcc:
	* config/i386/crtprec.c: New file.
	* config/i386/t-crtpc: Use $(srcdir) to refer to crtprec.c.
	* config.host (i[34567]86-*-darwin*): Add i386/t-crtpc to tmake_file.
	Add crtprec32.o, crtprec64.o, crtprec80.o to extra_parts.
	(x86_64-*-darwin*): Likewise.
	(i[34567]86-*-solaris2*: Likewise.

	gcc/testsuite:
	* gcc.c-torture/execute/990127-2.x: Use -mpc64 on i?86-*-darwin*,
	i?86-*-solaris2*, x86_64-*-darwin*, x86_64-*-solaris2*.

diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1208,12 +1208,12 @@ i[34567]86-*-darwin*)
 	need_64bit_isa=yes
 	# Baseline choice for a machine that allows m64 support.
 	with_cpu=${with_cpu:-core2}
-	tmake_file="${tmake_file} t-slibgcc-dummy i386/t-crtpc"
+	tmake_file="${tmake_file} t-slibgcc-dummy"
 	libgcc_tm_file="$libgcc_tm_file i386/darwin-lib.h"
 	;;
 x86_64-*-darwin*)
 	with_cpu=${with_cpu:-core2}
-	tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc-dummy i386/t-crtpc"
+	tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc-dummy"
 	tm_file="${tm_file} ${cpu_type}/darwin64.h"
 	libgcc_tm_file="$libgcc_tm_file i386/darwin-lib.h"
 	;;
@@ -1311,7 +1311,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree
 	i[34567]86-*-kopensolaris*-gnu) tm_file="${tm_file} i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h" ;;
 	i[34567]86-*-gnu*) tm_file="$tm_file i386/gnu-user.h gnu.h i386/gnu.h";;
 	esac
-	tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc"
+	tmake_file="${tmake_file} i386/t-crtstuff"
 	;;
 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
@@ -1323,7 +1323,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu
 	x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu64.h" ;;
 	x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;;
 	esac
-	tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtpc"
+	tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff"
 	x86_multilibs="${with_multilib_list}"
 	if test "$x86_multilibs" = "default"; then
 		x86_multilibs="m64,m32"
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -70,6 +70,14 @@ along with GCC; see the file COPYING3.  
 #undef ASM_SPEC
 #define ASM_SPEC ASM_SPEC_BASE
 
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{mpc32:crtprec32.o%s} \
+   %{mpc64:crtprec64.o%s} \
+   %{mpc80:crtprec80.o%s} \
+   crtend.o%s crtn.o%s"
+
 #define SUBTARGET_CPU_EXTRA_SPECS \
   { "cpp_subtarget",	 CPP_SUBTARGET_SPEC },		\
   { "asm_cpu",		 ASM_CPU_SPEC },		\
diff --git a/gcc/config/i386/t-crtpc b/gcc/config/i386/t-crtpc
deleted file mode 100644
diff --git a/gcc/testsuite/gcc.c-torture/execute/990127-2.x b/gcc/testsuite/gcc.c-torture/execute/990127-2.x
--- a/gcc/testsuite/gcc.c-torture/execute/990127-2.x
+++ b/gcc/testsuite/gcc.c-torture/execute/990127-2.x
@@ -3,12 +3,16 @@
 # Use -mpc64 to force 80387 floating-point precision to 64 bits.  This option
 # has no effect on SSE, but it is needed in case of -m32 on x86_64 targets.
 
-if { [istarget i?86-*-linux*]
+if { [istarget i?86-*-darwin*]
+     || [istarget i?86-*-linux*]
      || [istarget i?86-*-kfreebsd*-gnu]
      || [istarget i?86-*-knetbsd*-gnu]
+     || [istarget i?86-*-solaris2*]
+     || [istarget x86_64-*-darwin*]
      || [istarget x86_64-*-linux*]
      || [istarget x86_64-*-kfreebsd*-gnu]
-     || [istarget x86_64-*-knetbsd*-gnu] } {
+     || [istarget x86_64-*-knetbsd*-gnu]
+     || [istarget x86_64-*-solaris2*] } {
 	set additional_flags "-mpc64"
 }
 
diff --git a/libgcc/config.host b/libgcc/config.host
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -381,12 +381,12 @@ hppa[12]*-*-hpux11*)
 	md_unwind_header=pa/hpux-unwind.h
 	;;
 i[34567]86-*-darwin*)
-	tmake_file="$tmake_file i386/t-crtfm"
-	extra_parts="$extra_parts crtfastmath.o"
+	tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
+	extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
 	;;
 x86_64-*-darwin*)
-	tmake_file="t-darwin ${cpu_type}/t-darwin64 i386/t-crtfm t-slibgcc-darwin"
-	extra_parts="$extra_parts crtfastmath.o"
+	tmake_file="t-darwin ${cpu_type}/t-darwin64 i386/t-crtpc i386/t-crtfm t-slibgcc-darwin"
+	extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
 	;;
 i[34567]86-*-elf*)
 	;;
@@ -442,8 +442,8 @@ i[34567]86-*-rtems*)
 	tmake_file="${tmake_file} t-crtin i386/t-softfp i386/t-crtstuff t-rtems"
 	;;
 i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
-	tmake_file="$tmake_file i386/t-crtfm"
-	extra_parts="$extra_parts crtfastmath.o"
+	tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
+	extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
 	md_unwind_header=i386/sol2-unwind.h
 	;;
 i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
diff --git a/gcc/config/i386/crtprec.c b/libgcc/config/i386/crtprec.c
rename from gcc/config/i386/crtprec.c
rename to libgcc/config/i386/crtprec.c
diff --git a/libgcc/config/i386/t-crtpc b/libgcc/config/i386/t-crtpc
--- a/libgcc/config/i386/t-crtpc
+++ b/libgcc/config/i386/t-crtpc
@@ -1,8 +1,8 @@
-crtprec32.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec32.o: $(srcdir)/config/i386/crtprec.c
 	$(gcc_compile) -D__PREC=32 -c $<
 
-crtprec64.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec64.o: $(srcdir)/config/i386/crtprec.c
 	$(gcc_compile) -D__PREC=64 -c $<
 
-crtprec80.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec80.o: $(srcdir)/config/i386/crtprec.c
 	$(gcc_compile) -D__PREC=80 -c $<

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



More information about the Gcc-patches mailing list