]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/configure
Use -z ignore instead of --as-needed on Solaris
[thirdparty/gcc.git] / gcc / configure
index 2da771427d77ae65791597f1e83469f9709cc122..a33da7a73f8d2fffb38a48ac6a3029ad9a59b27b 100755 (executable)
@@ -604,8 +604,8 @@ enable_plugin
 pluginlibs
 CLOOGINC
 CLOOGLIBS
-PPLINC
-PPLLIBS
+ISLINC
+ISLLIBS
 GMPINC
 GMPLIBS
 target_cpu_default
@@ -637,11 +637,11 @@ host_xm_defines
 host_xm_include_list
 host_xm_file_list
 host_exeext
+gcc_gxx_include_dir_add_sysroot
 gcc_gxx_include_dir
 gcc_config_arguments
 float_h_file
 extra_programs
-extra_passes
 extra_objs
 extra_headers_list
 user_headers_inc_next_post
@@ -674,7 +674,6 @@ MAINT
 zlibinc
 zlibdir
 HOST_LIBS
-GGC
 libgcc_visibility
 gcc_cv_readelf
 gcc_cv_objdump
@@ -703,7 +702,9 @@ LIBTOOL
 collect2
 STMP_FIXINC
 BUILD_LDFLAGS
+BUILD_CXXFLAGS
 BUILD_CFLAGS
+CXX_FOR_BUILD
 CC_FOR_BUILD
 inhibit_libc
 SYSTEM_HEADER_DIR
@@ -763,12 +764,15 @@ SYSROOT_CFLAGS_FOR_TARGET
 enable_shared
 enable_fixed_point
 enable_decimal_float
+with_float
+with_cpu
+enable_multiarch
 enable_multilib
-ENABLE_BUILD_WITH_CXX
 coverage_flags
 valgrind_command
 valgrind_path_defines
 valgrind_path
+TREECHECKING
 TREEBROWSER
 nocommon_flag
 noexception_flags
@@ -871,9 +875,9 @@ enable_werror_always
 enable_checking
 enable_coverage
 enable_gather_detailed_mem_stats
-enable_build_with_cxx
 with_stabs
 enable_multilib
+enable_multiarch
 enable___cxa_atexit
 enable_decimal_float
 enable_fixed_point
@@ -892,7 +896,6 @@ enable_languages
 with_multilib_list
 enable_rpath
 with_libiconv_prefix
-enable_initfini_array
 enable_sjlj_exceptions
 enable_secureplt
 enable_leading_mingw64_underscores
@@ -905,6 +908,7 @@ enable_fast_install
 enable_libtool_lock
 with_plugin_ld
 enable_gnu_indirect_function
+enable_initfini_array
 enable_comdat
 enable_gnu_unique_object
 enable_linker_build_id
@@ -932,8 +936,8 @@ CPP
 CXXCPP
 GMPLIBS
 GMPINC
-PPLLIBS
-PPLINC
+ISLLIBS
+ISLINC
 CLOOGLIBS
 CLOOGINC'
 
@@ -1573,8 +1577,8 @@ Optional Features:
                           Values are opt, noopt, default is noopt
   --enable-gather-detailed-mem-stats
                           enable detailed memory allocation stats gathering
-  --enable-build-with-cxx build with C++ compiler instead of C compiler
   --enable-multilib       enable library support for multiple ABIs
+  --enable-multiarch      enable support for multiarch paths
   --enable-__cxa_atexit   enable __cxa_atexit for C++
   --enable-decimal-float={no,yes,bid,dpd}
                        enable decimal float extension to C.  Selecting 'bid'
@@ -1590,7 +1594,6 @@ Optional Features:
   --disable-shared        don't provide a shared libgcc
   --enable-languages=LIST specify which front-ends to build
   --disable-rpath         do not hardcode runtime library paths
-  --enable-initfini-array      use .init_array/.fini_array sections
   --enable-sjlj-exceptions
                           arrange to use setjmp/longjmp exception handling
   --enable-secureplt      enable -msecure-plt by default for PowerPC
@@ -1614,6 +1617,7 @@ Optional Features:
   --enable-gnu-indirect-function
                           enable the use of the @gnu_indirect_function to
                           glibc systems
+  --enable-initfini-array      use .init_array/.fini_array sections
   --enable-comdat         enable COMDAT group support
   --enable-gnu-unique-object
                           enable the use of the @gnu_unique_object ELF
@@ -1665,7 +1669,8 @@ Optional Packages:
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-plugin-ld=[ARG]  specify the plugin linker
   --with-long-double-128  use 128-bit long double by default
-  --with-gc={page,zone}   choose the garbage collection mechanism to use with
+  --with-gc={page,zone}   this option is not supported anymore. It used to
+                          choose the garbage collection mechanism to use with
                           the compiler
   --with-system-zlib      use installed libz
   --with-linker-hash-style={sysv,gnu,both}
@@ -1685,8 +1690,8 @@ Some influential environment variables:
   CXXCPP      C++ preprocessor
   GMPLIBS     How to link GMP
   GMPINC      How to find GMP include files
-  PPLLIBS     How to link PPL
-  PPLINC      How to find PPL include files
+  ISLLIBS     How to link ISL
+  ISLINC      How to find ISL include files
   CLOOGLIBS   How to link CLOOG
   CLOOGINC    How to find CLOOG include files
 
@@ -3313,6 +3318,15 @@ if test x${gcc_gxx_include_dir} = x; then
   fi
 fi
 
+gcc_gxx_include_dir_add_sysroot=0
+if test "${with_sysroot+set}" = set; then
+  gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+  if test "${gcc_gxx_without_sysroot}"; then
+    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
+    gcc_gxx_include_dir_add_sysroot=1
+  fi
+fi
+
 
 # Check whether --with-cpp_install_dir was given.
 if test "${with_cpp_install_dir+set}" = set; then :
@@ -3384,13 +3398,6 @@ _ACEOF
 
 fi
 
-gnu_ld=`if test x"$gnu_ld_flag" = x"yes"; then echo 1; else echo 0; fi`
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_GNU_LD $gnu_ld
-_ACEOF
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a default linker was specified" >&5
 $as_echo_n "checking whether a default linker was specified... " >&6; }
 if test x"${DEFAULT_LINKER+set}" = x"set"; then
@@ -3449,13 +3456,6 @@ _ACEOF
 
 fi
 
-gnu_as=`if test x"$gas_flag" = x"yes"; then echo 1; else echo 0; fi`
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_GNU_AS $gnu_as
-_ACEOF
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a default assembler was specified" >&5
 $as_echo_n "checking whether a default assembler was specified... " >&6; }
 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
@@ -4849,7 +4849,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_cc_gcc_supports_ada" >&5
 $as_echo "$acx_cv_cc_gcc_supports_ada" >&6; }
 
-if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
+if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
   have_gnat=yes
 else
   have_gnat=no
@@ -4869,10 +4869,12 @@ fi
 # optimizations to be activated explicitly by the toplevel.
 case "$CC" in
   */prev-gcc/xgcc*) ;;
-  *) CFLAGS=`echo $CFLAGS | sed "s/-O[s0-9]* *//" ` ;;
+  *) CFLAGS=`echo "$CFLAGS " | sed -e "s/-Ofast[       ]//" -e "s/-O[gs][      ]//" -e "s/-O[0-9]*[    ]//" `
+     CXXFLAGS=`echo "$CXXFLAGS " | sed -e "s/-Ofast[   ]//" -e "s/-O[gs][      ]//" -e "s/-O[0-9]*[    ]//" ` ;;
 esac
 
 
+
 # Determine PICFLAG for target gnatlib.
 
 
@@ -4891,9 +4893,11 @@ case "${target}" in
     hppa*64*-*-hpux*)
        # PIC is the default for 64-bit PA HP-UX.
        ;;
-    i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
+    i[34567]86-*-cygwin* | x86_64-*-cygwin*)
        ;;
-    i[34567]86-*-interix3*)
+    i[34567]86-*-mingw* | x86_64-*-mingw*)
+       ;;
+    i[34567]86-*-interix[3-9]*)
        # Interix 3.x gcc -fpic/-fPIC options generate broken code.
        # Instead, we relocate shared libraries at runtime.
        ;;
@@ -4925,9 +4929,6 @@ case "${target}" in
     m68k-*-*)
        PICFLAG_FOR_TARGET=-fpic
        ;;
-    s390*-*-*)
-       PICFLAG_FOR_TARGET=-fpic
-       ;;
     # FIXME: Override -fPIC default in libgcc only?
     sh-*-linux* | sh[2346lbe]*-*-linux*)
        PICFLAG_FOR_TARGET=-fpic
@@ -6400,7 +6401,13 @@ fi
 
 loose_warn=
 save_CFLAGS="$CFLAGS"
-for option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual; do
+for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual; do
+  # Do the check with the no- prefix removed since gcc silently
+  # accepts any -Wno-* option on purpose
+  case $real_option in
+    -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
+    *) option=$real_option ;;
+  esac
   as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
@@ -6432,14 +6439,20 @@ eval ac_res=\$$as_acx_Woption
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
   if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
-  loose_warn="$loose_warn${loose_warn:+ }$option"
+  loose_warn="$loose_warn${loose_warn:+ }$real_option"
 fi
   done
 CFLAGS="$save_CFLAGS"
 
 c_loose_warn=
 save_CFLAGS="$CFLAGS"
-for option in -Wstrict-prototypes -Wmissing-prototypes; do
+for real_option in -Wstrict-prototypes -Wmissing-prototypes; do
+  # Do the check with the no- prefix removed since gcc silently
+  # accepts any -Wno-* option on purpose
+  case $real_option in
+    -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
+    *) option=$real_option ;;
+  esac
   as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
