OSDN Git Service

* flow.c (find_unreachable_blocks): New function.
[pf3gnuchains/gcc-fork.git] / gcc / config.gcc
index 4f0d3dc..3f708a4 100644 (file)
@@ -254,7 +254,7 @@ case $machine in
        ;;
 esac   
 
-# Common parts for GNU/Linux, GNU/Hurd and OpenBSD systems.
+# Common parts for GNU/Linux, GNU/Hurd, OpenBSD and FreeBSD systems.
 case $machine in
 *-*-linux*)
        xm_defines=POSIX
@@ -274,7 +274,7 @@ case $machine in
        # These details are the same as for Linux.
        xmake_file=x-linux
        # But here we need a little extra magic.
-       tmake_file="t-linux t-gnu"
+       tmake_file="t-slibgcc-elf-ver t-linux t-gnu"
        case $machine in
        i[34567]86-*-*)
                tm_file="${cpu_type}/${cpu_type}.h i386/att.h linux.h i386/linux.h gnu.h ${tm_file}"
@@ -293,6 +293,62 @@ case $machine in
                tmake_file="${tmake_file} t-openbsd-thread"
        fi
        ;;
+*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
+       # This is the place-holder for the generic a.out configuration
+       # of FreeBSD.  No actual configuration resides here since
+       # there was only ever a bare-bones ix86 configuration for
+       # a.out and it exists solely in the machine-specific section.
+       # This place-holder must exist to avoid dropping into
+       # the generic ELF configuration of FreeBSD (i.e. it must be
+       # ordered before that section).
+       ;;
+*-*-freebsd*)
+       # This is the generic ELF configuration of FreeBSD.  Later
+       # machine-specific sections may refine and add to this
+       # configuration.
+       #
+       # Due to tm_file entry ordering issues that vary between cpu
+       # architectures, we only define fbsd_tm_file to allow the
+       # machine-specific section to dictate the final order of all
+       # entries of tm_file with the minor exception that components
+       # of the tm_file set here will always be of the form:
+       #
+       # freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd.h
+       #
+       # The machine-specific section should not tamper with this
+       # ordering but may order all other entries of tm_file as it
+       # pleases around the provided core setting.
+       gas=yes
+       gnu_ld=yes
+       extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+       case $machine in
+       *-*-freebsd3 | *-*-freebsd[3].*) fbsd_tm_file="freebsd3.h";;
+       *-*-freebsd4 | *-*-freebsd[4].*) fbsd_tm_file="freebsd4.h";;
+       *-*-freebsd5 | *-*-freebsd[5].*) fbsd_tm_file="freebsd5.h";;
+       *-*-freebsd6 | *-*-freebsd[6].*) fbsd_tm_file="freebsd6.h";;
+       *) echo 'Please update *-*-freebsd* in gcc/config.gcc'; exit 1;;
+       esac
+       tmake_file=t-freebsd
+       xm_defines=POSIX
+       case x${enable_threads} in
+       xno) fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h";;
+       x | xyes | xpthreads | xposix)
+               thread_file='posix'
+               tmake_file="${tmake_file} t-freebsd-thread"
+               ;;
+       *) echo 'Unknown thread configuration for FreeBSD'; exit 1;;
+       esac
+       fbsd_tm_file="${fbsd_tm_file} freebsd.h"
+       if test x${thread_file} = xposix; then
+         if test x${enable_libgcj} = xyes; then
+           echo 'FreeBSD does not currently handle --enable-threads (now'
+           echo 'the default to match system compiler) and --enable-libgcj.'
+           echo 'Please explicitly configure with --disable-threads or'
+           echo '--disable-libgcj'
+           exit 1
+         fi
+       fi
+       ;;
 esac
 
 case $machine in
@@ -374,7 +430,7 @@ alpha*-*-linux*ecoff*)
 alpha*-*-linux*libc1*)
        tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
        target_cpu_default="MASK_GAS"
-       tmake_file="t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-crtbe alpha/t-ieee"
+       tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-crtbe alpha/t-ieee"
        extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
        gas=yes gnu_ld=yes
        if test x$enable_threads = xyes; then
@@ -384,7 +440,7 @@ alpha*-*-linux*libc1*)
 alpha*-*-linux*)
        tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
        target_cpu_default="MASK_GAS"
