re PR c/48088 (-Werror=frame-larger-than=100 does not work as expected)
[gcc.git] / gcc / config.gcc
index 23657a5b0f42f5d20f3815ca49003c534d99a4e2..882e4134b4c883a5fe0f19996e54ac63769bada1 100644 (file)
@@ -1,5 +1,5 @@
 # GCC target-specific configuration file.
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2015 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
 #  gas                 Set to yes or no depending on whether the target
 #                      system normally uses GNU as.
 #
-#  need_64bit_hwint    Set to yes if HOST_WIDE_INT must be 64 bits wide
-#                      for this target.  This is true if this target
-#                      supports "long" or "wchar_t" wider than 32 bits,
-#                      or BITS_PER_WORD is wider than 32 bits.
-#                      The setting made here must match the one made in
-#                      other locations such as libcpp/configure.ac
-#
 #  configure_default_options
 #                      Set to an initializer for configure_default_options
 #                      in configargs.h, based on --with-cpu et cetera.
@@ -233,7 +226,6 @@ gnu_ld="$gnu_ld_flag"
 default_use_cxa_atexit=no
 default_gnu_indirect_function=no
 target_gtfiles=
-need_64bit_hwint=
 need_64bit_isa=
 native_system_header_dir=/usr/include
 target_type_format_char='@'
@@ -244,9 +236,8 @@ md_file=
 
 # Obsolete configurations.
 case ${target} in
-   picochip-*                          \
- | score-*                             \
- | *-*-solaris2.9*                     \
+# Currently there are no obsolete targets.
+ nothing                               \
  )
     if test "x$enable_obsolete" != xyes; then
       echo "*** Configuration ${target} is obsolete." >&2
@@ -268,7 +259,6 @@ case ${target} in
    arm*-wince-pe*                      \
  | arm*-*-ecos-elf                     \
  | arm*-*-elf                          \
- | arm*-*-freebsd*                     \
  | arm*-*-linux*                       \
  | arm*-*-uclinux*                     \
  | i[34567]86-go32-*                   \
@@ -287,8 +277,8 @@ case ${target} in
  | *-*-rtemsaout*                      \
  | *-*-rtemscoff*                      \
  | *-*-solaris2                                \
- | *-*-solaris2.[0-8]                  \
- | *-*-solaris2.[0-8].*                        \
+ | *-*-solaris2.[0-9]                  \
+ | *-*-solaris2.[0-9].*                        \
  | *-*-sysv*                           \
  | vax-*-vms*                          \
  )
@@ -311,14 +301,15 @@ m32c*-*-*)
         ;;
 aarch64*-*-*)
        cpu_type=aarch64
-       need_64bit_hwint=yes
-       extra_headers="arm_neon.h"
-       extra_objs="aarch64-builtins.o aarch-common.o"
+       extra_headers="arm_neon.h arm_acle.h"
+       c_target_objs="aarch64-c.o"
+       cxx_target_objs="aarch64-c.o"
+       extra_objs="aarch64-builtins.o aarch-common.o cortex-a57-fma-steering.o"
+       target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.c"
        target_has_targetm_common=yes
        ;;
 alpha*-*-*)
        cpu_type=alpha
-       need_64bit_hwint=yes
        extra_options="${extra_options} g.opt"
        ;;
 am33_2.0-*-linux*)
@@ -329,19 +320,18 @@ arc*-*-*)
        ;;
 arm*-*-*)
        cpu_type=arm
-       extra_objs="aarch-common.o"
+       extra_objs="arm-builtins.o aarch-common.o"
        extra_headers="mmintrin.h arm_neon.h arm_acle.h"
        target_type_format_char='%'
        c_target_objs="arm-c.o"
        cxx_target_objs="arm-c.o"
-       need_64bit_hwint=yes
        extra_options="${extra_options} arm/arm-tables.opt"
+       target_gtfiles="\$(srcdir)/config/arm/arm-builtins.c"
        ;;
 avr-*-*)
        cpu_type=avr
        c_target_objs="avr-c.o"
        cxx_target_objs="avr-c.o"
-       extra_options="${extra_options} avr/avr-tables.opt"
        ;;
 bfin*-*)
        cpu_type=bfin
@@ -352,6 +342,9 @@ crisv32-*)
 frv*)  cpu_type=frv
        extra_options="${extra_options} g.opt"
        ;;
+ft32*) cpu_type=ft32
+       target_has_targetm_common=no
+       ;;
 moxie*)        cpu_type=moxie
        target_has_targetm_common=no
        ;;
@@ -364,7 +357,6 @@ i[34567]86-*-*)
        cpu_type=i386
        c_target_objs="i386-c.o"
        cxx_target_objs="i386-c.o"
-       need_64bit_hwint=yes
        extra_options="${extra_options} fused-madd.opt"
        extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
                       pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
@@ -376,7 +368,11 @@ i[34567]86-*-*)
                       rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
                       adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
                       avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
-                      shaintrin.h"
+                      shaintrin.h clflushoptintrin.h xsavecintrin.h
+                      xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
+                      avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
+                      avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
+                      avx512vbmivlintrin.h clwbintrin.h pcommitintrin.h mwaitxintrin.h clzerointrin.h"
        ;;
 x86_64-*-*)
        cpu_type=i386
@@ -393,12 +389,14 @@ x86_64-*-*)
                       rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
                       adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
                       avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
-                      shaintrin.h"
-       need_64bit_hwint=yes
+                      shaintrin.h clflushoptintrin.h xsavecintrin.h
+                      xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
+                      avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
+                      avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
+                      avx512vbmivlintrin.h clwbintrin.h pcommitintrin.h mwaitxintrin.h clzerointrin.h"
        ;;
 ia64-*-*)
        extra_headers=ia64intrin.h
-       need_64bit_hwint=yes
        extra_options="${extra_options} g.opt fused-madd.opt"
        ;;
 hppa*-*-*)
@@ -421,61 +419,52 @@ microblaze*-*-*)
         ;;
 mips*-*-*)
        cpu_type=mips
-       need_64bit_hwint=yes
        extra_headers="loongson.h"
-       extra_options="${extra_options} g.opt mips/mips-tables.opt"
+       extra_objs="frame-header-opt.o"
+       extra_options="${extra_options} g.opt fused-madd.opt mips/mips-tables.opt"
        ;;
 nds32*)
        cpu_type=nds32
        extra_headers="nds32_intrinsic.h"
+       extra_objs="nds32-cost.o nds32-intrinsic.o nds32-isr.o nds32-md-auxiliary.o nds32-pipelines-auxiliary.o nds32-predicates.o nds32-memory-manipulation.o nds32-fp-as-gp.o"
        ;;
 nios2-*-*)
        cpu_type=nios2
        extra_options="${extra_options} g.opt"
-       ;;      
-picochip-*-*)
-        cpu_type=picochip
-        ;;
+       ;;
+nvptx-*-*)
+       cpu_type=nvptx
+       ;;
 powerpc*-*-*)
        cpu_type=rs6000
        extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
-       need_64bit_hwint=yes
        case x$with_cpu in
-           xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500)
+           xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456789]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
                cpu_is_64bit=yes
                ;;
        esac
        extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
        ;;
 rs6000*-*-*)
-       need_64bit_hwint=yes
        extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
        ;;
-score*-*-*)
-       cpu_type=score
-       extra_options="${extra_options} g.opt"
-       ;;
 sparc*-*-*)
        cpu_type=sparc
        c_target_objs="sparc-c.o"
        cxx_target_objs="sparc-c.o"
        extra_headers="visintrin.h"
-       need_64bit_hwint=yes
        ;;
 spu*-*-*)
        cpu_type=spu
-       need_64bit_hwint=yes
        ;;
 s390*-*-*)
        cpu_type=s390
-       need_64bit_hwint=yes
        extra_options="${extra_options} fused-madd.opt"
-       extra_headers="s390intrin.h htmintrin.h htmxlintrin.h"
+       extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
        ;;
 # Note the 'l'; we need to be able to match e.g. "shle" or "shl".
 sh[123456789lbe]*-*-* | sh-*-*)
        cpu_type=sh
-       need_64bit_hwint=yes
        extra_options="${extra_options} fused-madd.opt"
        extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
        ;;
@@ -492,11 +481,9 @@ xtensa*-*-*)
        ;;
 tilegx*-*-*)
        cpu_type=tilegx
-       need_64bit_hwint=yes
        ;;
-tilepro-*-*)
+tilepro*-*-*)
        cpu_type=tilepro
-       need_64bit_hwint=yes
        ;;
 esac
 