@@ -6471,14 +6484,20 @@ eval ac_res=\$$as_acx_Woption
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
   if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
-  c_loose_warn="$c_loose_warn${c_loose_warn:+ }$option"
+  c_loose_warn="$c_loose_warn${c_loose_warn:+ }$real_option"
 fi
   done
 CFLAGS="$save_CFLAGS"
 
 strict_warn=
 save_CFLAGS="$CFLAGS"
-for option in -Wmissing-format-attribute; do
+for real_option in -Wmissing-format-attribute; do
+  # Do the check with the no- prefix removed since gcc silently
+  # accepts any -Wno-* option on purpose
+  case $real_option in
+    -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
+    *) option=$real_option ;;
+  esac
   as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
@@ -6510,14 +6529,20 @@ eval ac_res=\$$as_acx_Woption
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
   if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
-  strict_warn="$strict_warn${strict_warn:+ }$option"
+  strict_warn="$strict_warn${strict_warn:+ }$real_option"
 fi
   done
 CFLAGS="$save_CFLAGS"
 
 c_strict_warn=
 save_CFLAGS="$CFLAGS"
-for option in -Wold-style-definition -Wc++-compat; do
+for real_option in -Wold-style-definition -Wc++-compat; do
+  # Do the check with the no- prefix removed since gcc silently
+  # accepts any -Wno-* option on purpose
+  case $real_option in
+    -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
+    *) option=$real_option ;;
+  esac
   as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
@@ -6549,19 +6574,21 @@ eval ac_res=\$$as_acx_Woption
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
   if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
-  c_strict_warn="$c_strict_warn${c_strict_warn:+ }$option"
+  c_strict_warn="$c_strict_warn${c_strict_warn:+ }$real_option"
 fi
   done
 CFLAGS="$save_CFLAGS"
 
+# Do the check with the no- prefix removed from the warning options
+# since gcc silently accepts any -Wno-* option on purpose
 if test "$GCC" = yes; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings" >&5
-$as_echo_n "checking whether $CC supports -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings... " >&6; }
-if test "${acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros__Wno_overlength_strings+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings" >&5
+$as_echo_n "checking whether $CC supports -pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings... " >&6; }
+if test "${acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   save_CFLAGS="$CFLAGS"
-CFLAGS="-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings"
+CFLAGS="-pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -6574,16 +6601,16 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros__Wno_overlength_strings=yes
+  acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings=yes
 else
-  acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros__Wno_overlength_strings=no
+  acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 CFLAGS="$save_CFLAGS"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros__Wno_overlength_strings" >&5
-$as_echo "$acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros__Wno_overlength_strings" >&6; }
-if test $acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros__Wno_overlength_strings = yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings" >&5
+$as_echo "$acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings" >&6; }
+if test $acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings = yes; then :
   strict_warn="$strict_warn${strict_warn:+ }-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings"
 fi
 
@@ -6617,7 +6644,13 @@ fi
 # Disable exceptions and RTTI if building with g++
 noexception_flags=
 save_CFLAGS="$CFLAGS"
-for option in -fno-exceptions -fno-rtti; do
+for real_option in -fno-exceptions -fno-rtti -fasynchronous-unwind-tables; do
+  # Do the check with the no- prefix removed since gcc silently
+  # accepts any -Wno-* option on purpose
+  case $real_option in
+    -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
+    *) option=$real_option ;;
+  esac
   as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
@@ -6649,7 +6682,7 @@ eval ac_res=\$$as_acx_Woption
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
   if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
-  noexception_flags="$noexception_flags${noexception_flags:+ }$option"
+  noexception_flags="$noexception_flags${noexception_flags:+ }$real_option"
 fi
   done
 CFLAGS="$save_CFLAGS"
@@ -6756,6 +6789,7 @@ if test x$ac_tree_checking != x ; then
 $as_echo "#define ENABLE_TREE_CHECKING 1" >>confdefs.h
 
   TREEBROWSER=tree-browser.o
+  TREECHECKING=yes
 fi
 if test x$ac_types_checking != x ; then
 
@@ -6763,6 +6797,7 @@ $as_echo "#define ENABLE_TYPES_CHECKING 1" >>confdefs.h
 
 fi
 
+
 if test x$ac_rtl_checking != x ; then
 
 $as_echo "#define ENABLE_RTL_CHECKING 1" >>confdefs.h
@@ -6960,31 +6995,17 @@ else
   enable_gather_detailed_mem_stats=no
 fi
 
-if test x$enable_gather_detailed_mem_stats = xyes ; then
+gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else echo 0; fi`
 
-$as_echo "#define GATHER_STATISTICS 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define GATHER_STATISTICS $gather_stats
+_ACEOF
 
-fi
 
 # -------------------------------
 # Miscenalleous configure options
 # -------------------------------
 
-# See if we are building gcc with C++.
-# Check whether --enable-build-with-cxx was given.
-if test "${enable_build_with_cxx+set}" = set; then :
-  enableval=$enable_build_with_cxx; ENABLE_BUILD_WITH_CXX=$enableval
-else
-  ENABLE_BUILD_WITH_CXX=no
-fi
-
-
-if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
-
-$as_echo "#define ENABLE_BUILD_WITH_CXX 1" >>confdefs.h
-
-fi
-
 # With stabs
 
 # Check whether --with-stabs was given.
@@ -7005,6 +7026,37 @@ fi
 
 
 
+# Determine whether or not multiarch is enabled.
+# Check whether --enable-multiarch was given.
+if test "${enable_multiarch+set}" = set; then :
+  enableval=$enable_multiarch; case "${enableval}" in
+yes|no|auto) enable_multiarch=$enableval;;
+*) as_fn_error "bad value ${enableval} given for --enable-multiarch option" "$LINENO" 5 ;;
+esac
+else
+  enable_multiarch=auto
+fi
+
+if test x${enable_multiarch} = xauto; then
+  if test x${with_native_system_header_dir} != x; then
+    ma_msg_suffix=", disabled auto check (configured with --native-system-header-dir)"
+    enable_multiarch=no
+  fi
+  if test x$host != x$target && test "x$with_sysroot" = x; then
+    ma_msg_suffix=", disabled auto check (cross build configured without --with-sysroot)"
+    enable_multiarch=no
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multiarch configuration" >&5
+$as_echo_n "checking for multiarch configuration... " >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_multiarch$ma_msg_suffix" >&5
+$as_echo "$enable_multiarch$ma_msg_suffix" >&6; }
+
+# needed for setting the multiarch name for soft-float/hard-float ABIs
+
+
+
 # Enable __cxa_atexit for C++.
 # Check whether --enable-__cxa_atexit was given.
 if test "${enable___cxa_atexit+set}" = set; then :
@@ -7027,8 +7079,9 @@ else
 
   case $target in
     powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
+    i?86*-*-gnu* | \
     i?86*-*-mingw* | x86_64*-*-mingw* | \
-    i?86*-*-cygwin*)
+    i?86*-*-cygwin* | x86_64*-*-cygwin*)
       enable_decimal_float=yes
       ;;
     *)
@@ -7093,16 +7146,7 @@ else
       ;;
 
     mips*-*-*)
-      case $host in
-       mips*-sgi-irix*)
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fixed-point is not supported on IRIX, ignored" >&5
-$as_echo "$as_me: WARNING: fixed-point is not supported on IRIX, ignored" >&2;}
-         enable_fixed_point=no
-         ;;
-       *)
-         enable_fixed_point=yes
-         ;;
-      esac
+      enable_fixed_point=yes
       ;;
     *)
       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fixed-point is not supported for this target, ignored" >&5
@@ -7219,6 +7263,17 @@ fi
 
 
 
+if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+else
+ test_prefix=$prefix
+fi
+if test "x$exec_prefix" = xNONE; then
+ test_exec_prefix=$test_prefix
+else
+ test_exec_prefix=$exec_prefix
+fi
+
 
 # Check whether --with-sysroot was given.
 if test "${with_sysroot+set}" = set; then :
@@ -7231,16 +7286,6 @@ if test "${with_sysroot+set}" = set; then :
  TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
  CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
 
- if test "x$prefix" = xNONE; then
-  test_prefix=/usr/local
- else
-  test_prefix=$prefix
- fi
- if test "x$exec_prefix" = xNONE; then
-  test_exec_prefix=$test_prefix
- else
-  test_exec_prefix=$exec_prefix
- fi
  case ${TARGET_SYSTEM_ROOT} in
  "${test_prefix}"|"${test_prefix}/"*|\
  "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
@@ -8247,7 +8292,7 @@ fi
 for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
                 fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
                 sys/resource.h sys/param.h sys/times.h sys/stat.h \
-                direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h
+                direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h libintl.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_preproc "$LINENO" "$ac_header" "$as_ac_Header"
@@ -9153,7 +9198,7 @@ else
    # read() to the same fd.  The only system known to have a problem here
    # is VMS, where text files have record structure.
    case "$host_os" in
-     vms* | ultrix*)
+     *vms* | ultrix*)
         gcc_cv_func_mmap_file=no ;;
      *)
         gcc_cv_func_mmap_file=yes;;
@@ -9177,7 +9222,7 @@ else
    # Systems known to be in this category are Windows (all variants),
    # VMS, and Darwin.
    case "$host_os" in
-     vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
+     *vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
         gcc_cv_func_mmap_dev_zero=no ;;
      *)
         gcc_cv_func_mmap_dev_zero=yes;;
@@ -9234,7 +9279,7 @@ else
    # above for use of /dev/zero.
    # Systems known to be in this category are Windows, VMS, and SCO Unix.
    case "$host_os" in
-     vms* | cygwin* | pe | mingw* | sco* | udk* )
+     *vms* | cygwin* | pe | mingw* | sco* | udk* )
         gcc_cv_func_mmap_anon=no ;;
      *)
         gcc_cv_func_mmap_anon=yes;;
@@ -9497,6 +9542,12 @@ fi
 
 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
 # iconv() prototype.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
 
       if test "X$prefix" = "XNONE"; then
     acl_final_prefix="$ac_default_prefix"
   fi
 
 
-if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then :
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
 
 
 
@@ -10200,169 +10244,12 @@ _ACEOF
 
   fi
 
-   ac_ext=c
+ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-else
-
-
-
-
-
-          am_save_CPPFLAGS="$CPPFLAGS"
-
-  for element in $INCICONV; do
-    haveit=
-    for x in $CPPFLAGS; do
-
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
-
-      if test "X$x" = "X$element"; then
-        haveit=yes
-        break
-      fi
-    done
-    if test -z "$haveit"; then
-      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
-    fi
-  done
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
-$as_echo_n "checking for iconv... " >&6; }
-if test "${am_cv_func_iconv+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    am_cv_func_iconv="no, consider installing GNU libiconv"
-    am_cv_lib_iconv=no
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <iconv.h>
-int
-main ()
-{
-iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  am_cv_func_iconv=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    if test "$am_cv_func_iconv" != yes; then
-      am_save_LIBS="$LIBS"
-      LIBS="$LIBS $LIBICONV"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <iconv.h>
-int
-main ()
-{
-iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  am_cv_lib_iconv=yes
-        am_cv_func_iconv=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-      LIBS="$am_save_LIBS"
-    fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
-$as_echo "$am_cv_func_iconv" >&6; }
-  if test "$am_cv_func_iconv" = yes; then
-
-$as_echo "#define HAVE_ICONV 1" >>confdefs.h
-
-  fi
-  if test "$am_cv_lib_iconv" = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
-$as_echo_n "checking how to link with libiconv... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
-$as_echo "$LIBICONV" >&6; }
-  else
-            CPPFLAGS="$am_save_CPPFLAGS"
-    LIBICONV=
-    LTLIBICONV=
-  fi
-
-
-
-  if test "$am_cv_func_iconv" = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5
-$as_echo_n "checking for iconv declaration... " >&6; }
-    if test "${am_cv_proto_iconv+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdlib.h>
-#include <iconv.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || defined(__cplusplus)
-size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  am_cv_proto_iconv_arg1=""
-else
-  am_cv_proto_iconv_arg1="const"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
-fi
-
-    am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:-
-         }$am_cv_proto_iconv" >&5
-$as_echo "${ac_t:-
-         }$am_cv_proto_iconv" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define ICONV_CONST $am_cv_proto_iconv_arg1
-_ACEOF
-
-  fi
-
-fi
 
 # Until we have in-tree GNU iconv:
 LIBICONV_DEP=
@@ -10439,13 +10326,13 @@ $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
 
 # We will need to find libiberty.h and ansidecl.h
 saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
+CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC"
 saved_CXXFLAGS="$CXXFLAGS"
-CXXFLAGS="$CXXFLAGS -I${srcdir} -I${srcdir}/../include"
+CXXFLAGS="$CXXFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC"
 for ac_func in getenv atol asprintf sbrk abort atof getcwd getwd \
        strsignal strstr stpcpy strverscmp \
        errno snprintf vsnprintf vasprintf malloc realloc calloc \
-       free basename getopt clock getpagesize clearerr_unlocked feof_unlocked   ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked   fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked   fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked   putchar_unlocked putc_unlocked
+       free basename getopt clock getpagesize ffs clearerr_unlocked feof_unlocked   ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked   fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked   fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked   putchar_unlocked putc_unlocked
 do
   ac_tr_decl=`$as_echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func is declared" >&5
