diff mbox

unbreak bootstrap on FreeBSD ppc

Message ID 4D4ACBB7.10800@fgznet.ch
State New
Headers show

Commit Message

Andreas Tobler Feb. 3, 2011, 3:37 p.m. UTC
Hi all,

bootstrap on FreeBSD PowerPC is broken since r167085. Even longer for 
soft-float.

The attached patch should solve this breakage.

The first part I solved the same way as linux-ppc. Honza gave me hand to 
track down what the issue was.

I had this failure:

/export/devel/gcc/head/gcc/libgcc/../gcc/emutls.c:92:1: error:
  emutls_alloc causes a section type conflict

With the second part, the soft-float issue I have tried to solve it with 
adding a t-freebsd file which overrides the LIB2FUNCS_EXTRA. On PowerPC 
FreeBSD the long double is only 64-bit wide.
I do not know if there is a nicer variant. As I understand, I can not 
add an 'if else' in the t-file, right?

I'll post the results once the test has completed.

I'll appreciate any comment.

Thanks,
Andreas

gcc part:
---------
2011-02-03  Andreas Tobler  <andreast@fgznet.ch>

	* config/rs6000/freebsd.h: (RELOCATABLE_NEEDS_FIXUP): Define in
	terms of target_flags_explicit. Adjust copyright year.

	* config.gcc: Add FreeBSD PowerPC soft-float libgcc bits.
	* config/rs6000/t-freebsd: New file. Add override for
	LIB2FUNCS_EXTRA.

libgcc part:
------------

2011-02-03  Andreas Tobler  <andreast@fgznet.ch>

	* config.host (cpu_type): Add FreeBSD PowerPC specific parts.
	Adjust copyright year.

Comments

Andreas Schwab Feb. 3, 2011, 4:23 p.m. UTC | #1
Andreas Tobler <andreast-list@fgznet.ch> writes:

> +	tmake_file="${tmake_file} t-slibgcc-libgcc rs6000/t-fprules-softfp soft-
> +fp/t-softfp"

There is a spurious line break here.

Andreas.
Andreas Tobler Feb. 3, 2011, 4:32 p.m. UTC | #2
On 03.02.11 17:23, Andreas Schwab wrote:
> Andreas Tobler<andreast-list@fgznet.ch>  writes:
>
>> +	tmake_file="${tmake_file} t-slibgcc-libgcc rs6000/t-fprules-softfp soft-
>> +fp/t-softfp"
>
> There is a spurious line break here.

Thank you very much! Fixed.

I also saw another typo:

s/powerpc*-*-freebsd*/powerpc-*-freebsd*

The powerpc* variant will hopefully be ready for 4.7 :)

Andreas
diff mbox

Patch

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 169503)
+++ gcc/config.gcc	(working copy)
@@ -2050,7 +2050,9 @@ 
 	;;
 powerpc*-*-freebsd*)
 	tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h"
-	tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+	tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm rs6000/t-freebsd"
+	tmake_file="${tmake_file} t-slibgcc-libgcc rs6000/t-fprules-softfp soft-
+fp/t-softfp"
 	extra_options="${extra_options} rs6000/sysv4.opt"
 	;;
 powerpc-*-netbsd*)
Index: gcc/config/rs6000/freebsd.h
===================================================================
--- gcc/config/rs6000/freebsd.h	(revision 169503)
+++ gcc/config/rs6000/freebsd.h	(working copy)
@@ -1,5 +1,6 @@ 
 /* Definitions for PowerPC running FreeBSD using the ELF format
-   Copyright (C) 2001, 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2007, 2009, 2010, 2011
+   Free Software Foundation, Inc.
    Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
 
    This file is part of GCC.
@@ -70,4 +71,10 @@ 
 #undef  ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
 
+/* We don't need to generate entries in .fixup, except when
+   -mrelocatable or -mrelocatable-lib is given.  */
+#undef RELOCATABLE_NEEDS_FIXUP
+#define RELOCATABLE_NEEDS_FIXUP \
+  (target_flags & target_flags_explicit & MASK_RELOCATABLE)
+
 #define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO)
Index: gcc/config/rs6000/t-freebsd
===================================================================
--- gcc/config/rs6000/t-freebsd	(revision 0)
+++ gcc/config/rs6000/t-freebsd	(revision 0)
@@ -0,0 +1,24 @@ 
+# Overrides for FreeBSD PowerPC 
+#
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# We do not want to build darwin-ldouble.c, so set the LIB2FUNCS_EXTRA again. 
+# Invoke this file after rs6000/t-ppccomm.
+
+LIB2FUNCS_EXTRA = tramp.S
Index: libgcc/config.host
===================================================================
--- libgcc/config.host	(revision 169503)
+++ libgcc/config.host	(working copy)
@@ -464,6 +464,7 @@ 
 powerpc64-*-darwin*)
 	;;
 powerpc*-*-freebsd*)
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-freebsd t-softfp"
 	;;
 powerpc-*-netbsd*)
 	;;