@@ -594,7 +581,26 @@ case ${target} in
 esac
 
 # Common C libraries.
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
+
+# 32-bit x86 processors supported by --with-arch=.  Each processor
+# MUST be separated by exactly one space.
+x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \
+athlon-xp k6 k6-2 k6-3 geode c3 c3-2 winchip-c6 winchip2 i386 i486 \
+i586 i686 pentium pentium-m pentium-mmx pentium2 pentium3 pentium3m \
+pentium4 pentium4m pentiumpro prescott lakemont"
+
+# 64-bit x86 processors supported by --with-arch=.  Each processor
+# MUST be separated by exactly one space.
+x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \
+bdver3 bdver4 znver1 btver1 btver2 k8 k8-sse3 opteron opteron-sse3 nocona \
+core2 corei7 corei7-avx core-avx-i core-avx2 atom slm nehalem westmere \
+sandybridge ivybridge haswell broadwell bonnell silvermont knl \
+skylake-avx512 x86-64 native"
+
+# Additional x86 processors supported by --with-cpu=.  Each processor
+# MUST be separated by exactly one space.
+x86_cpus="generic intel"
 
 # Common parts for widely ported systems.
 case ${target} in
@@ -605,9 +611,12 @@ case ${target} in
   *-*-darwin9*)
     tm_file="${tm_file} darwin9.h"
     ;;
-  *-*-darwin[12][0-9]*)
+  *-*-darwin[1][01]*)
     tm_file="${tm_file} darwin9.h darwin10.h"
     ;;
+  *-*-darwin[1][2-9]* | *-*-darwin[2][0-9]*)
+    tm_file="${tm_file} darwin9.h darwin10.h darwin12.h"
+    ;;
   esac
   tm_file="${tm_file} ${cpu_type}/darwin.h"
   tm_p_file="${tm_p_file} darwin-protos.h"
@@ -625,6 +634,26 @@ case ${target} in
     "" | yes | posix) thread_file='posix' ;;
   esac
   ;;
+*-*-dragonfly*)
+  gas=yes
+  gnu_ld=yes
+  tmake_file="t-slibgcc"
+  case ${enable_threads} in
+    "" | yes | posix)
+      thread_file='posix'
+      ;;
+    no | single)
+      # Let these non-posix thread selections fall through if requested
+      ;;
+    *)
+      echo 'Unknown thread configuration for DragonFly BSD'
+      exit 1
+      ;;
+  esac
+  extra_options="$extra_options rpath.opt dragonfly.opt"
+  default_use_cxa_atexit=yes
+  use_gcc_stdint=wrap
+  ;;
 *-*-freebsd*)
   # This is the generic ELF configuration of FreeBSD.  Later
   # machine-specific sections may refine and add to this
@@ -644,6 +673,11 @@ case ${target} in
   gas=yes
   gnu_ld=yes
   fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
+  if test "$fbsd_major" = ""; then
+    echo "Specify the major version number of the targeted FreeBSD release"
+    echo "like this: --target=amd64-unknown-freebsd10.1"
+    exit 1
+  fi
   tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
   tmake_file="t-slibgcc"
   case ${enable_threads} in
@@ -666,7 +700,6 @@ case ${target} in
     *)
       default_use_cxa_atexit=yes;;
   esac
-  # need_64bit_hwint=yes # system compiler has this for all arch!
   use_gcc_stdint=wrap
   ;;
 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
@@ -701,6 +734,9 @@ case ${target} in
     *-*-*uclibc*)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
       ;;
+    *-*-*musl*)
+      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
+      ;;
     *)
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
       ;;
@@ -773,8 +809,15 @@ case ${target} in
   ;;
 *-*-rtems*)
   case ${enable_threads} in
-    yes) thread_file='rtems' ;;
+    "" | yes | rtems) thread_file='rtems' ;;
+    posix) thread_file='posix' ;;
+    no) ;;
+    *)
+      echo 'Unknown thread configuration for RTEMS'
+      exit 1
+      ;;
   esac
+  tmake_file="${tmake_file} t-rtems"
   extra_options="${extra_options} rtems.opt"
   default_use_cxa_atexit=yes
   use_gcc_stdint=wrap
@@ -790,16 +833,16 @@ case ${target} in
 *-*-solaris2*)
   # i?86-*-solaris2* needs to insert headers between cpu default and
   # Solaris 2 specific ones.
-  sol2_tm_file="dbxelf.h elfos.h ${cpu_type}/sysv4.h sol2.h ${cpu_type}/sol2.h"
+  sol2_tm_file_head="dbxelf.h elfos.h ${cpu_type}/sysv4.h"
+  sol2_tm_file_tail="${cpu_type}/sol2.h sol2.h"
+  sol2_tm_file="${sol2_tm_file_head} ${sol2_tm_file_tail}"
   case ${target} in
-    *-*-solaris2.1[0-9]*)
-      sol2_tm_file="${sol2_tm_file} sol2-10.h"
-      use_gcc_stdint=wrap
-      ;;
-    *)
-      use_gcc_stdint=provide
+    *-*-solaris2.1[2-9]*)
+      # __cxa_atexit was introduced in Solaris 12.
+      default_use_cxa_atexit=yes
       ;;
   esac
+  use_gcc_stdint=wrap
   if test x$gnu_ld = xyes; then
     tm_file="usegld.h ${tm_file}"
   fi
@@ -988,6 +1031,27 @@ arm-wrs-vxworks)
        extra_options="${extra_options} arm/vxworks.opt"
        tmake_file="${tmake_file} arm/t-arm arm/t-vxworks"
        ;;
+arm*-*-freebsd*)                # ARM FreeBSD EABI
+       tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h"
+       case $target in
+       arm*b-*-freebsd*)
+           tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+           ;;
+       esac
+       tmake_file="${tmake_file} arm/t-arm arm/t-bpabi"
+       tm_file="${tm_file} arm/bpabi.h arm/freebsd.h arm/aout.h arm/arm.h"
+       case $target in
+       armv6*-*-freebsd*)
+           tm_defines="${tm_defines} TARGET_FREEBSD_ARMv6=1"
+           ;;
+       esac
+       case $target in
+       arm*hf-*-freebsd*)
+           tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
+           ;;
+       esac
+       with_tls=${with_tls:-gnu}
+       ;;
 arm*-*-netbsdelf*)
        tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
@@ -1002,7 +1066,7 @@ arm*-*-linux-*)                   # ARM GNU/Linux with ELF
            ;;
        esac
        tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
-       tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h"
+       tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h vxworks-dummy.h arm/arm.h"
        # Define multilib configuration for arm-linux-androideabi.
        case ${target} in
        *-androideabi)
@@ -1015,7 +1079,7 @@ arm*-*-linux-*)                   # ARM GNU/Linux with ELF
        ;;
 arm*-*-uclinux*eabi*)          # ARM ucLinux
        tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
-       tmake_file="arm/t-arm arm/t-arm-elf arm/t-bpabi"
+       tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi"
        tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h arm/aout.h vxworks-dummy.h arm/arm.h"
        # The EABI requires the use of __cxa_atexit.
        default_use_cxa_atexit=yes
@@ -1027,7 +1091,7 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*)
        esac
        default_use_cxa_atexit=yes
        tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
-       tmake_file="arm/t-arm arm/t-arm-elf"
+       tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf"
        case ${target} in
        arm*-*-eabi*)
          tm_file="$tm_file newlib-stdint.h"
@@ -1035,8 +1099,8 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*)
          use_gcc_stdint=wrap
          ;;
        arm*-*-rtems*)
-         tm_file="${tm_file} rtems.h arm/rtems-eabi.h newlib-stdint.h"
-         tmake_file="${tmake_file} arm/t-bpabi t-rtems arm/t-rtems-eabi"
+         tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h"
+         tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems"
          ;;
        arm*-*-symbianelf*)
          tm_file="${tm_file} arm/symbian.h"
@@ -1048,13 +1112,14 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*)
        tm_file="${tm_file} arm/aout.h vxworks-dummy.h arm/arm.h"
        ;;
 avr-*-rtems*)
-       tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h dbxelf.h avr/rtems.h rtems.h newlib-stdint.h"
-       tmake_file="avr/t-avr avr/t-multilib t-rtems avr/t-rtems"
+       tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h avr/specs.h dbxelf.h avr/rtems.h rtems.h newlib-stdint.h"
+       tm_defines="${tm_defines} WITH_RTEMS"
+       tmake_file="${tmake_file} avr/t-avr avr/t-multilib avr/t-rtems"
        extra_gcc_objs="driver-avr.o avr-devices.o"
        extra_objs="avr-devices.o avr-log.o"
        ;;
 avr-*-*)