@@ -10748,14 +10635,13 @@ done
 
 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which hides the madvise()
 # prototype.
-if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then :
-  ac_ext=cpp
+ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-   for ac_func in madvise
+for ac_func in madvise
 do
   ac_tr_decl=`$as_echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func is declared" >&5
@@ -10768,8 +10654,8 @@ else
 #undef $ac_tr_decl
 #define $ac_tr_decl 1
 
-     #include "ansidecl.h"
-     #include "system.h"
+  #include "ansidecl.h"
+  #include "system.h"
 
 
 int
 
 done
 
-   ac_ext=c
+ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-else
-  for ac_func in madvise
-do
-  ac_tr_decl=`$as_echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func is declared" >&5
-$as_echo_n "checking whether $ac_func is declared... " >&6; }
-if { as_var=gcc_cv_have_decl_$ac_func; eval "test \"\${$as_var+set}\" = set"; }; then :
+
+# More time-related stuff.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct tms" >&5
+$as_echo_n "checking for struct tms... " >&6; }
+if test "${ac_cv_struct_tms+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#undef $ac_tr_decl
-#define $ac_tr_decl 1
-
-     #include "ansidecl.h"
-     #include "system.h"
 
-
-int
-main ()
-{
-#ifndef $ac_func
-char *(*pfn) = (char *(*)) $ac_func ;
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "gcc_cv_have_decl_$ac_func=yes"
-else
-  eval "gcc_cv_have_decl_$ac_func=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; } ; cat >>confdefs.h <<_ACEOF
-#define $ac_tr_decl 1
-_ACEOF
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; } ; cat >>confdefs.h <<_ACEOF
-#define $ac_tr_decl 0
-_ACEOF
-
-fi
-
-done
-
-
-fi
-
-# More time-related stuff.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct tms" >&5
-$as_echo_n "checking for struct tms... " >&6; }
-if test "${ac_cv_struct_tms+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 #include "ansidecl.h"
 #include "system.h"
@@ -10943,160 +10775,49 @@ $as_echo "#define HAVE_CLOCK_T 1" >>confdefs.h
 
 fi
 
-# Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
-CFLAGS="$saved_CFLAGS"
-CXXFLAGS="$saved_CXXFLAGS"
-
-# Check whether --enable-initfini-array was given.
-if test "${enable_initfini_array+set}" = set; then :
-  enableval=$enable_initfini_array;
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .preinit_array/.init_array/.fini_array support" >&5
-$as_echo_n "checking for .preinit_array/.init_array/.fini_array support... " >&6; }
-if test "${gcc_cv_initfini_array+set}" = set; then :
+# Check if F_SETLKW is supported by fcntl.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for F_SETLKW" >&5
+$as_echo_n "checking for F_SETLKW... " >&6; }
+if test "${ac_cv_f_setlkw+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-    if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then
-    if test "$cross_compiling" = yes; then :
-  gcc_cv_initfini_array=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#ifndef __ELF__
-#error Not an ELF OS
-#endif
-#ifdef __ia64__
-/* We turn on .preinit_array/.init_array/.fini_array support for ia64
-   if it can be used.  */
-static int x = -1;
-int main (void) { return x; }
-int foo (void) { x = 0; }
-int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
-#else
-extern void abort ();
-static int count;
-
-static void
-init1005 ()
-{
-  if (count != 0)
-    abort ();
-  count = 1005;
-}
-void (*const init_array1005) ()
-  __attribute__ ((section (".init_array.01005"), aligned (sizeof (void *))))
-  = { init1005 };
-static void
-fini1005 ()
-{
-  if (count != 1005)
-    abort ();
-}
-void (*const fini_array1005) ()
-  __attribute__ ((section (".fini_array.01005"), aligned (sizeof (void *))))
-  = { fini1005 };
-
-static void
-ctor1007 ()
-{
-  if (count != 1005)
-    abort ();
-  count = 1007;
-}
-void (*const ctors1007) ()
-  __attribute__ ((section (".ctors.64528"), aligned (sizeof (void *))))
-  = { ctor1007 };
-static void
-dtor1007 ()
-{
-  if (count != 1007)
-    abort ();
-  count = 1005;
-}
-void (*const dtors1007) ()
-  __attribute__ ((section (".dtors.64528"), aligned (sizeof (void *))))
-  = { dtor1007 };
-
-static void
-init65530 ()
-{
-  if (count != 1007)
-    abort ();
-  count = 65530;
-}
-void (*const init_array65530) ()
-  __attribute__ ((section (".init_array.65530"), aligned (sizeof (void *))))
-  = { init65530 };
-static void
-fini65530 ()
-{
-  if (count != 65530)
-    abort ();
-  count = 1007;
-}
-void (*const fini_array65530) ()
-  __attribute__ ((section (".fini_array.65530"), aligned (sizeof (void *))))
-  = { fini65530 };
-
-static void
-ctor65535 ()
-{
-  if (count != 65530)
-    abort ();
-  count = 65535;
-}
-void (*const ctors65535) ()
-  __attribute__ ((section (".ctors"), aligned (sizeof (void *))))
-  = { ctor65535 };
-static void
-dtor65535 ()
-{
-  if (count != 65535)
-    abort ();
-  count = 65530;
-}
-void (*const dtors65535) ()
-  __attribute__ ((section (".dtors"), aligned (sizeof (void *))))
-  = { dtor65535 };
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <fcntl.h>
 int
 main ()
 {
-  if (count != 65535)
-    abort ();
+
+struct flock fl;
+fl.l_whence = 0;
+fl.l_start = 0;
+fl.l_len = 0;
+fl.l_pid = 0;
+return fcntl (1, F_SETLKW, &fl);
+  ;
   return 0;
 }