-       tmake_file="t-linux alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
+       tmake_file="t-slibgcc-elf-ver t-linux alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
        extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
        gas=yes gnu_ld=yes
        if test x$enable_threads = xyes; then
@@ -392,19 +448,9 @@ alpha*-*-linux*)
        fi
        ;;
 alpha*-*-freebsd*)
-       xm_defines=POSIX
-       tm_file="${tm_file} freebsd.h alpha/elf.h alpha/freebsd.h"
+       tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
        target_cpu_default="MASK_GAS"
-       tmake_file="t-freebsd alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
-       extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
-       gas=yes gnu_ld=yes
-       stabs=yes
-       case x${enable_threads} in
-       xyes | xpthreads | xposix)
-               thread_file='posix'
-               tmake_file="${tmake_file} t-freebsd-thread"
-               ;;
-       esac
+       tmake_file="${tmake_file} alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
        ;;
 alpha*-*-netbsd*)
        xm_defines=POSIX
@@ -517,7 +563,7 @@ arm-semi-aout | armel-semi-aout)
        ;;
 arm-semi-aof | armel-semi-aof)
        tm_file=arm/semiaof.h
-       tmake_file=arm/t-semiaof
+       tmake_file=arm/t-semi
        ;;
 arm*-*-netbsd*)
        tm_file=arm/netbsd.h
@@ -527,7 +573,7 @@ arm*-*-netbsd*)
 arm*-*-linux*)                 # ARM GNU/Linux with ELF
        xmake_file=x-linux
        tm_file="arm/linux-elf.h"
-       tmake_file="t-linux arm/t-linux"
+       tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gnu_ld=yes
        case x${enable_threads} in
@@ -642,7 +688,7 @@ hppa*-*-linux* | parisc*-*-linux*)
        target_cpu_default="MASK_PA_11"
        tm_file="${tm_file} linux.h pa/pa-linux.h \
                 pa/pa32-regs.h pa/pa32-linux.h"
-       tmake_file=pa/t-linux
+       tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gas=yes gnu_ld=yes
        if test x$enable_threads = xyes; then
@@ -866,17 +912,15 @@ i370-*-opened*)                    # IBM 360/370/390 Architecture
        xm_defines='POSIX FATAL_EXIT_CODE=12'
        tm_file=i370/oe.h
        xmake_file=i370/x-oe
-       tmake_file=i370/t-oe
        ;;
 i370-*-mvs*)
        xm_defines='POSIX FATAL_EXIT_CODE=12'
        tm_file=i370/mvs.h
-       tmake_file=i370/t-mvs
        ;;
 i370-*-linux*)
        xmake_file=x-linux
        tm_file="i370/linux.h ${tm_file}"
-       tmake_file="t-linux i370/t-linux"
+       tmake_file="t-slibgcc-elf-ver t-linux"
        # broken_install=yes
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        # extra_parts="crtbegin.o crtend.o"
@@ -982,12 +1026,10 @@ i386-sun-sunos*)         # Sun i386 roadrunner
        ;;
 i[34567]86-wrs-vxworks*)
        tm_file=i386/vxi386.h
-       tmake_file=i386/t-i386bare
        thread_file='vxworks'
        ;;
 i[34567]86-*-aout*)
        tm_file=i386/i386-aout.h
-       tmake_file=i386/t-i386bare
        ;;
 i[34567]86-*-beoself* | i[34567]86-*-beos*)
        xm_defines=POSIX
@@ -997,7 +1039,7 @@ i[34567]86-*-beoself* | i[34567]86-*-beos*)
        extra_parts='crtbegin.o crtend.o'
        ;;
 i[34567]86-*-bsdi* | i[34567]86-*-bsd386*)
-       tm_file=i386/bsd386.h
+       tm_file="i386/386bsd.h i386/bsd386.h"
 #      tmake_file=t-libc-ok
        ;;
 i[34567]86-*-bsd*)
@@ -1007,22 +1049,11 @@ i[34567]86-*-bsd*)
 #      use_collect2=yes
        ;;
 i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12].* | i[34567]86-*-freebsd*aout*)