-       tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h dbxelf.h avr/avr-stdint.h"
+       tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h avr/specs.h dbxelf.h avr/avr-stdint.h"
        if test x${with_avrlibc} != xno; then
            tm_file="${tm_file} ${cpu_type}/avrlibc.h"
            tm_defines="${tm_defines} WITH_AVRLIBC"
@@ -1076,12 +1141,12 @@ bfin*-uclinux*)
        ;;
 bfin*-linux-uclibc*)
        tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
-       tmake_file="bfin/t-bfin-linux t-slibgcc t-linux"
+       tmake_file="${tmake_file} bfin/t-bfin-linux"
        use_collect2=no
        ;;
 bfin*-rtems*)
        tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h newlib-stdint.h"
-       tmake_file="t-rtems bfin/t-rtems"
+       tmake_file="${tmake_file} bfin/t-rtems"
        ;;
 bfin*-*)
        tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
@@ -1110,8 +1175,7 @@ cris-*-elf | cris-*-none)
        ;;
 crisv32-*-linux* | cris-*-linux*)
        tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h cris/linux.h"
-       # We need to avoid using t-linux, so override default tmake_file
-       tmake_file="cris/t-cris cris/t-linux t-slibgcc t-linux"
+       tmake_file="${tmake_file} cris/t-cris cris/t-linux"
        extra_options="${extra_options} cris/linux.opt"
        case $target in
          cris-*-*)
@@ -1142,6 +1206,12 @@ frv-*-*linux*)
                 gnu-user.h linux.h glibc-stdint.h frv/linux.h"
        tmake_file="${tmake_file} frv/t-frv frv/t-linux"
        ;;
+ft32-*-elf)
+       gas=yes
+       gnu_ld=yes
+       tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+       tmake_file="${tmake_file} ft32/t-ft32"
+       ;;
 moxie-*-elf)
        gas=yes
        gnu_ld=yes
@@ -1155,24 +1225,33 @@ moxie-*-uclinux*)
        tmake_file="${tmake_file} moxie/t-moxie"
        ;;
 moxie-*-rtems*)
-       tmake_file="${tmake_file} moxie/t-moxie t-rtems"
+       tmake_file="${tmake_file} moxie/t-moxie"
        tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
        ;;
+moxie-*-moxiebox*)
+       gas=yes
+       gnu_ld=yes
+       tm_file="${tm_file} dbxelf.h elfos.h moxie/moxiebox.h newlib-stdint.h"
+       tmake_file="${tmake_file} moxie/t-moxiebox"
+       ;;
 h8300-*-rtems*)
-       tmake_file="h8300/t-h8300 t-rtems h8300/t-rtems"
+       tmake_file="${tmake_file} h8300/t-h8300 h8300/t-rtems"
        tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h h8300/rtems.h rtems.h newlib-stdint.h"
        ;;
 h8300-*-elf*)
        tmake_file="h8300/t-h8300"
        tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
        ;;
+h8300-*-linux*)
+       tmake_file="${tmake_file} h8300/t-h8300 h8300/t-linux"
+       tm_file="h8300/h8300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h h8300/linux.h"
+       ;;
 hppa*64*-*-linux*)
        target_cpu_default="MASK_PA_11|MASK_PA_20"
        tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
                 glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
                 pa/pa64-linux.h"
        gas=yes gnu_ld=yes
-       need_64bit_hwint=yes
        ;;
 hppa*-*-linux*)
        target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
@@ -1247,7 +1326,6 @@ hppa*64*-*-hpux11*)
        esac
        extra_options="${extra_options} pa/pa-hpux.opt \
                       pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
-       need_64bit_hwint=yes
        tmake_file="t-slibgcc"
        case x${enable_threads} in
        x | xyes | xposix )
@@ -1320,6 +1398,9 @@ x86_64-*-darwin*)
        tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
        tm_file="${tm_file} ${cpu_type}/darwin64.h"
        ;;
+i[34567]86-*-elfiamcu)
+       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
+       ;;
 i[34567]86-*-elf*)
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
        ;;
@@ -1333,6 +1414,14 @@ x86_64-*-rdos*)
     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h i386/rdos64.h"
     tmake_file="i386/t-i386elf t-svr4"
     ;;
+i[34567]86-*-dragonfly*)
+       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
+       tmake_file="${tmake_file} i386/t-crtstuff"
+       ;;
+x86_64-*-dragonfly*)
+       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h"
+       tmake_file="${tmake_file} i386/t-crtstuff"
+       ;;
 i[34567]86-*-freebsd*)
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
        ;;
@@ -1377,8 +1466,14 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
        i[34567]86-*-linux*)
                tm_file="${tm_file} linux.h linux-android.h"
                extra_options="${extra_options} linux-android.opt"
-               # Assume modern glibc
-               default_gnu_indirect_function=yes
+               # Assume modern glibc if not targeting Android nor uclibc.
+               case ${target} in
+               *-*-*android*|*-*-*uclibc*)
+                 ;;
+               *)
+                 default_gnu_indirect_function=yes
+                 ;;
+               esac
                if test x$enable_targets = xall; then
                        tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux-common.h i386/linux64.h"
                        tm_defines="${tm_defines} TARGET_BI_ARCH=1"
@@ -1400,20 +1495,21 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
                        done
                        TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
                        need_64bit_isa=yes
-                       case X"${with_cpu}" in
-                       Xgeneric|Xintel|Xatom|Xslm|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver4|Xbdver3|Xbdver2|Xbdver1|Xbtver2|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)                     
-                               ;;
-                       X)
+                       if test x$with_cpu = x; then
                                if test x$with_cpu_64 = x; then
                                        with_cpu_64=generic
                                fi
-                               ;;
-                       *)
-                               echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
-                               echo "generic intel atom slm core2 corei7 corei7-avx nocona x86-64 bdver4 bdver3 bdver2 bdver1 btver2 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
-                               exit 1
-                               ;;
-                       esac
+                       else
+                               case " $x86_cpus $x86_archs $x86_64_archs " in
+                               *" $with_cpu "*)
+                                       ;;
+                               *)
+                                       echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
+                                       echo "$x86_cpus $x86_archs $x86_64_archs " 1>&2
+                                       exit 1
+                                       ;;
+                               esac
+                       fi
                else
                        tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux-common.h i386/linux.h"
                fi
@@ -1439,14 +1535,20 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
        x86_64-*-linux*)
                tm_file="${tm_file} linux.h linux-android.h i386/linux-common.h i386/linux64.h"
                extra_options="${extra_options} linux-android.opt"
-               # Assume modern glibc
-               default_gnu_indirect_function=yes
+               # Assume modern glibc if not targeting Android nor uclibc.
+               case ${target} in
+               *-*-*android*|*-*-*uclibc*)
+                 ;;
+               *)
+                 default_gnu_indirect_function=yes
+                 ;;
+               esac
                ;;
        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"
+               tm_file="${tm_file} knetbsd-gnu.h i386/knetbsd-gnu64.h"
                ;;
        esac
        tmake_file="${tmake_file} i386/t-linux64"
@@ -1500,54 +1602,42 @@ i[34567]86-*-nto-qnx*)
        ;;
 i[34567]86-*-rtems*)
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h newlib-stdint.h"
-       tmake_file="${tmake_file} i386/t-rtems t-rtems"
+       tmake_file="${tmake_file} i386/t-rtems"
        ;;
 i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
-       tm_file="${tm_file} i386/unix.h i386/att.h ${sol2_tm_file}"
        # Set default arch_32 to pentium4, tune_32 to generic like the other
        # i386 targets, although config.guess defaults to i386-pc-solaris2*.
-       case ${target} in
-       *-*-solaris2.9*)
-               # Solaris 9/x86 cannot execute SSE/SSE2 instructions by default.
-               with_arch_32=${with_arch_32:-pentiumpro}
-               ;;
-       *)
-               with_arch_32=${with_arch_32:-pentium4}
-               ;;
-       esac
+       with_arch_32=${with_arch_32:-pentium4}
        with_tune_32=${with_tune_32:-generic}
-       case ${target} in
-       *-*-solaris2.1[0-9]*)
-               tm_file="${tm_file} i386/x86-64.h i386/sol2-bi.h sol2-bi.h"
-               tm_defines="${tm_defines} TARGET_BI_ARCH=1"
-               tmake_file="$tmake_file i386/t-sol2-64"
-               need_64bit_isa=yes
-               case X"${with_cpu}" in
-               Xgeneric|Xintel|Xatom|Xslm|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver4|Xbdver3|Xbdver2|Xbdver1|Xbtver2|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
-                       ;;
-               X)
-                       if test x$with_cpu_64 = x; then
-                               with_cpu_64=generic
-                       fi
+       tm_file="${tm_file} i386/unix.h i386/att.h ${sol2_tm_file_head} i386/x86-64.h ${sol2_tm_file_tail}"
+       tm_defines="${tm_defines} TARGET_BI_ARCH=1"
+       tmake_file="$tmake_file i386/t-sol2"
+       need_64bit_isa=yes
+       if test x$with_cpu = x; then
+               if test x$with_cpu_64 = x; then
+                       with_cpu_64=generic
+               fi
+       else
+               case " $x86_cpus $x86_archs $x86_64_archs " in
+               *" $with_cpu "*)
                        ;;
                *)
                        echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