-#endif
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gcc_cv_initfini_array=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_f_setlkw=yes
 else
-  gcc_cv_initfini_array=no
+  ac_cv_f_setlkw=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f_setlkw" >&5
+$as_echo "$ac_cv_f_setlkw" >&6; }
+if test $ac_cv_f_setlkw = yes; then
 
-   else
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking cross compile... guessing" >&5
-$as_echo_n "checking cross compile... guessing... " >&6; }
-     gcc_cv_initfini_array=no
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_initfini_array" >&5
-$as_echo "$gcc_cv_initfini_array" >&6; }
-  enable_initfini_array=$gcc_cv_initfini_array
+$as_echo "#define HOST_HAS_F_SETLKW 1" >>confdefs.h
 
 fi
 
-if test $enable_initfini_array = yes; then
-
-$as_echo "#define HAVE_INITFINI_ARRAY 1" >>confdefs.h
-
-fi
+# Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
+CFLAGS="$saved_CFLAGS"
+CXXFLAGS="$saved_CXXFLAGS"
 
 # mkdir takes a single argument on some systems.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if mkdir takes one argument" >&5
@@ -11216,6 +10937,11 @@ if test x"$tmake_file" = x
 then tmake_file=$cpu_type/t-$cpu_type
 fi
 
+# Support --enable-initfini-array.
+if test x$enable_initfini_array != xno; then
+  tm_file="${tm_file} initfini-array.h"
+fi
+
 if test x"$dwarf2" = xyes
 then tm_file="$tm_file tm-dwarf2.h"
 fi
@@ -11282,6 +11008,20 @@ $as_echo "#define USE_LONG_LONG_FOR_WIDEST_FAST_INT 1" >>confdefs.h
 
 fi
 
+gnu_ld_bool=`if test x"$gnu_ld" = x"yes"; then echo 1; else echo 0; fi`
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GNU_LD $gnu_ld_bool
+_ACEOF
+
+
+gnu_as_bool=`if test x"$gas" = x"yes"; then echo 1; else echo 0; fi`
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GNU_AS $gnu_as_bool
+_ACEOF
+
+
 count=a
 for f in $host_xm_file; do
        count=${count}x
@@ -11398,6 +11138,9 @@ if test x$enable___cxa_atexit = xyes || \
       *-*-mingw32*)
        use_cxa_atexit=yes
        ;;
+      powerpc-ibm-aix*)
+       use_cxa_atexit=yes
+       ;;
       *)
        ac_fn_c_check_func "$LINENO" "__cxa_atexit" "ac_cv_func___cxa_atexit"
 if test "x$ac_cv_func___cxa_atexit" = x""yes; then :
@@ -11952,7 +11695,9 @@ fi
 
 # These are the normal (build=host) settings:
 CC_FOR_BUILD='$(CC)'
+CXX_FOR_BUILD='$(CXX)'
 BUILD_CFLAGS='$(ALL_CFLAGS)'
+BUILD_CXXFLAGS='$(ALL_CXXFLAGS)'
 BUILD_LDFLAGS='$(LDFLAGS)'
 STMP_FIXINC=stmp-fixinc
 
@@ -13863,7 +13608,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
            LD="${LD-ld} -m elf_i386_fbsd"
            ;;
          x86_64-*linux*)
-           LD="${LD-ld} -m elf_i386"
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
            ;;
          ppc64-*linux*|powerpc64-*linux*)
            LD="${LD-ld} -m elf32ppclinux"
@@ -15131,6 +14883,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
        # AIX 5 now supports IA64 processor
        lt_prog_compiler_static='-Bstatic'
       fi
+      lt_prog_compiler_pic='-fPIC'
       ;;
 
     amigaos*)
@@ -18077,7 +17830,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18080 "configure"
+#line 17833 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18183,7 +17936,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18186 "configure"
+#line 17939 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19980,6 +19733,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
        # AIX 5 now supports IA64 processor
        lt_prog_compiler_static_CXX='-Bstatic'
       fi
+      lt_prog_compiler_pic_CXX='-fPIC'
       ;;
 
     amigaos*)
@@ -21528,11 +21282,15 @@ for f in $gcc_cv_as_bfd_srcdir/configure \
          $gcc_cv_as_gas_srcdir/configure \
          $gcc_cv_as_gas_srcdir/configure.in \
          $gcc_cv_as_gas_srcdir/Makefile.in ; do
-  gcc_cv_gas_version=`sed -n -e 's/^[  ]*\(VERSION=[0-9]*\.[0-9]*.*\)/\1/p' < $f`
+  gcc_cv_gas_version=`sed -n -e 's/^[  ]*VERSION=[^0-9A-Za-z_]*\([0-9]*\.[0-9]*.*\)/VERSION=\1/p' < $f`
   if test x$gcc_cv_gas_version != x; then
     break
   fi
 done
+case $gcc_cv_gas_version in
+  VERSION=[0-9]*) ;;
+  *) as_fn_error "cannot find version of in-tree assembler" "$LINENO" 5;;
+esac
 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
 gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
 fi
 
 ORIGINAL_PLUGIN_LD_FOR_TARGET=$gcc_cv_ld
-PLUGIN_LD=`basename $gcc_cv_ld`
+PLUGIN_LD_SUFFIX=`basename $gcc_cv_ld | sed -e "s,$target_alias-,,"`
+# if the PLUGIN_LD is set ld-new, just have it as ld
+# as that is the installed named.
+if test x$PLUGIN_LD_SUFFIX = xld-new \
+   || test x$PLUGIN_LD_SUFFIX = xcollect-ld ; then
+  PLUGIN_LD_SUFFIX=ld
+fi
 
 # Check whether --with-plugin-ld was given.
 if test "${with_plugin_ld+set}" = set; then :
   withval=$with_plugin_ld; if test x"$withval" != x; then
    ORIGINAL_PLUGIN_LD_FOR_TARGET="$withval"
-   PLUGIN_LD="$withval"
+   PLUGIN_LD_SUFFIX=`echo $withval | sed -e "s,$target_alias-,,"`
  fi
 fi
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define PLUGIN_LD "$PLUGIN_LD"
+#define PLUGIN_LD_SUFFIX "$PLUGIN_LD_SUFFIX"
 _ACEOF
 
 
@@ -21686,11 +21450,15 @@ $as_echo "newly built ld" >&6; }
        fi
        for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
        do
-               gcc_cv_gld_version=`sed -n -e 's/^[     ]*\(VERSION=[0-9]*\.[0-9]*.*\)/\1/p' < $f`
+               gcc_cv_gld_version=`sed -n -e 's/^[     ]*VERSION=[^0-9A-Za-z_]*\([0-9]*\.[0-9]*.*\)/VERSION=\1/p' < $f`
                if test x$gcc_cv_gld_version != x; then
                        break
                fi
        done
+       case $gcc_cv_gld_version in
+         VERSION=[0-9]*) ;;
+         *) as_fn_error "cannot find version of in-tree linker" "$LINENO" 5 ;;
+       esac
        gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
        gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
 else
@@ -22289,11 +22057,14 @@ else
   enable_gnu_indirect_function="$default_gnu_indirect_function"
 fi
 
-if test x$enable_gnu_indirect_function = xyes; then
 
-$as_echo "#define HAVE_GNU_INDIRECT_FUNCTION 1" >>confdefs.h
+gif=`if test x$enable_gnu_indirect_function = xyes; then echo 1; else echo 0; fi`
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GNU_INDIRECT_FUNCTION $gif
+_ACEOF
+
 
-fi
 
 if test $in_tree_ld != yes ; then
   ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q`
@@ -22321,15 +22092,11 @@ if test $in_tree_ld != yes ; then
   else
     case "${target}" in
       *-*-solaris2*)
+       # See acinclude.m4 (gcc_SUN_LD_VERSION) for the version number
+       # format.
        #
-       # Solaris 2 ld -V output looks like this for a regular version:
-       #
-       # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1699
-       #
-       # but test versions add stuff at the end:
-       #
-       # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10
-       #
+       # Don't reuse gcc_gv_sun_ld_vers_* in case a linker other than
+       # /usr/ccs/bin/ld has been configured.
        ld_ver=`$gcc_cv_ld -V 2>&1`
        if echo "$ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
          ld_vers=`echo $ld_ver | sed -n \
@@ -22358,6 +22125,12 @@ else
   if test x"$ld_is_gold" = xyes; then
     :
   elif echo "$ld_ver" | grep GNU > /dev/null; then
+    case "${target}" in
+      mmix-knuth-mmixware)
+        # The linker emits by default mmo, not ELF, so "no" is appropriate.
+       gcc_cv_ld_hidden=no
+       ;;
+    esac
     if test 0"$ld_date" -lt 20020404; then
       if test -n "$ld_date"; then
        # If there was date string, but was earlier than 2002-04-04, fail
@@ -22385,15 +22158,6 @@ else
       hppa64*-*-hpux* | ia64*-*-hpux*)
        gcc_cv_ld_hidden=yes
        ;;
-      *-*-solaris2.8*)
-        # .hidden support was backported to Solaris 8, starting with ld
-       # version 1.276.
-       if test "$ld_vers_minor" -ge 276; then
-         gcc_cv_ld_hidden=yes
-       else
-         gcc_cv_ld_hidden=no
-       fi
-       ;;
       *-*-solaris2.9* | *-*-solaris2.1[0-9]*)
        # Support for .hidden in Sun ld appeared in Solaris 9 FCS, but
        # .symbolic was only added in Solaris 9 12/02.
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_ro_rw_mix" >&5
 $as_echo "$gcc_cv_ld_ro_rw_mix" >&6; }
 