-       tm_file="i386/freebsd-aout.h i386/perform.h"
+       tm_file=i386/freebsd-aout.h
        tmake_file=t-freebsd
        ;;
 i[34567]86-*-freebsd*)
-       tm_file="i386/i386.h i386/att.h svr4.h freebsd.h i386/freebsd.h i386/perform.h"
-       extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-       tmake_file=t-freebsd
-       gas=yes
-       gnu_ld=yes
-       stabs=yes
-       case x${enable_threads} in
-       xyes | xpthreads | xposix)
-               thread_file='posix'
-               tmake_file="${tmake_file} t-freebsd-thread"
-               ;;
-       esac
+       tm_file="${tm_file} i386/att.h svr4.h ${fbsd_tm_file} i386/freebsd.h"
        ;;
 i[34567]86-*-netbsd*)
        tm_file=i386/netbsd.h
@@ -1035,7 +1066,6 @@ i[34567]86-*-openbsd*)
        ;;
 i[34567]86-*-coff*)
        tm_file=i386/i386-coff.h
-       tmake_file=i386/t-i386bare
        ;;
 i[34567]86-*-isc*)             # 80386 running ISC system
        xm_defines=POSIX
@@ -1049,7 +1079,6 @@ i[34567]86-*-isc*)                # 80386 running ISC system
                tmake_file=i386/t-crtstuff
                extra_parts="crtbegin.o crtend.o"
        fi
-       tmake_file="$tmake_file i386/t-i386bare"
        install_headers_dir=install-headers-cpio
        ;;
 i[34567]86-*-linux*oldld*)     # Intel 80386's running GNU/Linux
@@ -1072,7 +1101,7 @@ i[34567]86-*-linux*libc1) # Intel 80386's running GNU/Linux
                                # GNU/Linux C library 5
        xmake_file=x-linux      
        tm_file="i386/i386.h i386/att.h linux.h i386/linux.h"
-       tmake_file="t-linux t-linux-gnulibc1 i386/t-crtstuff"
+       tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 i386/t-crtstuff"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gnu_ld=yes
        float_format=i386
@@ -1085,7 +1114,7 @@ i[34567]86-*-linux*)      # Intel 80386's running GNU/Linux
                        # aka GNU/Linux C library 6
        xmake_file=x-linux
        tm_file="i386/i386.h i386/att.h linux.h i386/linux.h"
-       tmake_file="t-linux i386/t-crtstuff"
+       tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gnu_ld=yes
        float_format=i386
@@ -1103,7 +1132,6 @@ i[34567]86-go32-msdos | i[34567]86-*-go32*)
 i[34567]86-pc-msdosdjgpp*)
        xm_file=i386/xm-djgpp.h
        tm_file=i386/djgpp.h
-       tmake_file=i386/t-djgpp
        xmake_file=i386/x-djgpp
        gnu_ld=yes
        gas=yes
@@ -1127,7 +1155,6 @@ i[34567]86-*-lynxos*)
        else
                tm_file=i386/lynx-ng.h
        fi
-       tmake_file=i386/t-i386bare
        ;;
 i[34567]86-*-mach*)
        tm_file=i386/mach.h
@@ -1157,7 +1184,7 @@ i[34567]86-go32-rtems*)
 i[34567]86-*-rtemscoff*)
        cpu_type=i386
        tm_file=i386/rtems.h
-       tmake_file="i386/t-i386bare t-rtems"
+       tmake_file=t-rtems
        if test x$enable_threads = xyes; then
          thread_file='rtems'
        fi
@@ -1183,44 +1210,8 @@ i[34567]86-*-sco3.2v5*)  # 80386 running SCO Open Server 5
        else
                tmake_file=i386/t-sco5
        fi
-       tmake_file="$tmake_file i386/t-i386bare"
        extra_parts="crti.o crtbegin.o crtend.o crtbeginS.o crtendS.o"
        ;;