-                       echo "generic intel atom slm core2 corei7 corei7-avx nocona x86-64 bdver4 bdver3 bdver2 bdver1 btver2 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
+                       echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
                        exit 1
                        ;;
                esac
-               ;;
-       esac
+       fi
        ;;
 i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
        tm_file="${tm_file} i386/unix.h i386/att.h elfos.h vx-common.h"
        case ${target} in
          *-vxworksae*)
-           tm_file="${tm_file} vxworksae.h i386/vx-common.h i386/vxworksae.h"
+           tm_file="${tm_file} vxworksae.h i386/vxworks.h i386/vxworksae.h"
            tmake_file="${tmake_file} i386/t-vxworks i386/t-vxworksae"
            ;;
          *)
-           tm_file="${tm_file} vxworks.h i386/vx-common.h i386/vxworks.h"
+           tm_file="${tm_file} vxworks.h i386/vxworks.h"
            tmake_file="${tmake_file} i386/t-vxworks"
            ;;
        esac
@@ -1557,13 +1647,14 @@ i[34567]86-*-cygwin*)
        xm_file=i386/xm-cygwin.h
        tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
        target_gtfiles="\$(srcdir)/config/i386/winnt.c"
-       extra_options="${extra_options} i386/cygming.opt"
+       extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
        extra_objs="winnt.o winnt-stubs.o"
        c_target_objs="${c_target_objs} msformat-c.o"
        cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
        if test x$enable_threads = xyes; then
                thread_file='posix'
        fi
+       default_use_cxa_atexit=yes
        use_gcc_stdint=wrap
        ;;
 x86_64-*-cygwin*)
@@ -1572,13 +1663,14 @@ x86_64-*-cygwin*)
        xm_file=i386/xm-cygwin.h
        tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64"
        target_gtfiles="\$(srcdir)/config/i386/winnt.c"
-       extra_options="${extra_options} i386/cygming.opt"
+       extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
        extra_objs="winnt.o winnt-stubs.o"
        c_target_objs="${c_target_objs} msformat-c.o"
        cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
        if test x$enable_threads = xyes; then
                thread_file='posix'
        fi
+       default_use_cxa_atexit=yes
        use_gcc_stdint=wrap
        tm_defines="${tm_defines} TARGET_CYGWIN64=1"
        ;;
@@ -1607,20 +1699,21 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
                        tm_file="${tm_file} i386/mingw-w64.h"
                        if test x$enable_targets = xall; then
                                tm_defines="${tm_defines} TARGET_BI_ARCH=1"
-                               case X"${with_cpu}" in
-                               Xgeneric|Xintel|Xatom|Xslm|Xcore2|Xcorei7|Xcorei7-avx|Xnocona|Xx86-64|Xbdver4|Xbdver3|Xbdver2|Xbdver1|Xbtver2|Xbtver1|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
-                                       ;;
-                               X)
+                               if test x$with_cpu = x; then
                                        if test x$with_cpu_64 = x; then
                                                with_cpu_64=generic
                                        fi
-                                       ;;
-                               *)
-                                       echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
-                                       echo "generic intel atom slm core2 corei7 Xcorei7-avx nocona x86-64 bdver4 bdver3 bdver2 bdver1 btver2 btver1 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2
-                                       exit 1
-                                       ;;
-                               esac
+                               else
+                                       case " $x86_cpus $x86_archs $x86_64_archs " in
+                                       *" $with_cpu "*)
+                                               ;;
+                                       *)
+                                               echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
+                                               echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
+                                               exit 1
+                                               ;;
+                                       esac
+                               fi
                        fi
                        ;;
                *)
@@ -1742,13 +1835,12 @@ iq2000*-*-elf*)
         md_file=iq2000/iq2000.md
         ;;
 lm32-*-elf*)
-        tm_file="dbxelf.h elfos.h ${tm_file}"
+        tm_file="dbxelf.h elfos.h ${tm_file} newlib-stdint.h"
        tmake_file="${tmake_file} lm32/t-lm32"
         ;;
 lm32-*-rtems*)
        tm_file="dbxelf.h elfos.h ${tm_file} lm32/rtems.h rtems.h newlib-stdint.h"
        tmake_file="${tmake_file} lm32/t-lm32"
-       tmake_file="${tmake_file} t-rtems"
        tmake_file="${tmake_file} lm32/t-rtems"
          ;;
 lm32-*-uclinux*)
@@ -1763,7 +1855,7 @@ m32rle-*-elf*)
        ;;
 m32r-*-rtems*)
        tm_file="dbxelf.h elfos.h ${tm_file} m32r/rtems.h rtems.h newlib-stdint.h"
-       tmake_file="m32r/t-m32r t-rtems"
+       tmake_file="${tmake_file} m32r/t-m32r"
        ;;
 m32r-*-linux*)
        tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} m32r/linux.h"
@@ -1854,7 +1946,7 @@ m68k-*-linux*)                    # Motorola m68k's running GNU/Linux
 m68k-*-rtems*)
        default_m68k_cpu=68020
        default_cf_cpu=5206
-       tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-crtstuff t-rtems m68k/t-rtems m68k/t-mlibs"
+       tmake_file="${tmake_file} m68k/t-floatlib m68k/t-m68kbare m68k/t-crtstuff m68k/t-rtems m68k/t-mlibs"
        tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h"
        tm_defines="${tm_defines} MOTOROLA=1"
        ;;
@@ -1904,7 +1996,7 @@ microblaze*-*-rtems*)
        c_target_objs="${c_target_objs} microblaze-c.o"
        cxx_target_objs="${cxx_target_objs} microblaze-c.o"
        tmake_file="${tmake_file} microblaze/t-microblaze"
-       tmake_file="${tmake_file} t-rtems microblaze/t-rtems"
+       tmake_file="${tmake_file} microblaze/t-rtems"
         ;;
 microblaze*-*-elf)
        case $target in
@@ -1925,56 +2017,79 @@ mips*-*-netbsd*)                        # NetBSD/mips, either endian.
        tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
        ;;
+mips*-img-linux*)
+       tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
+       extra_options="${extra_options} linux-android.opt"
+       tmake_file="${tmake_file} mips/t-img-linux"
+       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
+       gnu_ld=yes
+       gas=yes
+       ;;
 mips*-mti-linux*)
-       tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h mips/mti-linux.h"
+       tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
        extra_options="${extra_options} linux-android.opt"
        tmake_file="${tmake_file} mips/t-mti-linux"
        tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
        gnu_ld=yes
        gas=yes
        ;;
-mips64*-*-linux* | mipsisa64*-*-linux*)
-       tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h"
+mips*-*-linux*)                                # Linux MIPS, either endian.
+       tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
        extra_options="${extra_options} linux-android.opt"
-       tmake_file="${tmake_file} mips/t-linux64"
-       tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
        case ${target} in
+               mipsisa32r6*)
+                       default_mips_arch=mips32r6
+                       ;;
+               mipsisa32r2*)
+                       default_mips_arch=mips32r2
+                       ;;
+               mipsisa32*)
+                       default_mips_arch=mips32
+                       ;;
                mips64el-st-linux-gnu)
+                       default_mips_abi=n32
                        tm_file="${tm_file} mips/st.h"
                        tmake_file="${tmake_file} mips/t-st"
+                       enable_mips_multilibs="yes"
                        ;;
                mips64octeon*-*-linux*)
+                       default_mips_abi=n32
                        tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
                        target_cpu_default=MASK_SOFT_FLOAT_ABI
+                       enable_mips_multilibs="yes"
+                       ;;
+               mipsisa64r6*-*-linux*)
+                       default_mips_abi=n32
+                       default_mips_arch=mips64r6
+                       enable_mips_multilibs="yes"
                        ;;
                mipsisa64r2*-*-linux*)
-                       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
+                       default_mips_abi=n32
+                       default_mips_arch=mips64r2
+                       enable_mips_multilibs="yes"
+                       ;;
+               mips64*-*-linux* | mipsisa64*-*-linux*)
+                       default_mips_abi=n32
+                       enable_mips_multilibs="yes"
                        ;;
        esac
