t-crtstuff: New target makefile fragment.
[gcc.git] / gcc / config.gcc
index 03958123c1beb78b3d35ac3ebf03e1854e15df77..f2a6b168f73bcf053ae7b803049f2eab649680b8 100644 (file)
@@ -367,6 +367,16 @@ case $machine in
        case x${enable_threads} in
        xyes | xposix)
                thread_file='posix'
+               tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
+               ;;
+       esac
+
+       # NetBSD 1.7 and later are set up to use GCC's crtstuff for
+       # ELF configurations.  We will clear extra_parts in the
+       # a.out configurations.
+       case $machine in
+       *-*-netbsd*1.[7-9]* | *-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
+               extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
                ;;
        esac
        ;;
@@ -616,11 +626,13 @@ arm*-*-freebsd*|strongarm*-*-freebsd*)
        tmake_file="${tmake_file} arm/t-strongarm-elf"
        ;;
 arm*-*-netbsdelf*)
-       echo "GCC does not yet support the ${machine} target"; exit 1
+       tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h arm/arm.h arm/netbsd-elf.h"
+       tmake_file="${tmake_file} arm/t-netbsd"
        ;;
 arm*-*-netbsd*)
        tm_file="arm/aout.h arm/arm.h netbsd.h netbsd-aout.h arm/netbsd.h"
        tmake_file="t-netbsd arm/t-netbsd"
+       extra_parts=""
        use_collect2=yes
        ;;
 arm*-*-linux*)                 # ARM GNU/Linux with ELF
@@ -732,8 +744,8 @@ h8300-*-*)
        ;;
 hppa*64*-*-linux* | parisc*64*-*-linux*)
        target_cpu_default="(MASK_PA_11 | MASK_PA_20)"
-       tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h svr4.h linux.h pa/pa-linux.h \
-                pa/pa64-regs.h pa/pa-64.h pa/pa64-linux.h"
+       tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h svr4.h linux.h \
+                pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h pa/pa64-linux.h"
        tmake_file=pa/t-linux64
        gas=yes gnu_ld=yes
        ;;
@@ -866,7 +878,16 @@ hppa1.0-*-hpux10*)
        ;;
 hppa*64*-*-hpux11*)
        xm_defines=POSIX
-       tm_file="pa/pa64-start.h ${tm_file} pa/pa64-regs.h pa/long_double.h pa/elf.h pa/pa-hpux.h pa/pa-hpux11.h pa/pa-64.h pa/pa64-hpux.h"
+       if test x$gas = xyes
+       then
+               tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h  \
+                        pa/pa64-regs.h pa/long_double.h pa/pa-hpux.h \
+                        pa/pa-hpux11.h pa/pa-64.h pa/pa64-hpux.h"
+       else
+               tm_file="pa/pa64-start.h ${tm_file} dbxelf.h pa/elf.h \
+                        pa/pa64-regs.h pa/long_double.h pa/pa-hpux.h \
+                        pa/pa-hpux11.h pa/pa-64.h pa/pa64-hpux.h"
+       fi
        tmake_file="pa/t-pa64 pa/t-pa-hpux"
        xmake_file="pa/x-ada"
        target_cpu_default="(MASK_PA_11|MASK_PA_20|MASK_GAS)"
@@ -984,12 +1005,12 @@ i370-*-linux*)
 i[34567]86-*-darwin*)
        tm_file="${tm_file} darwin.h i386/darwin.h"
        tm_p_file="${tm_p_file} darwin-protos.h"
-       tmake_file=i386/t-darwin
+       tmake_file="t-darwin"
        extra_objs="darwin.o"
        target_gtfiles="\$(srcdir)/config/darwin.c"
        c_target_objs="darwin-c.o"
        cxx_target_objs="darwin-c.o"
-       extra_parts="crtbegin.o crtend.o"
+       extra_parts="crt2.o"
        # Darwin linker does collect2 functionality
        use_collect2=no
        ;;
@@ -1057,6 +1078,7 @@ i[34567]86-*-netbsdelf*)
 i[34567]86-*-netbsd*)
        tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h"
        tmake_file=t-netbsd
+       extra_parts=""
        use_collect2=yes
        ;;
 x86_64-*-netbsd*)
@@ -1102,7 +1124,7 @@ i[34567]86-*-linux*)      # Intel 80386's running GNU/Linux
 x86_64-*-linux*)
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h \
                 i386/x86-64.h i386/linux64.h"
-       tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff i386/t-linux64"
+       tmake_file="t-slibgcc-elf-ver t-linux i386/t-linux64"
        ;;
 i[34567]86-*-gnu*)
        ;;
@@ -1620,6 +1642,7 @@ m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
 m68k*-*-netbsd*)
        tm_file=m68k/netbsd.h
        tmake_file=t-netbsd
+       extra_parts=""
        use_collect2=yes
        ;;
 m68k*-*-openbsd*)