-i[34567]86-*-sco3.2v4*)        # 80386 running SCO 3.2v4 system
-       xm_defines="POSIX BROKEN_LDEXP SMALL_ARG_MAX"
-       xmake_file=i386/x-sco4
-       install_headers_dir=install-headers-cpio
-        if test x$stabs = xyes
-       then
-               tm_file=i386/sco4dbx.h
-               tmake_file=i386/t-svr3dbx
-               extra_parts="svr3.ifile svr3z.rfile"
-       else
-               tm_file=i386/sco4.h
-               tmake_file=i386/t-crtstuff
-               extra_parts="crtbegin.o crtend.o"
-       fi
-       tmake_file="$tmake_file i386/t-i386bare"
-       # The default EAFS filesystem supports long file names.
-       # Truncating the target makes $host != $target which
-       # makes gcc think it is doing a cross-compile.
-       # truncate_target=yes
-       ;;
-i[34567]86-*-sco*)             # 80386 running SCO system
-       install_headers_dir=install-headers-cpio
-        if test x$stabs = xyes
-       then
-               tm_file=i386/scodbx.h
-               tmake_file=i386/t-svr3dbx
-               extra_parts="svr3.ifile svr3z.rfile"
-       else
-               tm_file=i386/sco.h
-               extra_parts="crtbegin.o crtend.o"
-               tmake_file=i386/t-crtstuff
-       fi
-       tmake_file="$tmake_file i386/t-i386bare"
-       truncate_target=yes
-       ;;
 i[34567]86-*-solaris2*)
        xm_defines="POSIX SMALL_ARG_MAX"
        tm_file=i386/sol2.h
@@ -1228,7 +1219,12 @@ i[34567]86-*-solaris2*)
                # Only needed if gas does not support -s
                tm_file="i386/sol2gas.h ${tm_file}"
        fi
-       tmake_file="i386/t-i386bare i386/t-sol2"
+       tmake_file=i386/t-sol2
+       if test x$gnu_ld = xyes; then
+               tmake_file="$tmake_file t-slibgcc-elf-ver"
+       else
+               tmake_file="$tmake_file t-slibgcc-sld"
+       fi
        extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
        xmake_file=x-svr4
        if test x${enable_threads} = x; then
@@ -1252,7 +1248,7 @@ i[34567]86-*-sysv5*)           # Intel x86 on System V Release 5
        then
                tm_file="${tm_file} dbx.h"
        fi
-       tmake_file="i386/t-i386bare i386/t-crtpic"
+       tmake_file=i386/t-crtpic
        xmake_file=x-svr4
        extra_parts="crtbegin.o crtend.o"
        if test x$enable_threads = xyes; then
@@ -1266,14 +1262,14 @@ i[34567]86-*-sysv4*)            # Intel 80386's running system V.4
        then
                tm_file="${tm_file} dbx.h"
        fi
-       tmake_file="i386/t-i386bare i386/t-crtpic"
+       tmake_file=i386/t-crtpic
        xmake_file=x-svr4
        extra_parts="crtbegin.o crtend.o"
        ;;
 i[34567]86-*-udk*)      # Intel x86 on SCO UW/OSR5 Dev Kit
        xm_defines=POSIX
        tm_file=i386/udk.h
-       tmake_file="i386/t-i386bare i386/t-crtpic i386/t-udk"
+       tmake_file="i386/t-crtpic i386/t-udk"
        xmake_file=x-svr4
        extra_parts="crtbegin.o crtend.o"
        install_headers_dir=install-headers-cpio
@@ -1315,7 +1311,6 @@ i[34567]86-*-sysv*)               # Intel 80386's running system V
 i386-*-vsta)                   # Intel 80386's running VSTa kernel
        xm_file=i386/xm-vsta.h
        tm_file=i386/vsta.h
-       tmake_file=i386/t-vsta
        ;;
 i[34567]86-*-win32)
        xm_defines=POSIX
@@ -1489,7 +1484,7 @@ ia64*-*-elf*)
        ;;
 ia64*-*-linux*)
        tm_file=ia64/linux.h
-       tmake_file="t-linux ia64/t-ia64 ia64/t-glibc"
+       tmake_file="t-slibgcc-elf-ver t-linux ia64/t-ia64 ia64/t-glibc"
        target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
        if test x$enable_threads = xyes; then
                thread_file='posix'
@@ -1498,7 +1493,6 @@ ia64*-*-linux*)
        ;;
 ia64*-*-hpux*)
        tm_file="ia64/ia64.h svr4.h ia64/sysv4.h ia64/hpux.h"