-       gnu_ld=yes
-       gas=yes
-       ;;
-mips*-*-linux*)                                # Linux MIPS, either endian.
-       tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h"
-       extra_options="${extra_options} linux-android.opt"
        if test x$enable_targets = xall; then
-               tm_file="${tm_file} mips/gnu-user64.h mips/linux64.h"
+               enable_mips_multilibs="yes"
+       fi
+       if test x$enable_mips_multilibs = xyes; then
                tmake_file="${tmake_file} mips/t-linux64"
        fi
-       tm_file="${tm_file} mips/linux-common.h"
-       case ${target} in
-        mipsisa32r2*)
-               tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
-                ;;
-        mipsisa32*)
-               tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
-        esac
        ;;
 mips*-mti-elf*)
        tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
        tmake_file="mips/t-mti-elf"
        tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
        ;;
+mips*-img-elf*)
+       tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
+       tmake_file="mips/t-img-elf"
+       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
+       ;;
 mips*-sde-elf*)
        tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h"
        tmake_file="mips/t-sde"
@@ -1995,12 +2110,18 @@ mips*-sde-elf*)
            ;;
        esac
        case ${target} in
+         mipsisa32r6*)
+           tm_defines="MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
+           ;;
          mipsisa32r2*)
            tm_defines="MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
            ;;
          mipsisa32*)
            tm_defines="MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_32"
            ;;
+         mipsisa64r6*)
+           tm_defines="MIPS_ISA_DEFAULT=69 MIPS_ABI_DEFAULT=ABI_N32"
+           ;;
          mipsisa64r2*)
            tm_defines="MIPS_ISA_DEFAULT=65 MIPS_ABI_DEFAULT=ABI_N32"
            ;;
@@ -2011,17 +2132,25 @@ mips*-sde-elf*)
        ;;
 mipsisa32-*-elf* | mipsisa32el-*-elf* | \
 mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
+mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \
 mipsisa64-*-elf* | mipsisa64el-*-elf* | \
-mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
+mipsisa64r2-*-elf* | mipsisa64r2el-*-elf* | \
+mipsisa64r6-*-elf* | mipsisa64r6el-*-elf*)
        tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
        tmake_file="mips/t-isa3264"
        case ${target} in
+         mipsisa32r6*)
+           tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37"
+           ;;
          mipsisa32r2*)
            tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
            ;;
          mipsisa32*)
            tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
            ;;
+         mipsisa64r6*)
+           tm_defines="${tm_defines} MIPS_ISA_DEFAULT=69"
+           ;;
          mipsisa64r2*)
            tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
            ;;
@@ -2079,7 +2208,7 @@ mips64orion-*-elf* | mips64orionel-*-elf*)
        ;;
 mips*-*-rtems*)
        tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
-       tmake_file="mips/t-elf t-rtems mips/t-rtems"
+       tmake_file="${tmake_file} mips/t-elf mips/t-rtems"
        ;;
 mips-wrs-vxworks)
        tm_file="elfos.h ${tm_file} mips/elf.h vx-common.h vxworks.h mips/vxworks.h"
@@ -2091,7 +2220,6 @@ mipstx39-*-elf* | mipstx39el-*-elf*)
        ;;
 mmix-knuth-mmixware)
        tm_file="${tm_file} newlib-stdint.h"
-       need_64bit_hwint=yes
        use_gcc_stdint=wrap
        ;;
 mn10300-*-*)
@@ -2107,20 +2235,20 @@ msp430*-*-*)
        tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
        c_target_objs="msp430-c.o"
        cxx_target_objs="msp430-c.o"
-       target_has_targetm_common=no
        tmake_file="${tmake_file} msp430/t-msp430"
+       extra_gcc_objs="driver-msp430.o"
        ;;
 nds32le-*-*)
        target_cpu_default="0"
        tm_defines="${tm_defines}"
        tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
-       tmake_file="nds32/t-mlibs"
+       tmake_file="nds32/t-nds32 nds32/t-mlibs"
        ;;
 nds32be-*-*)
        target_cpu_default="0|MASK_BIG_ENDIAN"
        tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
        tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
-       tmake_file="nds32/t-mlibs"
+       tmake_file="nds32/t-nds32 nds32/t-mlibs"
        ;;
 nios2-*-*)
        tm_file="elfos.h ${tm_file}"
@@ -2133,17 +2261,24 @@ nios2-*-*)
                tm_file="${tm_file} newlib-stdint.h nios2/elf.h"
                extra_options="${extra_options} nios2/elf.opt"
                ;;
+       nios2-*-rtems*)
+               tm_file="${tm_file} newlib-stdint.h nios2/rtems.h rtems.h"
+               tmake_file="${tmake_file} t-rtems nios2/t-rtems"
+               ;;
         esac
        ;;
-pdp11-*-*)
+nvptx-*)
        tm_file="${tm_file} newlib-stdint.h"
-       use_gcc_stdint=wrap
+       tmake_file="nvptx/t-nvptx"
+       if test x$enable_as_accelerator = xyes; then
+               extra_programs="${extra_programs} mkoffload\$(exeext)"
+               tm_file="${tm_file} nvptx/offload.h"
+       fi
        ;;
-picochip-*)
+pdp11-*-*)
        tm_file="${tm_file} newlib-stdint.h"
        use_gcc_stdint=wrap
-       tmake_file="picochip/t-picochip t-pnt16-warn"
-        ;;
+       ;;
 # port not yet contributed
 #powerpc-*-openbsd*)
 #      tmake_file="${tmake_file} rs6000/t-fprules"
@@ -2236,33 +2371,38 @@ powerpc-*-eabi*)
 powerpc-*-rtems*)
        tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
-       tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
+       tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
        ;;
 powerpc*-*-linux*)
-       tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
+       tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
-       tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+       tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
        extra_objs="$extra_objs rs6000-linux.o"
        case ${target} in
            powerpc*le-*-*)
                tm_file="${tm_file} rs6000/sysv4le.h" ;;
        esac
-       maybe_biarch=yes
+       case ${target}:${with_cpu} in
+           powerpc64*: | powerpc64*:native) cpu_is_64bit=yes ;;
+       esac
+       maybe_biarch=${cpu_is_64bit}
+       case ${enable_targets} in
+           *powerpc64*) maybe_biarch=yes ;;
+           all) maybe_biarch=yes ;;
+       esac
        case ${target} in
            powerpc64*-*-linux*spe* | powerpc64*-*-linux*paired*)
-               echo "*** Configuration ${target} not supported" 1>&2
+               echo "*** Configuration ${target} not supported" 1>&2
                exit 1
                ;;
            powerpc*-*-linux*spe* | powerpc*-*-linux*paired*)
                maybe_biarch=
                ;;
-           powerpc64*-*-linux*)
-               test x$with_cpu != x || cpu_is_64bit=yes
-               maybe_biarch=always
-               ;;
        esac
-       case ${maybe_biarch}:${enable_targets}:${cpu_is_64bit} in
-           always:* | yes:*powerpc64* | yes:all:* | yes:*:yes)
+       case ${target}:${enable_targets}:${maybe_biarch} in
+           powerpc64-* | powerpc-*:*:yes | *:*powerpc64-*:yes | *:all:yes \
+           | powerpc64le*:*powerpcle* | powerpc64le*:*powerpc-* \
+           | powerpcle-*:*powerpc64le*:yes)
                if test x$cpu_is_64bit = xyes; then
                    tm_file="${tm_file} rs6000/default64.h"
                fi
@@ -2283,9 +2423,14 @@ powerpc*-*-linux*)
                esac
                extra_options="${extra_options} rs6000/linux64.opt"
                ;;
+           powerpc64*)
+               tm_file="${tm_file} rs6000/default64.h rs6000/linux64.h glibc-stdint.h"
+               extra_options="${extra_options} rs6000/linux64.opt"
+               tmake_file="${tmake_file} rs6000/t-linux"
+               ;;
            *)
                tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
-               tmake_file="$tmake_file rs6000/t-linux"
+               tmake_file="${tmake_file} rs6000/t-ppcos rs6000/t-linux"
                ;;
        esac
        case ${target} in
@@ -2299,18 +2444,26 @@ powerpc*-*-linux*)
            powerpc*-*-linux*paired*)
                tm_file="${tm_file} rs6000/750cl.h" ;;
        esac
+       case ${target} in
+           *-linux*-musl*)
+               enable_secureplt=yes ;;
+       esac
        if test x${enable_secureplt} = xyes; then
                tm_file="rs6000/secureplt.h ${tm_file}"
        fi
        ;;
-powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
+powerpc-wrs-vxworks|powerpc-wrs-vxworksae|powerpc-wrs-vxworksmils)
        tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"
        tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
        extra_options="${extra_options} rs6000/sysv4.opt"
        extra_headers=ppc-asm.h
        case ${target} in
