As reported in the PR, powerpc-rtems bootstrap (and certainly several
other powerpc targets) is currently broken since rs6000/ibm-ldouble.c
appears twice in LIB2ADD, once from rs6000/t-ppccomm and
rs6000/t-ppccomm-ldbl, which confuses make.

It took me a while to understand how we got into that situation.  Here's
what I found: before the toplevel libgcc move started, we had both
gcc/config/rs6000/t-ppccomm and libgcc/config/rs6000/t-ppccomm.  The
second is a superset of the first, in that it contains LIB2ADD_ST +=
crtsavfpr.S crtresfpr.S and many other similar files.

The set of targets using the gcc and libgcc files differs:

        gcc/config/rs6000/t-ppccomm     libgcc/config/rs6000/t-ppccomm

          powerpc-*-freebsd*            powerpc-*-freebsd*
          powerpc-*-eabispe*            powerpc-*-eabispe*
          powerpc-*-eabisimaltivec*
          powerpc-*-eabisim*
          powerpc-*-elf*
          powerpc-*-eabialtivec*
          powerpc-xilinx-eabi*
          powerpc-*-eabi*               powerpc-*-eabi*
          powerpc-*-rtems*
          powerpc-*-linux*              powerpc-*-linux*
            | powerpc64-*-linux*          | powerpc64-*-linux*
          powerpc-*-gnu-gnualtivec*
          powerpc-*-gnu*
          powerpc-wrs-vxworks
            | powerpc-wrs-vxworksae
          powerpcle-*-elf*
          powerpcle-*-eabisim*
          powerpcle-*-eabi*

When I started the move, I introduced
libgcc/config/rs6000/t-ppccomm-ldbl since I couldn't simply use the
existing t-ppccomm file which is used on a far smaller set of targets.

To reach an end state matching what we had before the move, I propose to
instead create a separate t-savresfgpr (for {sav,res}{fpr,gpr,gprctr})
that only contains the additional files and add that to the targets that
had it before, and remove t-ppccomm-ldbl to avoid the duplication.

When checking this, I noticed that powerpc-vxworks had lost
rs6000/t-ppccomm, which the patch adds back.

I'd really appreciate if some affected targets could fully test the
patch.

Thanks.
        Rainer


2011-11-20  Rainer Orth  <r...@cebitec.uni-bielefeld.de>

        PR other/51022
        * config/rs6000/t-savresfgpr: New file.
        * config/rs6000/t-ppccomm (LIB2ADD_ST): Remove all but
        $(srcdir)/config/rs6000/eabi.S.
        * config/rs6000/t-ppccomm-ldbl: Remove.
        * config.host (powerpc-*-freebsd*): Add rs6000/t-savresfgpr to
        tmake_file.
        (powerpc-*-eabispe*): Likewise.
        (powerpc-*-eabi*): Likewise.
        (powerpc-*-linux*, powerpc64-*-linux*): Likewise.
        (powerpc-wrs-vxworks, powerpc-wrs-vxworksae): Add rs6000/t-ppccomm
        to tmake_file, remove rs6000/t-ppccomm-ldbl.
        (powerpc-*-eabisimaltivec*): Remove rs6000/t-ppccomm-ldbl from
        tmake_file.
        (powerpc-*-eabisim*): Likewise.
        (powerpc-*-elf*): Likewise.
        (powerpc-*-eabialtivec*): Likewise.
        (powerpc-xilinx-eabi*): Likewise.
        (powerpc-*-rtems*): Likewise.
        (powerpcle-*-elf*): Likewise.
        (powerpcle-*-eabisim*): Likewise.
        (powerpcle-*-eabi*): Likewise.

# HG changeset patch
# Parent 4ec0f566a9a8795dbe0d67024a347bd0ecd41e7a
Fix t-ppccomm bootstrap

diff --git a/libgcc/config/rs6000/t-ppccomm b/libgcc/config/rs6000/t-ppccomm
--- a/libgcc/config/rs6000/t-ppccomm
+++ b/libgcc/config/rs6000/t-ppccomm
@@ -29,13 +29,13 @@ LIB2ADD_ST += \
 
 # Assemble startup files.
 ecrti$(objext): $(srcdir)/config/rs6000/eabi-ci.S
-	$(crt_compile) -c ecrti.S
+	$(crt_compile) -c $<
 
 ecrtn$(objext): $(srcdir)/config/rs6000/eabi-cn.S
-	$(crt_compile) -c ecrtn.S
+	$(crt_compile) -c $<
 
 ncrti$(objext): $(srcdir)/config/rs6000/sol-ci.S
-	$(crt_compile) -c ncrti.S
+	$(crt_compile) -c $<
 
 ncrtn$(objext): $(srcdir)/config/rs6000/sol-cn.S
-	$(crt_compile) -c ncrtn.S
+	$(crt_compile) -c $<

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

Reply via email to