-       tmake_file="ia64/t-ia64 ia64/t-hpux"
        target_cpu_default="MASK_GNU_AS"
        if test x$enable_threads = xyes; then
                thread_file='posix'
@@ -1894,7 +1888,7 @@ m68k-*-linux*libc1)               # Motorola m68k's running GNU/Linux
                                # GNU/Linux C library 5
        xmake_file=x-linux
        tm_file=m68k/linux.h
-       tmake_file="t-linux t-linux-gnulibc1 m68k/t-linux"
+       tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 m68k/t-linux"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        extra_headers=math-68881.h
        float_format=m68k
@@ -1905,7 +1899,7 @@ m68k-*-linux*)            # Motorola m68k's running GNU/Linux
                                # aka the GNU/Linux C library 6.
        xmake_file=x-linux
        tm_file=m68k/linux.h
-       tmake_file="t-linux m68k/t-linux"
+       tmake_file="t-slibgcc-elf-ver t-linux m68k/t-linux"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        extra_headers=math-68881.h
        float_format=m68k
@@ -2070,7 +2064,6 @@ mips-sni-sysv4)
                tm_file=mips/sni-svr4.h
        fi
        xm_defines=POSIX
-        tmake_file=mips/t-mips-gas
         if test x$gnu_ld != xyes
         then
                 use_collect2=yes
@@ -2091,7 +2084,6 @@ mips-sgi-irix5*)          # SGI System V.4., IRIX 5
        xm_file=mips/xm-iris5.h
        xmake_file=mips/x-iris
        # mips-tfile doesn't work yet
-       tmake_file=mips/t-mips-gas
        # See comment in mips/iris5.h file.
        use_collect2=yes
 #      if test x$enable_threads = xyes; then
@@ -2106,8 +2098,7 @@ mips-sgi-irix4loser*)             # Mostly like a MIPS.
        xm_defines=POSIX
        xmake_file=mips/x-iris
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                extra_passes="mips-tfile mips-tdump"
        fi
@@ -2127,8 +2118,7 @@ mips-sgi-irix4*)          # Mostly like a MIPS.
        xm_defines=POSIX
        xmake_file=mips/x-iris
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                extra_passes="mips-tfile mips-tdump"
        fi
@@ -2147,8 +2137,7 @@ mips-sgi-*)                       # Mostly like a MIPS.
        fi
        xm_defines=POSIX
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                extra_passes="mips-tfile mips-tdump"
        fi
@@ -2159,7 +2148,6 @@ mips-sgi-*)                       # Mostly like a MIPS.
        ;;
 mips-dec-osfrose*)             # Decstation running OSF/1 reference port with OSF/rose.
        tm_file="mips/osfrose.h ${tm_file}"
-       tmake_file=mips/t-osfrose
        extra_objs=halfpic.o
        use_collect2=yes
        ;;
@@ -2169,8 +2157,7 @@ mips-dec-osf*)                    # Decstation running OSF/1 as shipped by DIGITAL
                tm_file="${tm_file} dbx.h"
        fi
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                tmake_file=mips/t-ultrix
                extra_passes="mips-tfile mips-tdump"
@@ -2183,8 +2170,7 @@ mips-dec-osf*)                    # Decstation running OSF/1 as shipped by DIGITAL
 mips-dec-bsd*)                  # Decstation running 4.4 BSD
       tm_file=mips/dec-bsd.h
       if test x$gas = xyes
-      then
-               tmake_file=mips/t-mips-gas
+      then     :
       else
                tmake_file=mips/t-ultrix
                extra_passes="mips-tfile mips-tdump"
@@ -2205,7 +2191,7 @@ mips*-*-linux*)                           # Linux MIPS, either endian.
               mips*el-*)  tm_file="elfos.h mips/elfl.h mips/linux.h" ;;
               *)         tm_file="elfos.h mips/elf.h mips/linux.h" ;;
        esac
-       tmake_file=t-linux
+       tmake_file="t-slibgcc-elf-ver t-linux"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gnu_ld=yes
        gas=yes
@@ -2226,8 +2212,7 @@ mips-sony-bsd* | mips-sony-newsos*)       # Sony NEWS 3600 or risc/news.
                tm_file="${tm_file} dbx.h"
        fi
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                extra_passes="mips-tfile mips-tdump"
        fi