+          *-vxworksmils*)
+            tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/e500.h rs6000/vxworksmils.h"
+            tmake_file="${tmake_file} rs6000/t-vxworksmils"
+            ;;
          *-vxworksae*)
-           tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/e500.h"
+           tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/e500.h rs6000/vxworksae.h"
            tmake_file="${tmake_file} rs6000/t-vxworksae"
            ;;
          *-vxworks*)
@@ -2380,7 +2533,7 @@ rs6000-ibm-aix5.3.* | powerpc-ibm-aix5.3.*)
        use_gcc_stdint=wrap
        extra_headers=altivec.h
        ;;
-rs6000-ibm-aix[6789].* | powerpc-ibm-aix[6789].*)
+rs6000-ibm-aix6.* | powerpc-ibm-aix6.*)
        tm_file="${tm_file} rs6000/aix.h rs6000/aix61.h rs6000/xcoff.h rs6000/aix-stdint.h"
        tmake_file="rs6000/t-aix52 t-slibgcc"
        extra_options="${extra_options} rs6000/aix64.opt"
@@ -2388,6 +2541,17 @@ rs6000-ibm-aix[6789].* | powerpc-ibm-aix[6789].*)
        thread_file='aix'
        use_gcc_stdint=wrap
        extra_headers=altivec.h
+       default_use_cxa_atexit=yes
+       ;;
+rs6000-ibm-aix[789].* | powerpc-ibm-aix[789].*)
+       tm_file="${tm_file} rs6000/aix.h rs6000/aix71.h rs6000/xcoff.h rs6000/aix-stdint.h"
+       tmake_file="rs6000/t-aix52 t-slibgcc"
+       extra_options="${extra_options} rs6000/aix64.opt"
+       use_collect2=yes
+       thread_file='aix'
+       use_gcc_stdint=wrap
+       extra_headers=altivec.h
+       default_use_cxa_atexit=yes
        ;;
 rl78-*-elf*)
        tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
@@ -2403,33 +2567,36 @@ rx-*-elf*)
 s390-*-linux*)
        default_gnu_indirect_function=yes
        tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
+       c_target_objs="${c_target_objs} s390-c.o"
+       cxx_target_objs="${cxx_target_objs} s390-c.o"
        if test x$enable_targets = xall; then
                tmake_file="${tmake_file} s390/t-linux64"
        fi
+       tmake_file="${tmake_file} s390/t-s390"
        ;;
 s390x-*-linux*)
        default_gnu_indirect_function=yes
        tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
        tm_p_file="linux-protos.h s390/s390-protos.h"
+       c_target_objs="${c_target_objs} s390-c.o"
+       cxx_target_objs="${cxx_target_objs} s390-c.o"
        md_file=s390/s390.md
        extra_modes=s390/s390-modes.def
        out_file=s390/s390.c
-       tmake_file="${tmake_file} s390/t-linux64"
+       tmake_file="${tmake_file} s390/t-linux64 s390/t-s390"
        ;;
 s390x-ibm-tpf*)
-        tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h s390/tpf.h"
-        tm_p_file=s390/s390-protos.h
-        md_file=s390/s390.md
-        extra_modes=s390/s390-modes.def
-        out_file=s390/s390.c
-        thread_file='tpf'
+       tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h s390/tpf.h"
+       tm_p_file=s390/s390-protos.h
+       c_target_objs="${c_target_objs} s390-c.o"
+       cxx_target_objs="${cxx_target_objs} s390-c.o"
+       md_file=s390/s390.md
+       extra_modes=s390/s390-modes.def
+       out_file=s390/s390.c
+       thread_file='tpf'
        extra_options="${extra_options} s390/tpf.opt"
+       tmake_file="${tmake_file} s390/t-s390"
        ;;
-score-*-elf)
-       gas=yes
-       gnu_ld=yes
-        tm_file="dbxelf.h elfos.h score/elf.h score/score.h newlib-stdint.h"
-        ;;
 sh-*-elf* | sh[12346l]*-*-elf* | \
   sh-*-linux* | sh[2346lbe]*-*-linux* | \
   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
@@ -2462,6 +2629,9 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
        tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h"
        case ${target} in
        sh*-*-linux*)   tmake_file="${tmake_file} sh/t-linux"
+                       if test x$enable_fdpic = xyes; then
+                               tm_defines="$tm_defines FDPIC_DEFAULT=1"
+                       fi
                        tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
        sh*-*-netbsd*)
                        tm_file="${tm_file} netbsd.h netbsd-elf.h sh/netbsd-elf.h"
@@ -2607,7 +2777,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
        tmake_file="$tmake_file t-sysroot-suffix"
        ;;
 sh-*-rtems*)
-       tmake_file="sh/t-sh t-rtems sh/t-rtems"
+       tmake_file="${tmake_file} sh/t-sh sh/t-rtems"
        tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
        ;;
 sh-wrs-vxworks)
@@ -2630,7 +2800,7 @@ sparc-*-elf*)
        ;;
 sparc-*-rtems*)
        tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
-       tmake_file="sparc/t-sparc sparc/t-elf sparc/t-rtems t-rtems"
+       tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems"
        ;;
 sparc-*-linux*)
        tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
@@ -2661,7 +2831,7 @@ sparc-*-netbsdelf*)
        tmake_file="${tmake_file} sparc/t-sparc"
        ;;
 sparc*-*-solaris2*)
-       tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sol2-bi.h sparc/tso.h"
+       tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sparc/tso.h"
        case ${target} in
            sparc64-*-* | sparcv9-*-*)
                tm_file="sparc/default-64.h ${tm_file}"
@@ -2670,7 +2840,7 @@ sparc*-*-solaris2*)
                test x$with_cpu != x || with_cpu=v9
                ;;
        esac
-       tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2-64"
+       tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2"
        ;;
 sparc-wrs-vxworks)
        tm_file="${tm_file} elfos.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
@@ -2684,7 +2854,7 @@ sparc64-*-elf*)
 sparc64-*-rtems*)
        tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
        extra_options="${extra_options}"
-       tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64 t-rtems"
+       tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64"
        ;;
 sparc64-*-linux*)
        tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h sparc/tso.h"
@@ -2740,15 +2910,20 @@ tic6x-*-uclinux)
        tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
        use_collect2=no
        ;;
-tilegx-*-linux*)
+tilegx*-*-linux*)
        tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilegx/linux.h ${tm_file}"
         tmake_file="${tmake_file} tilegx/t-tilegx"
        extra_objs="${extra_objs} mul-tables.o"
        c_target_objs="${c_target_objs} tilegx-c.o"
        cxx_target_objs="${cxx_target_objs} tilegx-c.o"
        extra_headers="feedback.h"
+       case $target in
+       tilegxbe-*)
+               tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+               ;;
+       esac
        ;;
-tilepro-*-linux*)
+tilepro*-*-linux*)
        tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilepro/linux.h ${tm_file}"
         tmake_file="${tmake_file} tilepro/t-tilepro"
        extra_objs="${extra_objs} mul-tables.o"
@@ -2761,7 +2936,7 @@ v850-*-rtems*)
        tm_file="dbxelf.h elfos.h v850/v850.h"
        tm_file="${tm_file} rtems.h v850/rtems.h newlib-stdint.h"
        tmake_file="${tmake_file} v850/t-v850"
-       tmake_file="${tmake_file} t-rtems v850/t-rtems"
+       tmake_file="${tmake_file} v850/t-rtems"
        use_collect2=no
        c_target_objs="v850-c.o"
        cxx_target_objs="v850-c.o"
@@ -2806,10 +2981,14 @@ vax-*-netbsdelf*)
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
        ;;
 vax-*-openbsd*)
-       tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-pthread.h vax/openbsd.h"
+       tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-libpthread.h vax/openbsd.h"
        extra_options="${extra_options} openbsd.opt"
        use_collect2=yes
        ;;
+visium-*-elf*)
+       tm_file="dbxelf.h elfos.h ${tm_file} visium/elf.h newlib-stdint.h"
+       tmake_file="visium/t-visium visium/t-crtstuff"
+       ;;
 xstormy16-*-elf)
        # For historical reasons, the target files omit the 'x'.
        tm_file="dbxelf.h elfos.h newlib-stdint.h stormy16/stormy16.h"
@@ -2827,6 +3006,11 @@ xtensa*-*-linux*)
        tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
        tmake_file="${tmake_file} xtensa/t-xtensa"
        ;;