@@ -1859,7 +1882,7 @@ mips64-*-elf* | mips64el-*-elf*)
        ;;
 mips64vr-*-elf* | mips64vrel-*-elf*)
         tm_file="mips/vr.h ${tm_file} mips/elf64.h"
-        tm_defines="MIPS_ABI_DEFAULT=ABI_O64"
+        tm_defines="MIPS_ABI_DEFAULT=ABI_O64 MIPS_MARCH_CONTROLS_SOFT_FLOAT=1"
         tmake_file=mips/t-vr
         ;;
 mips64orion-*-elf* | mips64orionel-*-elf*)
@@ -1917,6 +1940,7 @@ ns32k-*-netbsd*)
        tm_file="${tm_file} netbsd.h netbsd-aout.h ns32k/netbsd.h"
        # On NetBSD, the headers are already okay, except for math.h.
        tmake_file="t-netbsd ns32k/t-ns32k"
+       extra_parts=""
        use_collect2=yes
        ;;
 pdp11-*-bsd)
@@ -1955,12 +1979,12 @@ powerpc-*-beos*)
 powerpc-*-darwin*)
        tm_file="${tm_file} darwin.h rs6000/darwin.h"
        tm_p_file="${tm_p_file} darwin-protos.h"
-       tmake_file=rs6000/t-darwin
+       tmake_file="rs6000/t-rs6000 t-darwin rs6000/t-darwin"
        extra_objs="darwin.o"
        target_gtfiles="\$(srcdir)/config/darwin.c"
        c_target_objs="darwin-c.o"
        cxx_target_objs="darwin-c.o"
-       extra_parts="crtbegin.o crtend.o"
+       extra_parts="crt2.o"
        # Darwin linker does collect2 functionality
        use_collect2=no
        extra_headers=altivec.h
@@ -1977,8 +2001,8 @@ powerpc-*-sysv*)
        tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
        ;;
 powerpc-*-netbsd*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
-       tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
+       tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
+       tmake_file="${tmake_file} rs6000/t-netbsd"
        ;;
 powerpc-*-chorusos*)
        xm_defines=POSIX
@@ -2132,7 +2156,7 @@ rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
        thread_file='aix'
        extra_headers=
        ;;
-rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
+rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
        xm_defines=POSIX
        tm_file="${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h"
        tmake_file=rs6000/t-aix43
@@ -2140,6 +2164,14 @@ rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
        thread_file='aix'
        extra_headers=
        ;;
+rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
+       xm_defines=POSIX
+       tm_file="${tm_file} rs6000/aix.h rs6000/aix52.h rs6000/xcoff.h"
+       tmake_file=rs6000/t-aix52
+       use_collect2=yes
+       thread_file='aix'
+       extra_headers=
+       ;;
 rs6000-ibm-aix*)
        xm_defines=POSIX
        tm_file="${tm_file} rs6000/aix.h rs6000/xcoff.h"
@@ -2162,7 +2194,7 @@ rs6000-*-lynxos*)
        ;;
 s390-*-linux*)
        tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h"
-       tmake_file="t-slibgcc-elf-ver t-linux s390/t-linux"
+       tmake_file="t-slibgcc-elf-ver t-linux s390/t-crtstuff"
        ;;
 s390x-*-linux*)
        tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h"
@@ -2170,7 +2202,7 @@ s390x-*-linux*)
        md_file=s390/s390.md
        extra_modes=s390/s390-modes.def
        out_file=s390/s390.c
-       tmake_file="t-slibgcc-elf-ver t-linux s390/t-linux s390/t-linux64"
+       tmake_file="t-slibgcc-elf-ver t-linux s390/t-crtstuff s390/t-linux64"
        ;;
 sh-*-elf* | sh[2346l]*-*-elf*)
        tmake_file="sh/t-sh sh/t-elf"
@@ -2301,6 +2333,7 @@ sparc-*-netbsdelf*)
 sparc-*-netbsd*)
        tm_file="${tm_file} sparc/aout.h netbsd.h netbsd-aout.h sparc/netbsd.h"
        tmake_file=t-netbsd
+       extra_parts=""
        use_collect2=yes
        ;;
 sparc-*-openbsd*)
@@ -2619,6 +2652,7 @@ vax-*-netbsdelf*)
 vax-*-netbsd*)
        tm_file="${tm_file} netbsd.h netbsd-aout.h vax/netbsd.h"
        tmake_file=t-netbsd
+       extra_parts=""
        use_collect2=yes
        ;;
 vax-*-openbsd*)
@@ -2832,6 +2866,11 @@ mips*-*-*)
                        tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
                        ;;
        esac
+       case $tm_file in
+               *mips/elf.h* | *mips/elf64.h*)
+                       tm_defines="OBJECT_FORMAT_ELF $tm_defines"
+                       ;;
+       esac
        if test "x$enable_gofast" = xyes
        then
                tm_defines="INIT_SUBTARGET_OPTABS=INIT_GOFAST_OPTABS $tm_defines"