@@ -2245,8 +2230,7 @@ mips-sony-sysv*)          # Sony NEWS 3800 with NEWSOS5.0.
        fi
        xm_defines=POSIX
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                extra_passes="mips-tfile mips-tdump"
        fi
@@ -2263,10 +2247,8 @@ mips-tandem-sysv4*)              # Tandem S2 running NonStop UX
        xm_defines=POSIX
        if test x$gas = xyes
        then
-               tmake_file=mips/t-mips-gas
                extra_parts="crtbegin.o crtend.o"
        else
-               tmake_file=mips/t-mips
                extra_passes="mips-tfile mips-tdump"
        fi
        if test x$gnu_ld != xyes
@@ -2280,8 +2262,7 @@ mips-*-ultrix* | mips-dec-mach3)  # Decstation.
                tm_file="${tm_file} dbx.h"
        fi
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                tmake_file=mips/t-ultrix
                extra_passes="mips-tfile mips-tdump"
@@ -2402,8 +2383,7 @@ mips-*-riscos[56789]*)            # Default MIPS RISC-OS 5.0.
                tm_file="${tm_file} dbx.h"
        fi
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                extra_passes="mips-tfile mips-tdump"
        fi
@@ -2479,8 +2459,7 @@ mips-*-*)                         # Default MIPS RISC-OS 4.0.
                tm_file="${tm_file} dbx.h"
        fi
        if test x$gas = xyes
-       then
-               tmake_file=mips/t-mips-gas
+       then    :
        else
                extra_passes="mips-tfile mips-tdump"
        fi
@@ -2648,7 +2627,7 @@ powerpc-*-rtems*)
 powerpc-*-linux*libc1)
        tm_file="${tm_file} svr4.h rs6000/sysv4.h rs6000/linux.h"
        out_file=rs6000/rs6000.c
-       tmake_file="rs6000/t-ppcos t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
+       tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
        xmake_file=x-linux
        extra_headers=ppc-asm.h
        if test x$enable_threads = xyes; then
@@ -2658,7 +2637,7 @@ powerpc-*-linux*libc1)
 powerpc-*-linux*)
        tm_file="${tm_file} svr4.h rs6000/sysv4.h rs6000/linux.h"
        out_file=rs6000/rs6000.c
-       tmake_file="rs6000/t-ppcos t-linux rs6000/t-ppccomm"
+       tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
        xmake_file=x-linux
        extra_headers=ppc-asm.h
        if test x$enable_threads = xyes; then
@@ -2760,7 +2739,7 @@ rs6000-bull-bosx)
        use_collect2=yes
        ;;
 rs6000-*-mach*)
-       tm_file=rs6000/mach.h
+       tm_file="rs6000/rs6000.h rs6000/mach.h"
        xm_defines=POSIX
        use_collect2=yes
        ;;
@@ -2832,7 +2811,7 @@ sparc-*-openbsd*)
        use_collect2=yes
        ;;
 sparc-*-bsd*)
-       tm_file=sparc/bsd.h
+       tm_file="${tm_file} sparc/bsd.h"
        ;;
 sparc-*-chorusos*)
        tm_file="sparc/sol2.h sparc/elf.h sparc/chorus.h"
@@ -2860,7 +2839,7 @@ sparc-*-linux*aout*)              # Sparc's running GNU/Linux, a.out
 sparc-*-linux*libc1*)  # Sparc's running GNU/Linux, libc5
        xmake_file=x-linux
        tm_file=sparc/linux.h
-       tmake_file="t-linux t-linux-gnulibc1"
+       tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gnu_ld=yes
        float_format=sparc
@@ -2868,7 +2847,7 @@ sparc-*-linux*libc1*)     # Sparc's running GNU/Linux, libc5
 sparc-*-linux*)                # Sparc's running GNU/Linux, libc6
        xmake_file=x-linux
        tm_file=sparc/linux.h
-       tmake_file="t-linux"
+       tmake_file="t-slibgcc-elf-ver t-linux"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gnu_ld=yes
        if test x$enable_threads = xyes; then
@@ -2912,9 +2891,9 @@ sparcv9-*-solaris2*)
        xm_defines=POSIX
        tmake_file="sparc/t-sol2 sparc/t-sol2-64"
        if test x$gnu_ld = xyes; then