+xtensa*-*-uclinux*)
+       tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
+       tmake_file="${tmake_file} xtensa/t-xtensa"
+       extra_options="${extra_options} xtensa/uclinux.opt"
+       ;;
 am33_2.0-*-linux*)
        tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
        gas=yes gnu_ld=yes
@@ -2834,7 +3018,6 @@ am33_2.0-*-linux*)
        ;;
 m32c-*-rtems*)
        tm_file="dbxelf.h elfos.h ${tm_file} m32c/rtems.h rtems.h newlib-stdint.h"
-       tmake_file="${tmake_file} t-rtems"
        c_target_objs="m32c-pragma.o"
        cxx_target_objs="m32c-pragma.o"
        ;;
@@ -2860,6 +3043,14 @@ powerpc*-*-* | rs6000-*-*)
        tm_file="${tm_file} rs6000/option-defaults.h"
 esac
 
+# Build mkoffload tool
+case ${target} in
+*-intelmic-* | *-intelmicemul-*)
+       tmake_file="${tmake_file} i386/t-intelmic"
+       tm_file="${tm_file} i386/intelmic-offload.h"
+       ;;
+esac
+
 if [ "$target_has_targetcm" = "no" ]; then
   c_target_objs="$c_target_objs default-c.o"
   cxx_target_objs="$cxx_target_objs default-c.o"
@@ -2939,6 +3130,10 @@ case ${target} in
     ;;
   i686-*-* | i786-*-*)
     case ${target_noncanonical} in
+      znver1-*)
+       arch=znver1
+       cpu=znver1
+       ;;
       bdver4-*)
         arch=bdver4
         cpu=bdver4
@@ -3052,6 +3247,10 @@ case ${target} in
     ;;
   x86_64-*-*)
     case ${target_noncanonical} in
+      znver1-*)
+       arch=znver1
+       cpu=znver1
+       ;;
       bdver4-*)
         arch=bdver4
         cpu=bdver4
@@ -3120,6 +3319,9 @@ esac
 # This block sets nothing except for with_cpu.
 if test x$with_cpu = x ; then
   case ${target} in
+    i[34567]86-*-elfiamcu)
+      with_cpu=lakemont
+      ;;
     i[34567]86-*-*|x86_64-*-*)
       with_cpu=$cpu
       ;;
@@ -3169,11 +3371,17 @@ if test x$with_cpu = x ; then
        *-leon[3-9]*)
          with_cpu=leon3
          ;;
+       *-leon[3-9]v7*)
+         with_cpu=leon3v7
+         ;;
        *)
          with_cpu="`echo ${target} | sed 's/-.*$//'`"
          ;;
       esac
       ;;
+    visium-*-*)
+      with_cpu=gr5
+      ;;
   esac
 
   # Avoid overriding --with-cpu-32 and --with-cpu-64 values.
@@ -3209,6 +3417,9 @@ if test x$with_arch = x ; then
       # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
       # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
       ;;
+    i[34567]86-*-elfiamcu)
+      with_arch=lakemont
+      ;;
     i[34567]86-*-*)
       # --with-fpmath sets the default ISA to SSE2, which is the same
       # ISA supported by Pentium 4.
@@ -3344,7 +3555,7 @@ case "${target}" in
 
                        eval "val=\$with_$which"
                        base_val=`echo $val | sed -e 's/\+.*//'`
-                       ext_val=`echo $val | sed -e 's/[a-z0-9\-]\+//'`
+                       ext_val=`echo $val | sed -e 's/[a-z0-9.-]\+//'`
 
                        if [ $which = arch ]; then
                          def=aarch64-arches.def
@@ -3368,6 +3579,11 @@ case "${target}" in
                                  ${srcdir}/config/aarch64/$def | \
                                  sed -e 's/^[^,]*,[    ]*//' | \
                                  sed -e 's/,.*$//'`
+                               # Extract the architecture flags from aarch64-arches.def
+                               ext_mask=`grep "^$pattern(\"$base_val\"," \
+                                  ${srcdir}/config/aarch64/$def | \
+                                  sed -e 's/)$//' | \
+                                  sed -e 's/^.*,//'`
                          else
                                base_id=`grep "^$pattern(\"$base_val\"," \
                                  ${srcdir}/config/aarch64/$def | \
@@ -3499,20 +3715,17 @@ case "${target}" in
                        ;;
                esac
 
-               case "$with_fpu" in
-               "" \
-               | vfp | vfp3 | vfpv3 \
-               | vfpv3-fp16 | vfpv3-d16 | vfpv3-d16-fp16 | vfpv3xd \
-               | vfpv3xd-fp16 | neon | neon-fp16 | vfpv4 | vfpv4-d16 \
-               | fpv4-sp-d16 | neon-vfpv4 | fp-arm-v8 | neon-fp-armv8 \
-                | crypto-neon-fp-armv8)
-                       # OK
-                       ;;
-               *)
-                       echo "Unknown fpu used in --with-fpu=$with_fpu" 2>&1
-                       exit 1
-                       ;;
-               esac
+               # see if it matches any of the entries in arm-fpus.def
+               if [ x"$with_fpu" = x ] \
+                   || grep "^ARM_FPU(\"$with_fpu\"," \
+                           ${srcdir}/config/arm/arm-fpus.def \
+                           > /dev/null; then
+                 # OK
+                 true
+               else
+                 echo "Unknown fpu used in --with-fpu=$with_fpu" 1>&2
+                 exit 1
+               fi
 
                case "$with_abi" in
                "" \
@@ -3548,7 +3761,13 @@ case "${target}" in
                esac
 
                if test "x$with_arch" != x && test "x$with_cpu" != x; then
-                       echo "Warning: --with-arch overrides --with-cpu=$with_cpu" 1>&2
+                       echo "Switch \"--with-arch\" may not be used with switch \"--with-cpu\""  1>&2
+                       exit 1
+               fi
+
+               if test "x$with_cpu" != x && test "x$with_tune" != x; then
+                       echo "Switch \"--with-tune\" may not be used with switch \"--with-cpu\""  1>&2
+                       exit 1
                fi
 
                # Add extra multilibs
@@ -3669,13 +3888,8 @@ case "${target}" in
                supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
                for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do
                        eval "val=\$with_$which"
-                       case ${val} in
-                       i386 | i486 \
-                       | i586 | pentium | pentium-mmx | winchip-c6 | winchip2 \
-                       | c3 | c3-2 | i686 | pentiumpro | pentium2 | pentium3 \
-                       | pentium4 | k6 | k6-2 | k6-3 | athlon | athlon-tbird \
-                       | athlon-4 | athlon-xp | athlon-mp | geode \
-                       | prescott | pentium-m | pentium4m | pentium3m)
+                       case " $x86_archs " in
+                       *" ${val} "*)
                                case "${target}" in
                                  x86_64-*-*)
                                      case "x$which" in
@@ -3690,24 +3904,41 @@ case "${target}" in
                                esac
                                # OK
                                ;;
-                       "" | x86-64 | generic | intel | native \
-                       | k8 | k8-sse3 | athlon64 | athlon64-sse3 | opteron \
-                       | opteron-sse3 | athlon-fx | bdver4 | bdver3 | bdver2 \
-                       | bdver1 | btver2 |  btver1 | amdfam10 | barcelona \
-                       | nocona | core2 | corei7 | corei7-avx | core-avx-i \
-                       | core-avx2 | broadwell | atom | slm)
-                               # OK
-                               ;;
                        *)
-                               echo "Unknown CPU given in --with-$which=$val." 1>&2
-                               exit 1
+                               if test x${val} != x; then
+                                       case " $x86_64_archs " in
+                                       *" ${val} "*)
+                                               # OK
+                                               ;;
+                                       *)
+                                               # Allow $x86_cpus --with-cpu=/--with-tune=
+                                               case "x$which" in
+                                               xcpu*|xtune*)
+                                                       case " $x86_cpus " in
+                                                       *" ${val} "*)
+                                                               # OK
+                                                               ;;
+                                                       *)
+                                                               echo "Unknown CPU given in --with-$which=$val." 1>&2
+                                                               exit 1
+                                                               ;;
+                                                       esac
+                                                       ;;
+                                               *)
+                                                       echo "Unknown CPU given in --with-$which=$val." 1>&2
+                                                       exit 1
+                                                       ;;
+                                               esac
+                                       ;;
+                                       esac
+                               fi
                                ;;
                        esac
                done
                ;;
 
        mips*-*-*)
-               supported_defaults="abi arch arch_32 arch_64 float fpu nan tune tune_32 tune_64 divide llsc mips-plt synci"
+               supported_defaults="abi arch arch_32 arch_64 float fpu nan fp_32 odd_spreg_32 tune tune_32 tune_64 divide llsc mips-plt synci"
 
                case ${with_float} in
                "" | soft | hard)