-# Check if we have .[us]leb128, and support symbol arithmetic with it.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .sleb128 and .uleb128" >&5
-$as_echo_n "checking assembler for .sleb128 and .uleb128... " >&6; }
-if test "${gcc_cv_as_leb128+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  gcc_cv_as_leb128=no
-    if test $in_tree_gas = yes; then
-    if test $in_tree_gas_is_elf = yes \
-  && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
-  then gcc_cv_as_leb128=yes
-fi
-  elif test x$gcc_cv_as != x; then
-    $as_echo ' .data
-       .uleb128 L2 - L1
-L1:
-       .uleb128 1280
-       .sleb128 -1010
-L2:' > conftest.s
-    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }
-    then
-       # GAS versions before 2.11 do not support uleb128,
-  # despite appearing to.
-  # ??? There exists an elf-specific test that will crash
-  # the assembler.  Perhaps it's better to figure out whether
-  # arbitrary sections are supported and try the test.
-  as_ver=`$gcc_cv_as --version 2>/dev/null | sed 1q`
-  if echo "$as_ver" | grep GNU > /dev/null; then
-    as_vers=`echo $as_ver | sed -n \
-       -e 's,^.*[       ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'`
-    as_major=`expr "$as_vers" : '\([0-9]*\)'`
-    as_minor=`expr "$as_vers" : '[0-9]*\.\([0-9]*\)'`
-    if test $as_major -eq 2 && test $as_minor -lt 11
-    then :
-    else gcc_cv_as_leb128=yes
-    fi
-  fi
-    else
-      echo "configure: failed program was" >&5
-      cat conftest.s >&5
-    fi
-    rm -f conftest.o conftest.s
-  fi
+if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then
+  case "${target}" in
+    *-*-solaris2*)
+      #
+      # Solaris 2 ld -V output looks like this for a regular version:
+      #
+      # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1699
+      #
+      # but test versions add stuff at the end:
+      #
+      # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10
+      #
+      gcc_cv_sun_ld_ver=`/usr/ccs/bin/ld -V 2>&1`
+      if echo "$gcc_cv_sun_ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
+       gcc_cv_sun_ld_vers=`echo $gcc_cv_sun_ld_ver | sed -n \
+         -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'`
+       gcc_cv_sun_ld_vers_major=`expr "$gcc_cv_sun_ld_vers" : '\([0-9]*\)'`
+       gcc_cv_sun_ld_vers_minor=`expr "$gcc_cv_sun_ld_vers" : '[0-9]*\.\([0-9]*\)'`
+      fi
+      ;;
+  esac
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_leb128" >&5
-$as_echo "$gcc_cv_as_leb128" >&6; }
-if test $gcc_cv_as_leb128 = yes; then
-
-$as_echo "#define HAVE_AS_LEB128 1" >>confdefs.h
 
-fi
+# Check whether --enable-initfini-array was given.
+if test "${enable_initfini_array+set}" = set; then :
+  enableval=$enable_initfini_array;
+else
 
-# Check if we have assembler support for unwind directives.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for cfi directives" >&5
-$as_echo_n "checking assembler for cfi directives... " >&6; }
-if test "${gcc_cv_as_cfi_directive+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .preinit_array/.init_array/.fini_array support" >&5
+$as_echo_n "checking for .preinit_array/.init_array/.fini_array support... " >&6; }
+if test "${gcc_cv_initfini_array+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-  gcc_cv_as_cfi_directive=no
-  if test x$gcc_cv_as != x; then
-    $as_echo ' .text
-       .cfi_startproc
-       .cfi_offset 0, 0
-       .cfi_same_value 1
-       .cfi_def_cfa 1, 2
-       .cfi_escape 1, 2, 3, 4, 5
-       .cfi_endproc' > conftest.s
-    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
+    if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then
+    case "${target}" in
+      ia64-*)
+       if test "$cross_compiling" = yes; then :
+  gcc_cv_initfini_array=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifndef __ELF__
+#error Not an ELF OS
+#endif
+/* We turn on .preinit_array/.init_array/.fini_array support for ia64
+   if it can be used.  */
+static int x = -1;
+int main (void) { return x; }
+int foo (void) { x = 0; }
+int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gcc_cv_initfini_array=yes
+else
+  gcc_cv_initfini_array=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+;;
+      *)
+       gcc_cv_initfini_array=no
+       if test $in_tree_ld = yes ; then
+         if test "$gcc_cv_gld_major_version" -eq 2 \
+            -a "$gcc_cv_gld_minor_version" -ge 22 \
+            -o "$gcc_cv_gld_major_version" -gt 2 \
+            && test $in_tree_ld_is_elf = yes; then
+           gcc_cv_initfini_array=yes
+         fi
+       elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
+         cat > conftest.s <<\EOF
+.section .dtors,"a",%progbits
+.balign 4
+.byte 'A', 'A', 'A', 'A'
+.section .ctors,"a",%progbits
+.balign 4
+.byte 'B', 'B', 'B', 'B'
+.section .fini_array.65530,"a",%progbits
+.balign 4
+.byte 'C', 'C', 'C', 'C'
+.section .init_array.65530,"a",%progbits
+.balign 4
+.byte 'D', 'D', 'D', 'D'
+.section .dtors.64528,"a",%progbits
+.balign 4
+.byte 'E', 'E', 'E', 'E'
+.section .ctors.64528,"a",%progbits
+.balign 4
+.byte 'F', 'F', 'F', 'F'
+.section .fini_array.01005,"a",%progbits
+.balign 4
+.byte 'G', 'G', 'G', 'G'
+.section .init_array.01005,"a",%progbits
+.balign 4
+.byte 'H', 'H', 'H', 'H'
+.text
+.globl _start
+_start:
+EOF
+         if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
+            && $gcc_cv_ld -o conftest conftest.o > /dev/null 2>&1 \
+            && $gcc_cv_objdump -s -j .init_array conftest \
+               | grep HHHHFFFFDDDDBBBB > /dev/null 2>&1 \
+            && $gcc_cv_objdump -s -j .fini_array conftest \
+               | grep GGGGEEEECCCCAAAA > /dev/null 2>&1; then
+           gcc_cv_initfini_array=yes
+         fi
+         rm -f conftest conftest.*
+       fi
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifndef __ELF__
+# error Not an ELF OS
+#endif
+#include <stdlib.h>
+#if defined __GLIBC_PREREQ
+# if __GLIBC_PREREQ (2, 4)
+# else
+#  error GLIBC 2.4 required
+# endif
+#else
+# if defined __sun__ && defined __svr4__
+   /* Solaris ld.so.1 supports .init_array/.fini_array since Solaris 8.  */
+# else
+#  error The C library not known to support .init_array/.fini_array
+# endif
+#endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  gcc_cv_initfini_array=no
+fi
+rm -f conftest.err conftest.$ac_ext;;
+    esac
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking cross compile... guessing" >&5
+$as_echo_n "checking cross compile... guessing... " >&6; }
+    gcc_cv_initfini_array=no
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_initfini_array" >&5
+$as_echo "$gcc_cv_initfini_array" >&6; }
+  enable_initfini_array=$gcc_cv_initfini_array
+
+fi
+
+if test $enable_initfini_array = yes; then
+
+$as_echo "#define HAVE_INITFINI_ARRAY_SUPPORT 1" >>confdefs.h
+
+fi
+
+# Check if we have .[us]leb128, and support symbol arithmetic with it.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .sleb128 and .uleb128" >&5
+$as_echo_n "checking assembler for .sleb128 and .uleb128... " >&6; }
+if test "${gcc_cv_as_leb128+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_leb128=no
+    if test $in_tree_gas = yes; then
+    if test $in_tree_gas_is_elf = yes \
+  && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
+  then gcc_cv_as_leb128=yes
+fi
+  elif test x$gcc_cv_as != x; then
+    $as_echo ' .data
+       .uleb128 L2 - L1
+L1:
+       .uleb128 1280
+       .sleb128 -1010
+L2:' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       # GAS versions before 2.11 do not support uleb128,
+  # despite appearing to.
+  # ??? There exists an elf-specific test that will crash
+  # the assembler.  Perhaps it's better to figure out whether
+  # arbitrary sections are supported and try the test.
+  as_ver=`$gcc_cv_as --version 2>/dev/null | sed 1q`
+  if echo "$as_ver" | grep GNU > /dev/null; then
+    as_vers=`echo $as_ver | sed -n \
+       -e 's,^.*[       ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'`
+    as_major=`expr "$as_vers" : '\([0-9]*\)'`
+    as_minor=`expr "$as_vers" : '[0-9]*\.\([0-9]*\)'`
+    if test $as_major -eq 2 && test $as_minor -lt 11
+    then :
+    else gcc_cv_as_leb128=yes
+    fi
+  fi
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_leb128" >&5
+$as_echo "$gcc_cv_as_leb128" >&6; }
+if test $gcc_cv_as_leb128 = yes; then
+
+$as_echo "#define HAVE_AS_LEB128 1" >>confdefs.h
+
+fi
+
+# Check if we have assembler support for unwind directives.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for cfi directives" >&5
+$as_echo_n "checking assembler for cfi directives... " >&6; }
+if test "${gcc_cv_as_cfi_directive+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_cfi_directive=no
+  if test x$gcc_cv_as != x; then
+    $as_echo ' .text
+       .cfi_startproc
+       .cfi_offset 0, 0
+       .cfi_same_value 1
+       .cfi_def_cfa 1, 2
+       .cfi_escape 1, 2, 3, 4, 5
+       .cfi_endproc' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
     then
@@ -22967,6 +22888,9 @@ $as_echo "$gcc_cv_as_comdat_group_percent" >&6; }
  if test $gcc_cv_as_comdat_group_percent = yes; then
    gcc_cv_as_comdat_group_group=no
  else