-               tmake_file="$tmake_file sparc/t-slibgcc"
+               tmake_file="$tmake_file t-slibgcc-elf-ver"
        else
-               tmake_file="$tmake_file sparc/t-slibgcc-sld"
+               tmake_file="$tmake_file t-slibgcc-sld"
        fi
        extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o"
        float_format=none
@@ -2937,9 +2916,9 @@ sparc-hal-solaris2*)
         tm_file="sparc/sol2.h sparc/hal.h"
         tmake_file="sparc/t-halos sparc/t-sol2"
        if test x$gnu_ld = xyes; then
-               tmake_file="$tmake_file sparc/t-slibgcc"
+               tmake_file="$tmake_file t-slibgcc-elf-ver"
        else
-               tmake_file="$tmake_file sparc/t-slibgcc-sld"
+               tmake_file="$tmake_file t-slibgcc-sld"
        fi
         extra_parts="crt1.o crti.o crtn.o gmon.o crtbegin.o crtend.o"
         case $machine in
@@ -2962,24 +2941,23 @@ sparc-*-solaris2*)
        xm_defines=POSIX
        tmake_file=sparc/t-sol2
        if test x$gnu_ld = xyes; then
-               tmake_file="$tmake_file sparc/t-slibgcc"
+               tmake_file="$tmake_file t-slibgcc-elf-ver"
        else
-               tmake_file="$tmake_file sparc/t-slibgcc-sld"
+               tmake_file="$tmake_file t-slibgcc-sld"
        fi
        extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
-# At the moment, 32-to-64 cross compilation doesn't work.
-#      case $machine in
-#      *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) ;;
-#      *-*-solaris2*)
-#              if test x$gnu_ld = xyes
-#              then
-#                      tm_file=sparc/sol2-64.h
-#              else
-#                      tm_file=sparc/sol2-sld-64.h
-#              fi
-#              tmake_file="$tmake_file sparc/t-sol2-64"
-#              ;;
-#      esac
+       case $machine in
+       *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) ;;
+       *-*-solaris2*)
+               if test x$gnu_ld = xyes
+               then
+                       tm_file=sparc/sol2-64.h
+               else
+                       tm_file=sparc/sol2-sld-64.h
+               fi
+               tmake_file="$tmake_file sparc/t-sol2-64"
+               ;;
+       esac
        case $machine in
        *-*-solaris2.[0-4])
                float_format=i128
@@ -3004,7 +2982,6 @@ sparc-*-solaris2*)
        ;;
 sparc-*-sunos4.0*)
        tm_file=sparc/sunos4.h
-       tmake_file=sparc/t-sunos40
        use_collect2=yes
        ;;
 sparc-*-sunos4*)
@@ -3057,16 +3034,14 @@ sparc86x-*-elf*)
         extra_parts="crtbegin.o crtend.o"
        ;;
 sparc64-*-aout*)
-       tmake_file=sparc/t-sp64
        tm_file=sparc/sp64-aout.h
        ;;
 sparc64-*-elf*)
-       tmake_file=sparc/t-sp64
        tm_file=sparc/sp64-elf.h
        extra_parts="crtbegin.o crtend.o"
        ;;
 sparc64-*-linux*)              # 64-bit Sparc's running GNU/Linux
-       tmake_file="t-linux sparc/t-linux64"
+       tmake_file="t-slibgcc-elf-ver t-linux sparc/t-linux64"
        tm_file=sparc/linux64.h
        xmake_file=x-linux
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
@@ -3142,7 +3117,6 @@ vax-*-netbsd*)
        use_collect2=yes
        ;;
 vax-*-openbsd*)
-       tmake_file="${tmake_file} vax/t-openbsd"
        tm_file="vax/vax.h vax/openbsd1.h openbsd.h ${tm_file}"
        float_format=vax
        use_collect2=yes
@@ -3206,7 +3180,14 @@ i586-*-*)
        esac
        ;;
 i686-*-* | i786-*-*)
-       target_cpu_default2=3
+       case $target_alias in
+               athlon-*)
+                       target_cpu_default2=5
+                       ;;
+               *)
+                       target_cpu_default2=3
+                       ;;
+       esac
        ;;
 alpha*-*-*)
        case $machine in