@@ -3739,6 +3970,32 @@ case "${target}" in
                        ;;
                esac
 
+               case ${with_fp_32} in
+               "" | 32 | xx | 64)
+                       # OK
+                       ;;
+               *)
+                       echo "Unknown FP mode used in --with-fp-32=$with_fp_32" 1>&2
+                       exit 1
+                       ;;
+               esac
+
+               case ${with_odd_spreg_32} in
+               yes)
+                       with_odd_spreg_32="odd-spreg"
+                       ;;
+               no)
+                       with_odd_spreg_32="no-odd-spreg"
+                       ;;
+               "")
+                       # OK
+                       ;;
+               *)
+                       echo "Unknown odd-spreg-32 type used in --with-odd-spreg-32=$with_odd_spreg_32" 1>&2
+                       exit 1
+                       ;;
+               esac
+
                case ${with_abi} in
                "" | 32 | o64 | n32 | 64 | eabi)
                        # OK
@@ -3839,8 +4096,21 @@ case "${target}" in
                esac
                ;;
 
+       nios2*-*-*)
+               supported_defaults="arch"
+                       case "$with_arch" in
+                       "" | r1 | r2)
+                               # OK
+                               ;;
+                       *)
+                               echo "Unknown arch used in --with-arch=$with_arch" 1>&2
+                               exit 1
+                               ;;
+                       esac
+               ;;
+
        powerpc*-*-* | rs6000-*-*)
-               supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64"
+               supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64 advance_toolchain"
 
                for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
                        eval "val=\$with_$which"
@@ -3862,7 +4132,7 @@ case "${target}" in
                                eval "with_$which=405"
                                ;;
                        "" | common | native \
-                       | power | power[2345678] | power6x | powerpc | powerpc64 \
+                       | power | power[23456789] | power6x | powerpc | powerpc64 \
                        | rios | rios1 | rios2 | rsc | rsc1 | rs64a \
                        | 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
                        | 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
@@ -3887,6 +4157,56 @@ case "${target}" in
                        exit 1
                        ;;
                esac
+
+               if test "x$with_advance_toolchain" != x; then
+                   if test -d "/opt/$with_advance_toolchain/." -a \
+                       -d "/opt/$with_advance_toolchain/bin/." -a \
+                       -d "/opt/$with_advance_toolchain/include/."; then
+
+                       tm_file="$tm_file ./advance-toolchain.h"
+                       (at="/opt/$with_advance_toolchain"
+                        echo "/* Use Advance Toolchain $at */"
+                        echo
+                        echo "#ifndef USE_AT_INCLUDE_FILES"
+                        echo "#define USE_AT_INCLUDE_FILES 1"
+                        echo "#endif"
+                        echo
+                        echo "#if USE_AT_INCLUDE_FILES"
+                        echo "#undef  INCLUDE_EXTRA_SPEC"
+                        echo "#define INCLUDE_EXTRA_SPEC" \
+                             "\"-isystem $at/include\""
+                        echo "#endif"
+                        echo
+                        echo "#undef  LINK_OS_EXTRA_SPEC32"
+                        echo "#define LINK_OS_EXTRA_SPEC32" \
+                             "\"%(link_os_new_dtags)" \
+                             "-rpath $prefix/lib -rpath $at/lib" \
+                             "-L $prefix/lib -L $at/lib\""
+                        echo
+                        echo "#undef  LINK_OS_EXTRA_SPEC64"
+                        echo "#define LINK_OS_EXTRA_SPEC64" \
+                             "\"%(link_os_new_dtags)" \
+                             "-rpath $prefix/lib64 -rpath $at/lib64" \
+                             "-L $prefix/lib64 -L $at/lib64\""
+                        echo
+                        echo "#undef  LINK_OS_NEW_DTAGS_SPEC"
+                        echo "#define LINK_OS_NEW_DTAGS_SPEC" \
+                             "\"--enable-new-dtags\""
+                        echo
+                        echo "#undef  DYNAMIC_LINKER_PREFIX"
+                        echo "#define DYNAMIC_LINKER_PREFIX \"$at\""
+                        echo
+                        echo "#undef  MD_EXEC_PREFIX"
+                        echo "#define MD_EXEC_PREFIX \"$at/bin/\""
+                        echo
+                        echo "#undef  MD_STARTFILE_PREFIX"
+                        echo "#define MD_STARTFILE_PREFIX \"$at/lib/\"") \
+                           > advance-toolchain.h
+                   else
+                       echo "Unknown advance-toolchain $with_advance_toolchain"
+                       exit 1
+                   fi
+               fi
                ;;
 
        s390*-*-*)
@@ -3895,7 +4215,7 @@ case "${target}" in
                for which in arch tune; do
                        eval "val=\$with_$which"
                        case ${val} in
-                       "" | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12)
+                       "" | native | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13)
                                # OK
                                ;;
                        *)
@@ -3916,7 +4236,7 @@ case "${target}" in
                esac
                ;;
 
-       sh[123456ble]-*-* | sh-*-*)
+       sh[123456ble]*-*-* | sh-*-*)
                supported_defaults="cpu"
                case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in
                "" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
@@ -3943,7 +4263,7 @@ case "${target}" in
                        case ${val} in
                        "" | sparc | sparcv9 | sparc64 \
                        | v7 | cypress \
-                       | v8 | supersparc | hypersparc | leon | leon3 \
+                       | v8 | supersparc | hypersparc | leon | leon3 | leon3v7 \
                        | sparclite | f930 | f934 | sparclite86x \
                        | sparclet | tsc701 \
                        | v9 | ultrasparc | ultrasparc3 | niagara | niagara2 \
@@ -4011,16 +4331,24 @@ case "${target}" in
                        ;;
                esac
                ;;
+       visium-*-*)
+               supported_defaults="cpu"
+               case $with_cpu in
+                 "" | gr5 | gr6)
+                       ;;
+                 *)    echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
+                       exit 1
+                       ;;
+               esac
+               ;;
 esac
 
 # Set some miscellaneous flags for particular targets.
 target_cpu_default2=
 case ${target} in
        aarch64*-*-*)
-               if test x$target_cpu_cname = x
+               if test x"$target_cpu_cname" != x
                then
-                       target_cpu_default2=TARGET_CPU_generic
-               else
                        target_cpu_default2=$target_cpu_cname
                fi
                ;;
@@ -4037,7 +4365,7 @@ case ${target} in
        hppa*-*-*)
                if test x$gas = xyes
                then
-                       target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY"
+                       target_cpu_default2="MASK_GAS"
                fi
                ;;
 
@@ -4066,6 +4394,8 @@ case ${target} in
                ;;
        i[34567]86-*-mingw* | x86_64-*-mingw*)
                ;;
+       i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
+               ;;
        i[34567]86-*-freebsd* | x86_64-*-freebsd*)
                ;;
        ia64*-*-linux*)
@@ -4081,6 +4411,31 @@ case ${target} in
                                tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
                                ;;
                esac
+               if test x$with_arch != x; then
+                       default_mips_arch=$with_arch
+               fi
+               if test x$with_abi != x; then
+                       default_mips_abi=$with_abi
+               fi
+               case ${default_mips_arch} in
+                   mips1)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=1" ;;
+                   mips2)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=2" ;;
+                   mips3)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=3" ;;
+                   mips4)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=4" ;;
+                   mips32)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=32" ;;
+                   mips32r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=33" ;;
+                   mips32r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=37" ;;
+                   mips64)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=64" ;;
+                   mips64r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=65" ;;
+                   mips64r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=69" ;;
+               esac
+               case ${default_mips_abi} in
+                   32)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_32" ;;
+                   o64)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_O64" ;;
+                   n32)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_N32" ;;
+                   64)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_64" ;;
+                   eabi) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_EABI" ;;
+               esac
                tmake_file="mips/t-mips $tmake_file"
                ;;
 
@@ -4140,10 +4495,13 @@ case ${target} in
                        ;;
                esac
                ;;
+       visium-*-*)
+               target_cpu_default2="TARGET_CPU_$with_cpu"
+               ;;
 esac
 
 t=
-all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan divide llsc mips-plt synci tls"
+all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan fp_32 odd_spreg_32 divide llsc mips-plt synci tls"
 for option in $all_defaults
 do
        eval "val=\$with_"`echo $option | sed s/-/_/g`
@@ -4183,3 +4541,11 @@ then
                target_cpu_default=$target_cpu_default2
        fi
 fi
+
+case ${target} in
+i[34567]86-*-* | x86_64-*-*)
+       if test x$enable_as_accelerator = xyes; then
+               extra_programs="mkoffload\$(exeext)"
+       fi
+       ;;
+esac