+   if test -z "${gcc_cv_as_comdat_group_group+set}"; then
+     gcc_cv_as_comdat_group_group=no
+   fi
    case "${target}" in
      # Sun as uses a completely different syntax.
      *-*-solaris2*)
@@ -23286,6 +23210,18 @@ foo:   data8   25
        tls_first_minor=13
        tls_as_opt=--fatal-warnings
        ;;
+  microblaze*-*-*)
+    conftest_s='
+       .section .tdata,"awT",@progbits
+x:
+       .word 2
+       .text
+       addik r5,r20,x@TLSGD
+       addik r5,r20,x@TLSLDM'
+       tls_first_major=2
+       tls_first_minor=20
+       tls_as_opt='--fatal-warnings'
+       ;;
   mips*-*-*)
     conftest_s='
        .section .tdata,"awT",@progbits
@@ -23319,6 +23255,37 @@ foo:
        tls_first_minor=19
        tls_as_opt='--fatal-warnings'
        ;;
+  aarch64*-*-*)
+    conftest_s='
+       .section ".tdata","awT",%progbits
+foo:   .long   25
+       .text
+       adrp  x0, :tlsgd:x
+       add   x0, x0, #:tlsgd_lo12:x
+        bl    __tls_get_addr
+       nop'
+       tls_first_major=2
+       tls_first_minor=20
+       tls_as_opt='--fatal-warnings'
+       ;;
+  powerpc-ibm-aix*)
+    conftest_s='
+       .extern __get_tpointer
+       .toc
+LC..1:
+       .tc a[TC],a[TL]@le
+       .csect .text[PR]
+.tlstest:
+       lwz 9,LC..1(2)
+       bla __get_tpointer
+       lwzx 3,9,3
+       .globl a
+       .csect a[TL],4
+a:
+       .space 4'
+       tls_first_major=0
+       tls_first_minor=0
+       ;;
   powerpc-*-*)
     conftest_s='
        .section ".tdata","awT",@progbits
@@ -23474,6 +23441,37 @@ foo:   .long   25
        xor     %l1, %tle_lox10(foo), %o5
        ld      [%g7 + %o5], %o1"
        ;;
+  tilepro*-*-*)
+      conftest_s='
+       .section ".tdata","awT",@progbits
+foo:   .long   25
+       .text
+       addli   r0, zero, tls_gd(foo)
+       auli    r0, zero, tls_gd_ha16(foo)
+       addli   r0, r0, tls_gd_lo16(foo)
+       jal     __tls_get_addr
+       addli   r0, zero, tls_ie(foo)
+       auli    r0, r0, tls_ie_ha16(foo)
+       addli   r0, r0, tls_ie_lo16(foo)'
+       tls_first_major=2
+       tls_first_minor=22
+       tls_as_opt="--fatal-warnings"
+       ;;
+  tilegx*-*-*)
+      conftest_s='
+       .section ".tdata","awT",@progbits
+foo:   .long   25
+       .text
+       shl16insli r0, zero, hw0_last_tls_gd(foo)
+       shl16insli r0, zero, hw1_last_tls_gd(foo)
+       shl16insli r0, r0,   hw0_tls_gd(foo)
+       jal        __tls_get_addr
+       shl16insli r0, zero, hw1_last_tls_ie(foo)
+       shl16insli r0, r0,   hw0_tls_ie(foo)'
+       tls_first_major=2
+       tls_first_minor=22
+       tls_as_opt="--fatal-warnings"
+       ;;
   xtensa*-*-*)
     conftest_s='
        .section ".tdata","awT",@progbits
@@ -23528,20 +23526,9 @@ if test $gcc_cv_as_tls = yes; then
 fi
 fi
 case "$target" in
-  *-*-irix6*)
-    # IRIX 6.5 rld and libc.so lack TLS support, so even if gas and gld
-    # with TLS support are in use, native TLS cannot work.
-    set_have_as_tls=no
-    ;;
-  *-*-osf*)
-    # Tru64 UNIX loader and libc.so lack TLS support, so even if gas and
-    # gld with TLS support are in use, native TLS cannot work.
-    set_have_as_tls=no
-    ;;
-  # TLS was introduced in the Solaris 9 FCS release and backported to
-  # Solaris 8 patches.  Support for GNU-style TLS on x86 was only
-  # introduced in Solaris 9 4/04, replacing the earlier Sun style that Sun
-  # ld and GCC don't support any longer.
+  # TLS was introduced in the Solaris 9 FCS release.  Support for GNU-style
+  # TLS on x86 was only introduced in Solaris 9 4/04, replacing the earlier
+  # Sun style that Sun ld and GCC don't support any longer.
   *-*-solaris2.*)
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker and ld.so.1 TLS support" >&5
 $as_echo_n "checking linker and ld.so.1 TLS support... " >&6; }
@@ -23553,14 +23540,6 @@ $as_echo_n "checking linker and ld.so.1 TLS support... " >&6; }
       ld_tls_support=yes
     else
       case "$target" in
-        # Solaris 8/x86 ld has GNU style TLS support since version 1.280.
-        i?86-*-solaris2.8)
-          min_tls_ld_vers_minor=280
-          ;;
-        # Solaris 8/SPARC ld has TLS support since version 1.272.
-        sparc*-*-solaris2.8)
-          min_tls_ld_vers_minor=272
-          ;;
        # Solaris 9/x86 ld has GNU style TLS support since version 1.374.
         i?86-*-solaris2.9)
           min_tls_ld_vers_minor=374
@@ -23585,33 +23564,6 @@ $as_echo "$ld_tls_support" >&6; }
     LIBS=
     LDFLAGS=
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking alternate thread library" >&5
-$as_echo_n "checking alternate thread library... " >&6; }
-    case "$target" in
-      # TLS support was backported to Solaris 8 patches, but only lives in
-      # the alternate thread library which became the default in Solaris 9.
-      # We want to always use that, irrespective of TLS support.
-      *-*-solaris2.8)
-        # Take multilib subdir into account.  There's no spec to handle
-       # this.  The 64 symlink exists since Solaris 8.
-        lwp_dir=/usr/lib/lwp
-       lwp_spec="-L$lwp_dir%{m64:/64} -R$lwp_dir%{m64:/64}"
-        LDFLAGS="-L$lwp_dir -R$lwp_dir"
-        ;;
-      *-*-solaris2*)
-        lwp_dir="none"
-       lwp_spec=""
-       ;;
-    esac
-    # Always define LIB_THREAD_LDFLAGS_SPEC, even without TLS support.
-
-cat >>confdefs.h <<_ACEOF
-#define LIB_THREAD_LDFLAGS_SPEC "$lwp_spec"
-_ACEOF
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lwp_dir" >&5
-$as_echo "$lwp_dir" >&6; }
-
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking library containing $tga_func" >&5
 $as_echo_n "checking library containing $tga_func... " >&6; }
     # Before Solaris 10, __tls_get_addr (SPARC/x64) resp. ___tls_get_addr
@@ -23718,12 +23670,12 @@ elif test x$gcc_cv_ld != x; then
       gcc_cv_ld_static_dynamic=yes
   else
     case "$target" in
-      # Tru64 UNIX support -noso/-so_archive instead of -Bstatic/-Bdynamic.
-      alpha*-dec-osf*)
-        gcc_cv_ld_static_dynamic=yes
-       gcc_cv_ld_static_option="-noso"
-       gcc_cv_ld_dynamic_option="-so_archive"
-        ;;
+      # AIX ld uses -b flags
+      *-*-aix4.[23]* | *-*-aix[5-9]*)
+       gcc_cv_ld_static_dynamic=yes
+       gcc_cv_ld_static_option="-bstatic"
+       gcc_cv_ld_dynamic_option="-bdynamic"
+       ;;
       # HP-UX ld uses -a flags to select between shared and archive.
       *-*-hpux*)
        if test x"$gnu_ld" = xno; then
@@ -23732,10 +23684,6 @@ elif test x$gcc_cv_ld != x; then
          gcc_cv_ld_dynamic_option="-adefault"
        fi
        ;;
-      # IRIX 6 ld supports -Bstatic/-Bdynamic.
-      mips-sgi-irix6*)
-        gcc_cv_ld_static_dynamic=yes
-        ;;
       # Solaris 2 ld always supports -Bstatic/-Bdynamic.
       *-*-solaris2*)
         gcc_cv_ld_static_dynamic=yes
@@ -23844,7 +23792,7 @@ $as_echo "$gcc_cv_lto_plugin" >&6; }
 
 case "$target" in
   # All TARGET_ABI_OSF targets.
-  alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
+  alpha*-*-linux* | alpha*-*-*bsd*)
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for explicit relocation support" >&5
 $as_echo_n "checking assembler for explicit relocation support... " >&6; }
 if test "${gcc_cv_as_alpha_explicit_relocs+set}" = set; then :
@@ -23999,6 +23947,39 @@ $as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h
 
 fi
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for #nobits" >&5
+$as_echo_n "checking assembler for #nobits... " >&6; }
+if test "${gcc_cv_as_sparc_nobits+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_sparc_nobits=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '.section "nobits",#alloc,#write,#nobits
+       .section "progbits",#alloc,#write,#progbits' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_sparc_nobits=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_sparc_nobits" >&5
+$as_echo "$gcc_cv_as_sparc_nobits" >&6; }
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_AS_SPARC_NOBITS `if test $gcc_cv_as_sparc_nobits = yes; then echo 1; else echo 0; fi`
+_ACEOF
+
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for -relax option" >&5
 $as_echo_n "checking assembler for -relax option... " >&6; }
 if test "${gcc_cv_as_sparc_relax+set}" = set; then :
@@ -24244,6 +24225,48 @@ if test $gcc_cv_as_sparc_fmaf = yes; then
 
 $as_echo "#define HAVE_AS_FMAF_HPC_VIS3 1" >>confdefs.h
 
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for SPARC4 instructions" >&5
+$as_echo_n "checking assembler for SPARC4 instructions... " >&6; }
+if test "${gcc_cv_as_sparc_sparc4+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_sparc_sparc4=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '.text
+       .register %g2, #scratch
+       .register %g3, #scratch
+       .align 4
+       cxbe %g2, %g3, 1f
+1:     cwbneg %g2, %g3, 1f
+1:     sha1
+       md5
+       aes_kexpand0 %f4, %f6, %f8
+       des_round %f38, %f40, %f42, %f44
+       camellia_f %f54, %f56, %f58, %f60
+       kasumi_fi_xor %f46, %f48, %f50, %f52' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -xarch=sparc4 -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_sparc_sparc4=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_sparc_sparc4" >&5
+$as_echo "$gcc_cv_as_sparc_sparc4" >&6; }
+if test $gcc_cv_as_sparc_sparc4 = yes; then
+
+$as_echo "#define HAVE_AS_SPARC4 1" >>confdefs.h
+
 fi
     ;;
 
@@ -24255,7 +24278,7 @@ fi
        # wrappers to aid in interposing and redirecting operators new, delete,
        # etc., as per n2800 #17.6.4.6 [replacement.functions].  Check if we
        # are configuring for a version of Cygwin that exports the wrappers.
-       if test x$host = x$target; then
+       if test x$host = x$target && test x$host_cpu = xi686; then
          ac_fn_c_check_func "$LINENO" "__wrap__Znaj" "ac_cv_func___wrap__Znaj"
 if test "x$ac_cv_func___wrap__Znaj" = x""yes; then :
   gcc_ac_cygwin_dll_wrappers=yes
@@ -24275,7 +24298,7 @@ _ACEOF
 
     esac
     case $target_os in
-      cygwin* | pe | mingw32*)
+      cygwin* | pe | mingw32* | interix*)
        # Recent binutils allows the three-operand form of ".comm" on PE.  This
        # definition is used unconditionally to initialise the default state of
        # the target option variable that governs usage of the feature.
@@ -24624,6 +24647,70 @@ if test $gcc_cv_as_ix86_sahf = yes; then
 
 $as_echo "#define HAVE_AS_IX86_SAHF 1" >>confdefs.h
 
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for interunit movq mnemonic" >&5
+$as_echo_n "checking assembler for interunit movq mnemonic... " >&6; }
+if test "${gcc_cv_as_ix86_interunit_movq+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_ix86_interunit_movq=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '.code64
+       movq %mm0, %rax
+       movq %rax, %xmm0' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_ix86_interunit_movq=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_interunit_movq" >&5
+$as_echo "$gcc_cv_as_ix86_interunit_movq" >&6; }
+if test $gcc_cv_as_ix86_interunit_movq = yes; then
+
+$as_echo "#define HAVE_AS_IX86_INTERUNIT_MOVQ 1" >>confdefs.h
+
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for hle prefixes" >&5
+$as_echo_n "checking assembler for hle prefixes... " >&6; }
+if test "${gcc_cv_as_ix86_hle+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_ix86_hle=no
+  if test x$gcc_cv_as != x; then
+    $as_echo 'lock xacquire cmpxchg %esi, (%ecx)' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_ix86_hle=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_hle" >&5
+$as_echo "$gcc_cv_as_ix86_hle" >&6; }
+if test $gcc_cv_as_ix86_hle = yes; then
+
+$as_echo "#define HAVE_AS_IX86_HLE 1" >>confdefs.h
+
 fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for swap suffix" >&5
@@ -24744,6 +24831,10 @@ else
   gcc_cv_as_ix86_rep_lock_prefix=no
   if test x$gcc_cv_as != x; then
     $as_echo 'rep movsl
+        rep ret
+        rep nop
+        rep bsf %ecx, %eax
+        rep bsr %ecx, %eax
         lock addl %edi, (%eax,%esi)
         lock orl $0, (%esp)' > conftest.s
     if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
@@ -24784,7 +24875,11 @@ else
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
     then
-       gcc_cv_as_ix86_tlsgdplt=yes
+       if test x$gcc_cv_ld != x \
+        && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
+          gcc_cv_as_ix86_tlsgdplt=yes
+        fi
+        rm -f conftest
     else
       echo "configure: failed program was" >&5
       cat conftest.s >&5
@@ -24807,7 +24902,8 @@ if test "${gcc_cv_as_ix86_tlsldmplt+set}" = set; then :
 else
   gcc_cv_as_ix86_tlsldmplt=no
   if test x$gcc_cv_as != x; then
-    $as_echo 'call    tls_ld@tlsldmplt' > conftest.s
+    $as_echo 'tls_ld:
+        call    tls_ld@tlsldmplt' > conftest.s
     if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
@@ -24815,7 +24911,11 @@ else
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
     then
-       gcc_cv_as_ix86_tlsldmplt=yes
+       if test x$gcc_cv_ld != x \
+        && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
+          gcc_cv_as_ix86_tlsldmplt=yes
+        fi
+        rm -f conftest
     else
       echo "configure: failed program was" >&5
       cat conftest.s >&5
@@ -25307,6 +25407,48 @@ if test $gcc_cv_as_powerpc_popcntd = yes; then
 
 $as_echo "#define HAVE_AS_POPCNTD 1" >>confdefs.h
 
+fi
+
+    case $target in
+      *-*-aix*) conftest_s='   .machine "pwr8"
+       .csect .text[PR]';;
+      *) conftest_s='  .machine power8
+       .text';;
+    esac
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for power8 support" >&5
+$as_echo_n "checking assembler for power8 support... " >&6; }
+if test "${gcc_cv_as_powerpc_power8+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_powerpc_power8=no
+    if test $in_tree_gas = yes; then
+    if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2`
+  then gcc_cv_as_powerpc_power8=yes
+fi
+  elif test x$gcc_cv_as != x; then
+    $as_echo "$conftest_s" > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_powerpc_power8=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_power8" >&5
+$as_echo "$gcc_cv_as_powerpc_power8" >&6; }
+if test $gcc_cv_as_powerpc_power8 = yes; then
+
+$as_echo "#define HAVE_AS_POWER8 1" >>confdefs.h
+
 fi
 
     case $target in
@@ -25474,8 +25616,8 @@ if test "${gcc_cv_as_aix_ref+set}" = set; then :
 else
   gcc_cv_as_aix_ref=no
     if test $in_tree_gas = yes; then
-    if test $gcc_cv_gas_vers -ge `expr \( \( 2.21.0 \* 1000 \) + gcc_cv_as_aix_ref=yes \) \* 1000 + `
-  then :
+    if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 21 \) \* 1000 + 0`
+  then gcc_cv_as_aix_ref=yes
 fi
   elif test x$gcc_cv_as != x; then
     $as_echo ' .csect stuff[rw]
@@ -25614,6 +25756,37 @@ if test $gcc_cv_as_mips_gnu_attribute = yes; then
 
 $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1" >>confdefs.h
 
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .micromips support" >&5
+$as_echo_n "checking assembler for .micromips support... " >&6; }
+if test "${gcc_cv_as_micromips_support+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_micromips_support=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '.set micromips' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_micromips_support=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_micromips_support" >&5
+$as_echo "$gcc_cv_as_micromips_support" >&6; }
+if test $gcc_cv_as_micromips_support = yes; then
+
+$as_echo "#define HAVE_GAS_MICROMIPS 1" >>confdefs.h
+
 fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .dtprelword support" >&5
@@ -25810,7 +25983,7 @@ esac
 # version to the per-target configury.
 case "$cpu_type" in
   alpha | arm | avr | bfin | cris | i386 | m32c | m68k | microblaze | mips \
-  | pa | rs6000 | score | sparc | spu | xstormy16 | xtensa)
+  | pa | rs6000 | score | sparc | spu | tilegx | tilepro | xstormy16 | xtensa)
     insn="nop"
     ;;
   ia64 | s390)
@@ -26070,7 +26243,7 @@ else
   then gcc_cv_as_gnu_unique_object=yes
 fi
   elif test x$gcc_cv_as != x; then
-    $as_echo '.type foo, @gnu_unique_object' > conftest.s
+    $as_echo '.type foo, '$target_type_format_char'gnu_unique_object' > conftest.s
     if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
@@ -26089,7 +26262,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_gnu_unique_object" >&5
 $as_echo "$gcc_cv_as_gnu_unique_object" >&6; }
 if test $gcc_cv_as_gnu_unique_object = yes; then
-  # Also check for ld.so support, i.e. glibc 2.11 or higher.
+  # We need to unquote above to to use the definition from config.gcc.
+# Also check for ld.so support, i.e. glibc 2.11 or higher.
    if test x$host = x$build -a x$host = x$target &&
        ldd --version 2>/dev/null &&
        glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_hdr" >&5
 $as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; }
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker CIEv3 in .eh_frame support" >&5
+$as_echo_n "checking linker CIEv3 in .eh_frame support... " >&6; }
+gcc_cv_ld_eh_frame_ciev3=no
+if test $in_tree_ld = yes ; then
+  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
+     && test $in_tree_ld_is_elf = yes; then
+    gcc_cv_ld_eh_frame_ciev3=yes
+  fi
+elif test x$gcc_cv_ld != x; then
+  if echo "$ld_ver" | grep GNU > /dev/null; then
+    gcc_cv_ld_eh_frame_ciev3=yes
+    if test 0"$ld_date" -lt 20040513; then
+      if test -n "$ld_date"; then
+       # If there was date string, but was earlier than 2004-05-13, fail
+       gcc_cv_ld_eh_frame_ciev3=no
+      elif test "$ld_vers_major" -lt 2; then
+       gcc_cv_ld_eh_frame_ciev3=no
+      elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 16; then
+       gcc_cv_ld_eh_frame_ciev3=no
+      fi
+    fi
+  else
+    case "$target" in
+      *-*-solaris2*)
+        # Sun ld added support for CIE v3 in .eh_frame in Solaris 11.1.
+        if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2324; then
+          gcc_cv_ld_eh_frame_ciev3=yes
+        fi
+        ;;
+    esac
+  fi
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LD_EH_FRAME_CIEV3 `if test x"$gcc_cv_ld_eh_frame_ciev3" = xyes; then echo 1; else echo 0; fi`
+_ACEOF
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_ciev3" >&5
+$as_echo "$gcc_cv_ld_eh_frame_ciev3" >&6; }
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker position independent executable support" >&5
 $as_echo_n "checking linker position independent executable support... " >&6; }
 gcc_cv_ld_pie=no
@@ -26343,6 +26557,8 @@ if test "${gcc_cv_ld_as_needed+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   gcc_cv_ld_as_needed=no
+gcc_cv_ld_as_needed_option='--as-needed'
+gcc_cv_ld_no_as_needed_option='--no-as-needed'
 if test $in_tree_ld = yes ; then
   if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
      && test $in_tree_ld_is_elf = yes; then
@@ -26352,6 +26568,15 @@ elif test x$gcc_cv_ld != x; then
        # Check if linker supports --as-needed and --no-as-needed options
        if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then
                gcc_cv_ld_as_needed=yes
+       else
+         case "$target" in
+           # Solaris 2 ld always supports -z ignore/-z record.
+           *-*-solaris2*)
+             gcc_cv_ld_as_needed=yes
+             gcc_cv_ld_as_needed_option="-z ignore"
+             gcc_cv_ld_no_as_needed_option="-z record"
+             ;;
+         esac
        fi
 fi
 
@@ -26362,17 +26587,37 @@ if test x"$gcc_cv_ld_as_needed" = xyes; then
 
 $as_echo "#define HAVE_LD_AS_NEEDED 1" >>confdefs.h
 
+
+cat >>confdefs.h <<_ACEOF
+#define LD_AS_NEEDED_OPTION "$gcc_cv_ld_as_needed_option"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define LD_NO_AS_NEEDED_OPTION "$gcc_cv_ld_no_as_needed_option"
+_ACEOF
+
 fi
 
 case "$target:$tm_file" in
-  powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*)
+  powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*)
+  case "$target" in
+     *-*-linux*)
+     emul_name="-melf64ppc"
+      ;;
+     *-*-freebsd*)
+     emul_name="-melf64ppc_fbsd"
+      ;;
+  esac
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for omitting dot symbols" >&5
 $as_echo_n "checking linker support for omitting dot symbols... " >&6; }
 if test "${gcc_cv_ld_no_dot_syms+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   gcc_cv_ld_no_dot_syms=no
-    if test $in_tree_ld = yes ; then
+    if test x"$ld_is_gold" = xyes; then
+      gcc_cv_ld_no_dot_syms=yes
+    elif test $in_tree_ld = yes ; then
       if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2; then
         gcc_cv_ld_no_dot_syms=yes
       fi
@@ -26395,7 +26640,7 @@ foo:
 EOF
       if $gcc_cv_as -a64 -o conftest1.o conftest1.s > /dev/null 2>&1 \
          && $gcc_cv_as -a64 -o conftest2.o conftest2.s > /dev/null 2>&1 \
-         && $gcc_cv_ld -melf64ppc -o conftest conftest1.o conftest2.o > /dev/null 2>&1; then
+         && $gcc_cv_ld $emul_name -o conftest conftest1.o conftest2.o > /dev/null 2>&1; then
         gcc_cv_ld_no_dot_syms=yes
       fi
       rm -f conftest conftest1.o conftest2.o conftest1.s conftest2.s
@@ -26416,7 +26661,9 @@ if test "${gcc_cv_ld_large_toc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   gcc_cv_ld_large_toc=no
-    if test $in_tree_ld = yes ; then
+    if test x"$ld_is_gold" = xyes; then
+      gcc_cv_ld_large_toc=yes
+    elif test $in_tree_ld = yes ; then
       if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2; then
         gcc_cv_ld_large_toc=yes
       fi
@@ -26432,7 +26679,43 @@ _start:
        ld 9,ie0@got@tprel@l(9)
 EOF
       if $gcc_cv_as -a64 -o conftest.o conftest.s > /dev/null 2>&1 \
-         && $gcc_cv_ld -melf64ppc --no-toc-sort -o conftest conftest.o > /dev/null 2>&1; then
+         && $gcc_cv_ld $emul_name --no-toc-sort -o conftest conftest.o > /dev/null 2>&1; then
+        gcc_cv_ld_large_toc=yes
+      fi
+      rm -f conftest conftest.o conftest.s
+    fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_large_toc" >&5
+$as_echo "$gcc_cv_ld_large_toc" >&6; }
+    if test x"$gcc_cv_ld_large_toc" = xyes; then
+
+$as_echo "#define HAVE_LD_LARGE_TOC 1" >>confdefs.h
+
+    fi
+    ;;
+esac
+
+case "$target" in
+  *-*-aix*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker large toc support" >&5
+$as_echo_n "checking linker large toc support... " >&6; }
+if test "${gcc_cv_ld_large_toc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_ld_large_toc=no
+    if test x$gcc_cv_as != x ; then
+      cat > conftest.s <<EOF
+       .toc
+LC..1:
+       .tc a[TC],a[RW]
+       .extern a[RW]
+       .csect .text[PR]
+.largetoctest:
+       addis 9,LC..1@u(2)
+       ld 3,LC..1@l(9)
+EOF
+      if $gcc_cv_as -a64 -o conftest.o conftest.s > /dev/null 2>&1; then
         gcc_cv_ld_large_toc=yes
       fi
       rm -f conftest conftest.o conftest.s
@@ -26563,11 +26846,11 @@ if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
   if test "x$with_headers" != x; then
     target_header_dir=$with_headers
   elif test "x$with_sysroot" = x; then
-    target_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
+    target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include"
   elif test "x$with_build_sysroot" != "x"; then
     target_header_dir="${with_build_sysroot}${native_system_header_dir}"
   elif test "x$with_sysroot" = xyes; then
-    target_header_dir="${exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}"
+    target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}"
   else
     target_header_dir="${with_sysroot}${native_system_header_dir}"
   fi
@@ -26604,6 +26887,11 @@ else
             $target_header_dir/bits/uClibc_config.h > /dev/null; then
          gcc_cv_libc_provides_ssp=yes
        fi
+      # all versions of Bionic support stack protector
+      elif test -f $target_header_dir/sys/cdefs.h \
+        && $EGREP '^[  ]*#[    ]*define[       ]+__BIONIC__[   ]+1' \
+           $target_header_dir/sys/cdefs.h > /dev/null; then
+         gcc_cv_libc_provides_ssp=yes
       fi
        ;;
        *-*-gnu*)
 $as_echo_n "checking dl_iterate_phdr in target C library... " >&6; }
 gcc_cv_target_dl_iterate_phdr=unknown
 case "$target" in
-  *-*-solaris2*)
+  # Restrict to Solaris 11+.  While most of the Solaris 11 linker changes
+  # were backported to Solaris 10 Update 10, dl_iterate_phdr only lives in
+  # libdl there, both complicating its use and breaking compatibility
+  # between Solaris 10 updates.
+  *-*-solaris2.1[1-9]*)
     # <link.h> needs both a dl_iterate_phdr declaration and support for
     # compilation with largefile support.
     if grep dl_iterate_phdr $target_header_dir/link.h > /dev/null 2>&1 \
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_target_dl_iterate_phdr" >&5
 $as_echo "$gcc_cv_target_dl_iterate_phdr" >&6; }
 
-# Find out what GC implementation we want, or may, use.
+# We no longer support different GC mechanisms.  Emit an error if
+# the user configures with --with-gc.
 
 # Check whether --with-gc was given.
 if test "${with_gc+set}" = set; then :
-  withval=$with_gc; case "$withval" in
-  page)
-    GGC=ggc-$withval
-    ;;
-  zone)
-    GGC=ggc-$withval
-
-$as_echo "#define GGC_ZONE 1" >>confdefs.h
-
-    ;;
-  *)
-    as_fn_error "$withval is an invalid option to --with-gc" "$LINENO" 5
-    ;;
-esac
-else
-  GGC=ggc-page
+  withval=$with_gc; as_fn_error "Configure option --with-gc is only supported up to GCC 4.7.x" "$LINENO" 5
 fi
 
 
-echo "Using $GGC for garbage collection."
-
 # Libraries to use on the host.  This will normally be set by the top
 # level Makefile.  Here we simply capture the value for our Makefile.
 if test -z "${HOST_LIBS+set}"; then
@@ -26891,11 +27167,6 @@ $as_echo "#define ENABLE_LTO 1" >>confdefs.h
        esac
 done
 
-# Pick up gtfiles for c
-gtfiles=
-. ${srcdir}/c-config-lang.in
-all_gtfiles="$all_gtfiles [c] $gtfiles"
-
 check_languages=
 for language in $all_selected_languages
 do