]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - configure
libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]
[thirdparty/glibc.git] / configure
index d4cb9cd17f3d2f85fbde18086d6c8e491047a5b1..ee637a7caf98e329b404506bad0e09c5e3cd4dc6 100755 (executable)
--- a/configure
+++ b/configure
@@ -600,14 +600,12 @@ shared
 static
 ldd_rewrite_script
 use_ldconfig
-libc_cv_forced_unwind
 libc_cv_rootsbindir
 libc_cv_localstatedir
 libc_cv_sysconfdir
-libc_cv_localedir
+libc_cv_complocaledir
 libc_cv_rtlddir
 libc_cv_slibdir
-old_glibc_headers
 use_nscd
 libc_cv_gcc_unwind_find_fde
 libc_extra_cppflags
@@ -621,10 +619,10 @@ LIBGD
 libc_cv_cc_loop_to_function
 libc_cv_cc_submachine
 libc_cv_cc_nofma
-gnu89_inline
-libc_cv_ssp
+libc_cv_mtls_dialect_gnu2
 fno_unit_at_a_time
 libc_cv_output_format
+libc_cv_has_glob_dat
 libc_cv_hashstyle
 libc_cv_fpie
 libc_cv_z_execstack
@@ -636,8 +634,13 @@ BISON
 INSTALL_INFO
 PERL
 BASH_SHELL
+CXX_BITS_STD_ABS_H
+CXX_CMATH_HEADER
+CXX_CSTDLIB_HEADER
 CXX_SYSINCLUDES
 SYSINCLUDES
+PYTHON
+PYTHON_PROG
 AUTOCONF
 NM
 AWK
@@ -658,12 +661,17 @@ sysdeps_add_ons
 sysnames
 submachine
 multi_arch
+no_stack_protector
+stack_protector
+libc_cv_ssp
 base_machine
 add_on_subdirs
 add_ons
+have_tunables
 build_pt_chown
 build_nscd
 link_obsolete_rpc
+libc_cv_static_nss_crypt
 libc_cv_nss_crypt
 enable_werror
 all_warnings
@@ -762,6 +770,7 @@ enable_lock_elision
 enable_add_ons
 enable_hidden_plt
 enable_bind_now
+enable_stack_protector
 enable_static_nss
 enable_force_install
 enable_maintainer_mode
@@ -775,6 +784,7 @@ enable_systemtap
 enable_build_nscd
 enable_nscd
 enable_pt_chown
+enable_tunables
 enable_mathvec
 with_cpu
 '
@@ -1409,8 +1419,7 @@ Optional Features:
   --enable-shared         build shared library [default=yes if GNU ld]
   --enable-profile        build profiled library [default=no]
   --disable-timezone-tools
-                          do not install timezone tools (if using external
-                          ones) [default=install]
+                          do not install timezone tools [default=install]
   --enable-hardcoded-path-in-tests
                           hardcode newly built glibc path in tests
                           [default=no]
@@ -1424,6 +1433,9 @@ Optional Features:
                           for add-ons if no parameter given
   --disable-hidden-plt    do not hide internal function calls to avoid PLT
   --enable-bind-now       disable lazy relocations in DSOs
+  --enable-stack-protector=[yes|no|all|strong]
+                          Use -fstack-protector[-all|-strong] to detect glibc
+                          buffer overflows
   --enable-static-nss     build static NSS modules [default=no]
   --disable-force-install don't force installation of files from this package,
                           even if they are older than the installed files
@@ -1443,6 +1455,8 @@ Optional Features:
   --disable-build-nscd    disable building and installing the nscd daemon
   --disable-nscd          library functions will not contact the nscd daemon
   --enable-pt_chown       Enable building and installing pt_chown
+  --enable-tunables       Enable tunables support. Known values are 'yes',
+                          'no' and 'valstring'
   --enable-mathvec        Enable building and installing mathvec [default
                           depends on architecture]
 
@@ -3175,6 +3189,7 @@ 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
 
+# Default, dynamic case.
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3193,6 +3208,30 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+# Static case.
+old_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -static"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <iostream>
+
+int
+main()
+{
+  std::cout << "Hello, world!";
+  return 0;
+}
+
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+else
+  libc_cv_cxx_link_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LDFLAGS="$old_LDFLAGS"
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3206,7 +3245,7 @@ if test $libc_cv_cxx_link_ok != yes; then :
   CXX=
 fi
 
-if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
+if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then
   as_fn_error $? "you must configure in a separate build directory" "$LINENO" 5
 fi
 
@@ -3394,6 +3433,22 @@ else
 fi
 
 
+if test "x$bindnow" = xyes; then
+  $as_echo "#define BIND_NOW 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-stack-protector was given.
+if test "${enable_stack_protector+set}" = set; then :
+  enableval=$enable_stack_protector; enable_stack_protector=$enableval
+else
+  enable_stack_protector=no
+fi
+
+case "$enable_stack_protector" in
+all|yes|no|strong) ;;
+*) as_fn_error $? "Not a valid argument for --enable-stack-protector: \"$enable_stack_protector\"" "$LINENO" 5;;
+esac
 
 # Check whether --enable-static-nss was given.
 if test "${enable_static_nss+set}" = set; then :
@@ -3500,6 +3555,7 @@ cannot find NSS headers with lowlevel hash function interfaces" "$LINENO" 5
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   old_LIBS="$LIBS"
+  old_LDFLAGS="$LDFLAGS"
   LIBS="$LIBS -lfreebl3"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -3522,14 +3578,41 @@ cannot link program using lowlevel NSS hash functions" "$LINENO" 5
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+  # Check to see if there is a static NSS cryptographic library.
+  # If there isn't then we can't link anything with libcrypt.a,
+  # and that might mean disabling some static tests.
+  LDFLAGS="$LDFLAGS -static"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+typedef int PRBool;
+#include <hasht.h>
+#include <nsslowhash.h>
+int
+main ()
+{
+NSSLOW_Init();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libc_cv_static_nss_crypt=yes
+else
+  libc_cv_static_nss_crypt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  LDFLAGS="$old_LDFLAGS"
   CFLAGS="$old_CFLAGS"
   LIBS="$old_LIBS"
 else
   libc_cv_nss_crypt=no
+  libc_cv_static_nss_crypt=no
 fi
 
 
 
+
 # Check whether --enable-obsolete-rpc was given.
 if test "${enable_obsolete_rpc+set}" = set; then :
   enableval=$enable_obsolete_rpc; link_obsolete_rpc=$enableval
@@ -3558,7 +3641,7 @@ if ${libc_cv_sdt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
     old_CFLAGS="$CFLAGS"
-  CFLAGS="-std=gnu99 $CFLAGS"
+  CFLAGS="-std=gnu11 $CFLAGS"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/sdt.h>
@@ -3620,6 +3703,19 @@ if test "$build_pt_chown" = yes; then
 
 fi
 
+# Check whether --enable-tunables was given.
+if test "${enable_tunables+set}" = set; then :
+  enableval=$enable_tunables; have_tunables=$enableval
+else
+  have_tunables=no
+fi
+
+
+if test "$have_tunables" = yes; then
+  $as_echo "#define HAVE_TUNABLES 1" >>confdefs.h
+
+fi
+
 # The abi-tags file uses a fairly simplistic model for name recognition that
 # can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a
 # $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell.
@@ -3828,9 +3924,6 @@ fi
 
 
 
-###
-### I put this here to prevent those annoying emails from people who cannot
-### read and try to compile glibc on unsupported platforms.  --drepper
 ###
 ### By using the undocumented --enable-hacker-mode option for configure
 ### one can skip this test to make the configuration not fail for unsupported
@@ -3841,13 +3934,12 @@ if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
   *-linux* | *-gnu*)
     ;;
   *)
-    echo "*** The GNU C library is currently not available for this platform."
-    echo "*** So far nobody cared to port it and if there is no volunteer it"
-    echo "*** might never happen.  So, if you have interest to see glibc on"
-    echo "*** this platform visit"
-    echo "***  http://www.gnu.org/software/libc/porting.html"
-    echo "*** and join the group of porters"
-    exit 1
+    as_fn_error $? "
+*** The GNU C library is currently unavailable for this platform.
+*** If you are interested in seeing glibc on this platform visit
+*** the \"How to submit a new port\" in the wiki:
+***   https://sourceware.org/glibc/wiki/#Development
+*** and join the community!" "$LINENO" 5
     ;;
   esac
 fi
@@ -3856,6 +3948,105 @@ fi
 test -n "$base_machine" || base_machine=$machine
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fstack-protector" >&5
+$as_echo_n "checking for -fstack-protector... " >&6; }
+if ${libc_cv_ssp+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector -xc /dev/null -S -o /dev/null'
+  { { 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 :
+  libc_cv_ssp=yes
+else
+  libc_cv_ssp=no
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ssp" >&5
+$as_echo "$libc_cv_ssp" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fstack-protector-strong" >&5
+$as_echo_n "checking for -fstack-protector-strong... " >&6; }
+if ${libc_cv_ssp_strong+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector-strong -xc /dev/null -S -o /dev/null'
+  { { 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 :
+  libc_cv_ssp_strong=yes
+else
+  libc_cv_ssp_strong=no
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ssp_strong" >&5
+$as_echo "$libc_cv_ssp_strong" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fstack-protector-all" >&5
+$as_echo_n "checking for -fstack-protector-all... " >&6; }
+if ${libc_cv_ssp_all+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector-all -xc /dev/null -S -o /dev/null'
+  { { 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 :
+  libc_cv_ssp_all=yes
+else
+  libc_cv_ssp_all=no
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ssp_all" >&5
+$as_echo "$libc_cv_ssp_all" >&6; }
+
+stack_protector=
+no_stack_protector=
+if test "$libc_cv_ssp" = yes; then
+  no_stack_protector="-fno-stack-protector -DSTACK_PROTECTOR_LEVEL=0"
+  $as_echo "#define HAVE_CC_NO_STACK_PROTECTOR 1" >>confdefs.h
+
+fi
+
+if test "$enable_stack_protector" = yes && test "$libc_cv_ssp" = yes; then
+  stack_protector="-fstack-protector"
+  $as_echo "#define STACK_PROTECTOR_LEVEL 1" >>confdefs.h
+
+elif test "$enable_stack_protector" = all && test "$libc_cv_ssp_all" = yes; then
+  stack_protector="-fstack-protector-all"
+  $as_echo "#define STACK_PROTECTOR_LEVEL 2" >>confdefs.h
+
+elif test "$enable_stack_protector" = strong && test "$libc_cv_ssp_strong" = yes; then
+  stack_protector="-fstack-protector-strong"
+  $as_echo "#define STACK_PROTECTOR_LEVEL 3" >>confdefs.h
+
+else
+  stack_protector="-fno-stack-protector"
+  $as_echo "#define STACK_PROTECTOR_LEVEL 0" >>confdefs.h
+
+fi
+
+
+
+
+if test -n "$stack_protector"; then
+      no_ssp=-fno-stack-protector
+else
+  no_ssp=
+
+  if test "$enable_stack_protector" != no; then
+    as_fn_error $? "--enable-stack-protector=$enable_stack_protector specified, but specified level of stack protection is not supported by the compiler." "$LINENO" 5
+  fi
+fi
+
 # For the multi-arch option we need support in the assembler & linker.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler and linker STT_GNU_IFUNC support" >&5
 $as_echo_n "checking for assembler and linker STT_GNU_IFUNC support... " >&6; }
@@ -3878,7 +4069,7 @@ __start:
 EOF
 libc_cv_ld_gnu_indirect_function=no
 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
-           -nostartfiles -nostdlib \
+           -nostartfiles -nostdlib $no_ssp \
            -o conftest conftest.S 1>&5 2>&5; then
   # Do a link to see if the backend supports IFUNC relocs.
   $READELF -r conftest 1>&5
@@ -3891,33 +4082,35 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ld_gnu_indirect_function" >&5
 $as_echo "$libc_cv_ld_gnu_indirect_function" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether .text pseudo-op must be used" >&5
-$as_echo_n "checking whether .text pseudo-op must be used... " >&6; }
-if ${libc_cv_dot_text+:} false; then :
+# Check if gcc supports attribute ifunc as it is used in libc_ifunc macro.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc attribute ifunc support" >&5
+$as_echo_n "checking for gcc attribute ifunc support... " >&6; }
+if ${libc_cv_gcc_indirect_function+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat > conftest.s <<EOF
-.text
+  cat > conftest.c <<EOF
+extern int func (int);
+int used_func (int a)
+{
+  return a;
+}
+static void *resolver ()
+{
+  return &used_func;
+}
+extern __typeof (func) func __attribute__ ((ifunc ("resolver")));
 EOF
-libc_cv_dot_text=
-if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&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
-  libc_cv_dot_text=.text
+libc_cv_gcc_indirect_function=no
+if ${CC-cc} -c conftest.c -o conftest.o 1>&5 \
+   2>&5 ; then
+  if $READELF -s conftest.o | grep IFUNC >/dev/null 2>&5; then
+    libc_cv_gcc_indirect_function=yes
+  fi
 fi
 rm -f conftest*
 fi
-
-if test -z "$libc_cv_dot_text"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_indirect_function" >&5
+$as_echo "$libc_cv_gcc_indirect_function" >&6; }
 
 if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
   if test x"$multi_arch" = xyes; then
@@ -3926,6 +4119,13 @@ if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
     multi_arch=no
   fi
 fi
+if test x"$libc_cv_gcc_indirect_function" != xyes &&
+   test x"$multi_arch" = xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-multi-arch support recommends a gcc with gnu-indirect-function support.
+Please use a gcc which supports it by default or configure gcc with --enable-gnu-indirect-function" >&5
+$as_echo "$as_me: WARNING: --enable-multi-arch support recommends a gcc with gnu-indirect-function support.
+Please use a gcc which supports it by default or configure gcc with --enable-gnu-indirect-function" >&2;}
+fi
 multi_arch_d=
 if test x"$multi_arch" != xno; then
   multi_arch_d=/multiarch
@@ -4840,7 +5040,7 @@ int
 main ()
 {
 
-#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
+#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
 #error insufficient compiler
 #endif
   ;
@@ -5023,17 +5223,73 @@ else
   AUTOCONF=no
 fi
 
+# Check for python3 if available, or else python.
+for ac_prog in python3 python
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PYTHON_PROG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PYTHON_PROG"; then
+  ac_cv_prog_PYTHON_PROG="$PYTHON_PROG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PYTHON_PROG="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+PYTHON_PROG=$ac_cv_prog_PYTHON_PROG
+if test -n "$PYTHON_PROG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_PROG" >&5
+$as_echo "$PYTHON_PROG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PYTHON_PROG" && break
+done
+test -n "$PYTHON_PROG" || PYTHON_PROG="no"
+
+case "x$PYTHON_PROG" in
+xno|x|x:) PYTHON_PROG=no ;;
+*) ;;
+esac
+
+if test "x$PYTHON_PROG" = xno; then
+  aux_missing="$aux_missing python"
+else
+  PYTHON="$PYTHON_PROG -B"
+
+fi
+
 test -n "$critic_missing" && as_fn_error $? "
 *** These critical programs are missing or too old:$critic_missing
 *** Check the INSTALL file for required versions." "$LINENO" 5
 
 test -n "$aux_missing" && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 *** These auxiliary programs are missing or incompatible versions:$aux_missing
-*** some features will be disabled.
+*** some features or tests will be disabled.
 *** Check the INSTALL file for required versions." >&5
 $as_echo "$as_me: WARNING:
 *** These auxiliary programs are missing or incompatible versions:$aux_missing
-*** some features will be disabled.
+*** some features or tests will be disabled.
 *** Check the INSTALL file for required versions." >&2;}
 
 # if using special system headers, find out the compiler's sekrit
@@ -5059,6 +5315,21 @@ fi
 
 
 
+# Obtain some C++ header file paths.  This is used to make a local
+# copy of those headers in Makerules.
+if test -n "$CXX"; then
+  find_cxx_header () {
+    echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \
+        | sed -n "\,$1:,{s/:\$//;p}"
+  }
+  CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
+  CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+  CXX_BITS_STD_ABS_H="$(find_cxx_header bits/std_abs.h)"
+fi
+
+
+
+
 # Test if LD_LIBRARY_PATH contains the notation for the current directory
 # since this would lead to problems installing/building glibc.
 # LD_LIBRARY_PATH contains the current directory if one of the following
@@ -5278,41 +5549,13 @@ if test $ac_verc_fail = yes; then
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need to use -P to assemble .S files" >&5
-$as_echo_n "checking whether we need to use -P to assemble .S files... " >&6; }
-if ${libc_cv_need_minus_P+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.S <<EOF
-#include "confdefs.h"
-/* Nothing whatsoever.  */
-EOF
-if { ac_try='${CC-cc} $CPPFLAGS $ASFLAGS -c conftest.S 1>&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
-  libc_cv_need_minus_P=no
-else
-  libc_cv_need_minus_P=yes
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_need_minus_P" >&5
-$as_echo "$libc_cv_need_minus_P" >&6; }
-if test $libc_cv_need_minus_P = yes; then
-  config_vars="$config_vars
-asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for .set assembler directive" >&5
 $as_echo_n "checking for .set assembler directive... " >&6; }
 if ${libc_cv_asm_set_directive+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat > conftest.s <<EOF
-${libc_cv_dot_text}
+.text
 foo:
 .set glibc_conftest_frobozz,foo
 .globl glibc_conftest_frobozz
@@ -5324,7 +5567,7 @@ extern int glibc_conftest_frobozz;
 void _start() { glibc_conftest_frobozz = 1; }
 EOF
 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
-           -nostartfiles -nostdlib \
+           -nostartfiles -nostdlib $no_ssp \
            -o conftest conftest.s conftest1.c 1>&5 2>&5; then
   libc_cv_asm_set_directive=yes
 else
@@ -5339,172 +5582,53 @@ if test $libc_cv_asm_set_directive = yes; then
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler gnu_unique_object symbol type" >&5
-$as_echo_n "checking for assembler gnu_unique_object symbol type... " >&6; }
-if ${libc_cv_asm_unique_object+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.s <<EOF
-${libc_cv_dot_text}
-_sym:
-.type _sym, %gnu_unique_object
-EOF
-if ${CC-cc} -c $ASFLAGS conftest.s 1>&5 2>&5; then
-  libc_cv_asm_unique_object=yes
-else
-  libc_cv_asm_unique_object=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_unique_object" >&5
-$as_echo "$libc_cv_asm_unique_object" >&6; }
-if test $libc_cv_asm_unique_object = yes; then
-  $as_echo "#define HAVE_ASM_UNIQUE_OBJECT 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .protected and .hidden assembler directive" >&5
-$as_echo_n "checking for .protected and .hidden assembler directive... " >&6; }
-if ${libc_cv_asm_protected_directive+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.s <<EOF
-.protected foo
-foo:
-.hidden bar
-bar:
-EOF
-if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&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
-  libc_cv_asm_protected_directive=yes
-else
-  as_fn_error $? "assembler support for symbol visibility is required" "$LINENO" 5
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_protected_directive" >&5
-$as_echo "$libc_cv_asm_protected_directive" >&6; }
-
-if test $libc_cv_asm_protected_directive = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((visibility())) is supported" >&5
-$as_echo_n "checking whether __attribute__((visibility())) is supported... " >&6; }
-if ${libc_cv_visibility_attribute+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.c <<EOF
-                 int foo __attribute__ ((visibility ("hidden"))) = 1;
-                 int bar __attribute__ ((visibility ("protected"))) = 1;
-EOF
-                 libc_cv_visibility_attribute=no
-                 if { ac_try='${CC-cc} -Werror -S conftest.c -o conftest.s 1>&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
-                   if grep '\.hidden.*foo' conftest.s >/dev/null; then
-                     if grep '\.protected.*bar' conftest.s >/dev/null; then
-                       libc_cv_visibility_attribute=yes
-                     fi
-                   fi
-                 fi
-                 rm -f conftest.{c,s}
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_visibility_attribute" >&5
-$as_echo "$libc_cv_visibility_attribute" >&6; }
-  if test $libc_cv_visibility_attribute != yes; then
-    as_fn_error $? "compiler support for visibility attribute is required" "$LINENO" 5
-  fi
-fi
-
-if test $libc_cv_visibility_attribute = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for protected data symbol" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for protected data symbol" >&5
 $as_echo_n "checking linker support for protected data symbol... " >&6; }
 if ${libc_cv_protected_data+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat > conftest.c <<EOF
-                 int bar __attribute__ ((visibility ("protected"))) = 1;
+               int bar __attribute__ ((visibility ("protected"))) = 1;
 EOF
-                 libc_cv_protected_data=no
-                 if { ac_try='${CC-cc} -nostdlib -nostartfiles -fPIC -shared conftest.c -o conftest.so'
+               libc_cv_protected_data=no
+               if { ac_try='${CC-cc} -nostdlib -nostartfiles $no_ssp -fPIC -shared conftest.c -o conftest.so'
   { { 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
-                   cat > conftest.c <<EOF
-                   extern int bar;
-                   int main (void) { return bar; }
+                 cat > conftest.c <<EOF
+                 extern int bar;
+                 int main (void) { return bar; }
 EOF
-                   if { ac_try='${CC-cc} -nostdlib -nostartfiles conftest.c -o conftest conftest.so'
+                 if { ac_try='${CC-cc} -nostdlib -nostartfiles $no_ssp conftest.c -o conftest conftest.so'
   { { 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
-                     libc_cv_protected_data=yes
-                   fi
+                   libc_cv_protected_data=yes
                  fi
-                 rm -f conftest.*
+               fi
+               rm -f conftest.*
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_protected_data" >&5
 $as_echo "$libc_cv_protected_data" >&6; }
-else
-  libc_cv_protected_data=no
-fi
 
 
-if test $libc_cv_visibility_attribute = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken __attribute__((visibility()))" >&5
-$as_echo_n "checking for broken __attribute__((visibility()))... " >&6; }
-if ${libc_cv_broken_visibility_attribute+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken __attribute__((alias()))" >&5
+$as_echo_n "checking for broken __attribute__((alias()))... " >&6; }
+if ${libc_cv_broken_alias_attribute+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat > conftest.c <<EOF
-                 int foo (int x);
-                 int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
-                 int bar (int x) { return x; }
-EOF
-                 libc_cv_broken_visibility_attribute=yes
-                 if { ac_try='${CC-cc} -Werror -S conftest.c -o conftest.s 1>&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
-                   if grep '\.hidden[  _]foo' conftest.s >/dev/null; then
-                     libc_cv_broken_visibility_attribute=no
-                   fi
-                 fi
-                 rm -f conftest.c conftest.s
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_broken_visibility_attribute" >&5
-$as_echo "$libc_cv_broken_visibility_attribute" >&6; }
-  if test $libc_cv_broken_visibility_attribute = yes; then
-    as_fn_error $? "working compiler support for visibility attribute is required" "$LINENO" 5
-  fi
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken __attribute__((alias()))" >&5
-$as_echo_n "checking for broken __attribute__((alias()))... " >&6; }
-if ${libc_cv_broken_alias_attribute+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.c <<EOF
-              extern int foo (int x) __asm ("xyzzy");
-              int bar (int x) { return x; }
-              extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
-              extern int dfoo;
-              extern __typeof (dfoo) dfoo __asm ("abccb");
-              int dfoo = 1;
+              extern int foo (int x) __asm ("xyzzy");
+              int bar (int x) { return x; }
+              extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
+              extern int dfoo;
+              extern __typeof (dfoo) dfoo __asm ("abccb");
+              int dfoo = 1;
 EOF
               libc_cv_broken_alias_attribute=yes
               if { ac_try='${CC-cc} -Werror -S conftest.c -o conftest.s 1>&5'
@@ -5527,66 +5651,26 @@ if test $libc_cv_broken_alias_attribute = yes; then
   as_fn_error $? "working alias attribute support required" "$LINENO" 5
 fi
 
-if test $libc_cv_visibility_attribute = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to put _rtld_local into .sdata section" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to put _rtld_local into .sdata section" >&5
 $as_echo_n "checking whether to put _rtld_local into .sdata section... " >&6; }
 if ${libc_cv_have_sdata_section+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   echo "int i;" > conftest.c
-                 libc_cv_have_sdata_section=no
-                 if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
-                    | grep '\.sdata' >/dev/null; then
-                   libc_cv_have_sdata_section=yes
-                 fi
-                 rm -f conftest.c conftest.so
+               libc_cv_have_sdata_section=no
+               if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
+                  | grep '\.sdata' >/dev/null; then
+                 libc_cv_have_sdata_section=yes
+               fi
+               rm -f conftest.c conftest.so
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_have_sdata_section" >&5
 $as_echo "$libc_cv_have_sdata_section" >&6; }
-  if test $libc_cv_have_sdata_section = yes; then
-    $as_echo "#define HAVE_SDATA_SECTION 1" >>confdefs.h
-
-  fi
-fi
-
-{ $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 ${libc_cv_initfini_array+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.c <<EOF
-int _start (void) { return 0; }
-int __start (void) { return 0; }
-
-int foo (void) { return 1; }
-int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
-
-EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
-                      conftest.c -static -nostartfiles -nostdlib
-                      1>&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 :
-  if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then
-    libc_cv_initfini_array=yes
-  else
-    libc_cv_initfini_array=no
-  fi
-else
-  libc_cv_initfini_array=no
-fi
-rm -f conftest*
+if test $libc_cv_have_sdata_section = yes; then
+  $as_echo "#define HAVE_SDATA_SECTION 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_initfini_array" >&5
-$as_echo "$libc_cv_initfini_array" >&6; }
-if test $libc_cv_initfini_array != yes; then
-  as_fn_error $? "Need linker with .init_array/.fini_array support." "$LINENO" 5
-fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use .ctors/.dtors header and trailer" >&5
 $as_echo_n "checking whether to use .ctors/.dtors header and trailer... " >&6; }
@@ -5602,7 +5686,7 @@ __attribute__ ((constructor)) void ctor (void) { asm (""); }
 __attribute__ ((destructor))  void dtor (void) { asm (""); }
 
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -o conftest
                       conftest.c -static -nostartfiles -nostdlib
                       1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -5666,102 +5750,6 @@ if test $libc_cv_cc_with_libunwind = yes; then
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z nodelete" >&5
-$as_echo_n "checking for linker that supports -z nodelete... " >&6; }
-libc_linker_feature=no
-if test x"$gnu_ld" = x"yes"; then
-  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z nodelete"`
-  if test -n "$libc_linker_check"; then
-    cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                               -Wl,--enable-new-dtags,-z,nodelete -nostdlib -nostartfiles
-                               -fPIC -shared -o conftest.so conftest.c
-                               1>&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
-      libc_linker_feature=yes
-    fi
-    rm -f conftest*
-  fi
-fi
-if test $libc_linker_feature = yes; then
-  libc_cv_z_nodelete=yes
-else
-  as_fn_error $? "linker with -z nodelete support required" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
-$as_echo "$libc_linker_feature" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z nodlopen" >&5
-$as_echo_n "checking for linker that supports -z nodlopen... " >&6; }
-libc_linker_feature=no
-if test x"$gnu_ld" = x"yes"; then
-  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z nodlopen"`
-  if test -n "$libc_linker_check"; then
-    cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                               -Wl,--enable-new-dtags,-z,nodlopen -nostdlib -nostartfiles
-                               -fPIC -shared -o conftest.so conftest.c
-                               1>&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
-      libc_linker_feature=yes
-    fi
-    rm -f conftest*
-  fi
-fi
-if test $libc_linker_feature = yes; then
-  libc_cv_z_nodlopen=yes
-else
-  as_fn_error $? "linker with -z nodlopen support required" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
-$as_echo "$libc_linker_feature" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z initfirst" >&5
-$as_echo_n "checking for linker that supports -z initfirst... " >&6; }
-libc_linker_feature=no
-if test x"$gnu_ld" = x"yes"; then
-  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z initfirst"`
-  if test -n "$libc_linker_check"; then
-    cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                               -Wl,--enable-new-dtags,-z,initfirst -nostdlib -nostartfiles
-                               -fPIC -shared -o conftest.so conftest.c
-                               1>&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
-      libc_linker_feature=yes
-    fi
-    rm -f conftest*
-  fi
-fi
-if test $libc_linker_feature = yes; then
-  libc_cv_z_initfirst=yes
-else
-  as_fn_error $? "linker with -z initfirst support required" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
-$as_echo "$libc_linker_feature" >&6; }
-
 ASFLAGS_config=
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --noexecstack is desirable for .S files" >&5
 $as_echo_n "checking whether --noexecstack is desirable for .S files... " >&6; }
@@ -5811,7 +5799,7 @@ extern int mumble;
 int foo (void) { return bar (mumble); }
 EOF
 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                       -fPIC -shared -o conftest.so conftest.c
+                       -fPIC -shared $no_ssp -o conftest.so conftest.c
                        -nostdlib -nostartfiles
                        -Wl,-z,combreloc 1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -5847,7 +5835,7 @@ if test x"$gnu_ld" = x"yes"; then
     cat > conftest.c <<EOF
 int _start (void) { return 42; }
 EOF
-    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
                                -Wl,-z,execstack -nostdlib -nostartfiles
                                -fPIC -shared -o conftest.so conftest.c
                                1>&5'
@@ -5901,7 +5889,7 @@ else
   cat > conftest.c <<EOF
 int _start (void) { return 42; }
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
                            -fPIC -shared -o conftest.so conftest.c
                            -Wl,--hash-style=both -nostdlib 1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -5983,13 +5971,46 @@ $as_echo "$libc_cv_use_default_link" >&6; }
   use_default_link=$libc_cv_use_default_link
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_DAT reloc" >&5
+$as_echo_n "checking for GLOB_DAT reloc... " >&6; }
+if ${libc_cv_has_glob_dat+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.c <<EOF
+extern int mumble;
+int foo (void) { return mumble; }
+EOF
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+                       -fPIC -shared -o conftest.so conftest.c
+                       -nostdlib -nostartfiles $no_ssp
+                       1>&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
+  if $READELF -rW conftest.so | grep '_GLOB_DAT' > /dev/null; then
+    libc_cv_has_glob_dat=yes
+  else
+    libc_cv_has_glob_dat=no
+  fi
+else
+  libc_cv_has_glob_dat=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_has_glob_dat" >&5
+$as_echo "$libc_cv_has_glob_dat" >&6; }
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker output format" >&5
 $as_echo_n "checking linker output format... " >&6; }
 if ${libc_cv_output_format+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if libc_cv_output_format=`
-${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&5`
+${CC-cc} -nostartfiles -nostdlib $no_ssp -Wl,--print-output-format 2>&5`
 then
   :
 else
@@ -6032,62 +6053,37 @@ else
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fstack-protector" >&5
-$as_echo_n "checking for -fstack-protector... " >&6; }
-if ${libc_cv_ssp+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector -xc /dev/null -S -o /dev/null'
-  { { 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 :
-  libc_cv_ssp=yes
-else
-  libc_cv_ssp=no
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ssp" >&5
-$as_echo "$libc_cv_ssp" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fgnu89-inline" >&5
-$as_echo_n "checking for -fgnu89-inline... " >&6; }
-if ${libc_cv_gnu89_inline+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mtls-dialect=gnu2" >&5
+$as_echo_n "checking for -mtls-dialect=gnu2... " >&6; }
+if ${libc_cv_mtls_dialect_gnu2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat > conftest.c <<EOF
-int foo;
-#ifdef __GNUC_GNU_INLINE__
-main () { return 0;}
-#else
-#error
-#endif
+__thread int i;
+void foo (void)
+{
+  i = 10;
+}
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
-                           -o conftest.s conftest.c 1>&5'
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -fPIC -mtls-dialect=gnu2
+                  conftest.c 1>&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
-  libc_cv_gnu89_inline=yes
+  libc_cv_mtls_dialect_gnu2=yes
 else
-  libc_cv_gnu89_inline=no
+  libc_cv_mtls_dialect_gnu2=no
 fi
 rm -f conftest*
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gnu89_inline" >&5
-$as_echo "$libc_cv_gnu89_inline" >&6; }
-if test $libc_cv_gnu89_inline = yes; then
-  gnu89_inline=-fgnu89-inline
-else
-  gnu89_inline=
-fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mtls_dialect_gnu2" >&5
+$as_echo "$libc_cv_mtls_dialect_gnu2" >&6; }
 
+config_vars="$config_vars
+have-mtls-dialect-gnu2 = $libc_cv_mtls_dialect_gnu2"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc puts quotes around section names" >&5
 $as_echo_n "checking whether cc puts quotes around section names... " >&6; }
@@ -6117,103 +6113,6 @@ if test $libc_cv_have_section_quotes = yes; then
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler .weak directive" >&5
-$as_echo_n "checking for assembler .weak directive... " >&6; }
-if ${libc_cv_asm_weak_directive+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.s <<EOF
-${libc_cv_dot_text}
-.globl foo
-foo:
-.weak foo
-.weak bar; bar = foo
-EOF
-if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&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
-  libc_cv_asm_weak_directive=yes
-else
-  libc_cv_asm_weak_directive=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_weak_directive" >&5
-$as_echo "$libc_cv_asm_weak_directive" >&6; }
-
-if test $libc_cv_asm_weak_directive = no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler .weakext directive" >&5
-$as_echo_n "checking for assembler .weakext directive... " >&6; }
-if ${libc_cv_asm_weakext_directive+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.s <<EOF
-${libc_cv_dot_text}
-.globl foo
-foo:
-.weakext bar foo
-.weakext baz
-.globl baz
-baz:
-EOF
-  if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&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
-    libc_cv_asm_weakext_directive=yes
-  else
-    libc_cv_asm_weakext_directive=no
-  fi
-  rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_weakext_directive" >&5
-$as_echo "$libc_cv_asm_weakext_directive" >&6; }
-
-fi # no .weak
-
-if test $libc_cv_asm_weak_directive = yes; then
-  $as_echo "#define HAVE_ASM_WEAK_DIRECTIVE 1" >>confdefs.h
-
-elif test $libc_cv_asm_weakext_directive = yes; then
-  $as_echo "#define HAVE_ASM_WEAKEXT_DIRECTIVE 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld --no-whole-archive" >&5
-$as_echo_n "checking for ld --no-whole-archive... " >&6; }
-if ${libc_cv_ld_no_whole_archive+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.c <<\EOF
-_start () {}
-int __eh_pc;
-__throw () {}
-EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-                           -nostdlib -nostartfiles -Wl,--no-whole-archive
-                           -o conftest conftest.c 1>&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
-  libc_cv_ld_no_whole_archive=yes
-else
-  libc_cv_ld_no_whole_archive=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ld_no_whole_archive" >&5
-$as_echo "$libc_cv_ld_no_whole_archive" >&6; }
-if test $libc_cv_ld_no_whole_archive = no; then
-  as_fn_error $? "support for --no-whole-archive is needed" "$LINENO" 5
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_memset" >&5
 $as_echo_n "checking for __builtin_memset... " >&6; }
 if ${libc_cv_gcc_builtin_memset+:} false; then :
@@ -6276,58 +6175,6 @@ if test "$libc_cv_gcc_builtin_redirection" = no; then
   as_fn_error $? "support for the symbol redirection needed" "$LINENO" 5
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __thread" >&5
-$as_echo_n "checking for __thread... " >&6; }
-if ${libc_cv_gcc___thread+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.c <<\EOF
-__thread int a = 42;
-EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&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
-  libc_cv_gcc___thread=yes
-else
-  libc_cv_gcc___thread=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc___thread" >&5
-$as_echo "$libc_cv_gcc___thread" >&6; }
-if test "$libc_cv_gcc___thread" = no; then
-  as_fn_error $? "support for the __thread keyword is required" "$LINENO" 5
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tls_model attribute" >&5
-$as_echo_n "checking for tls_model attribute... " >&6; }
-if ${libc_cv_gcc_tls_model_attr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.c <<\EOF
-extern __thread int a __attribute__((tls_model ("initial-exec")));
-EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&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
-  libc_cv_gcc_tls_model_attr=yes
-else
-  libc_cv_gcc_tls_model_attr=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_tls_model_attr" >&5
-$as_echo "$libc_cv_gcc_tls_model_attr" >&6; }
-if test "$libc_cv_gcc_tls_model_attr" = no; then
-  as_fn_error $? "support for the tls_model attribute is required" "$LINENO" 5
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option to disable generation of FMA instructions" >&5
 $as_echo_n "checking for compiler option to disable generation of FMA instructions... " >&6; }
 if ${libc_cv_cc_nofma+:} false; then :
@@ -6641,58 +6488,6 @@ if test $libc_cv_predef_fortify_source = yes; then
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC implicitly enables -fstack-protector" >&5
-$as_echo_n "checking whether $CC implicitly enables -fstack-protector... " >&6; }
-if ${libc_cv_predef_stack_protector+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-extern void foobar (char *);
-int
-main ()
-{
-char large_array[2048]; foobar (large_array);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-libc_undefs=`$NM -u conftest.o |
-  LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
-    2>&5` || {
-  as_fn_error $? "confusing output from $NM -u" "$LINENO" 5
-}
-echo >&5 "libc_undefs='$libc_undefs'"
-# On some architectures, there are architecture-specific undefined
-# symbols (resolved by the linker), so filter out unknown symbols.
-# This will fail to produce the correct result if the compiler
-# defaults to -fstack-protector but this produces an undefined symbol
-# other than __stack_chk_fail.  However, compilers like that have not
-# been encountered in practice.
-libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
-case "$libc_undefs" in
-foobar) libc_cv_predef_stack_protector=no ;;
-'__stack_chk_fail
-foobar') libc_cv_predef_stack_protector=yes ;;
-*) as_fn_error $? "unexpected symbols in test: $libc_undefs" "$LINENO" 5 ;;
-esac
-else
-  as_fn_error $? "test compilation failed" "$LINENO" 5
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_predef_stack_protector" >&5
-$as_echo "$libc_cv_predef_stack_protector" >&6; }
-libc_extra_cflags=
-if test $libc_cv_predef_stack_protector = yes; then
-  libc_extra_cflags="$libc_extra_cflags -fno-stack-protector"
-fi
-libc_extra_cppflags=
-
 # Some linkers on some architectures support __ehdr_start but with
 # bugs.  Make sure usage of it does not create relocations in the
 # output (as the linker should resolve them all for us).
@@ -6706,7 +6501,7 @@ old_CFLAGS="$CFLAGS"
 old_LDFLAGS="$LDFLAGS"
 old_LIBS="$LIBS"
 CFLAGS="$CFLAGS -fPIC"
-LDFLAGS="$LDFLAGS -nostdlib -nostartfiles -shared"
+LDFLAGS="$LDFLAGS -nostdlib -nostartfiles -shared $no_ssp"
 LIBS=
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -6885,6 +6680,11 @@ if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then
 
 fi
 
+if test x"$libc_cv_gcc_indirect_function" = xyes; then
+  $as_echo "#define HAVE_GCC_IFUNC 1" >>confdefs.h
+
+fi
+
 # This is far from the AC_ARG_ENABLE that sets it so that a sysdeps
 # configure fragment can override the value to prevent this AC_DEFINE.
 
@@ -6896,27 +6696,6 @@ if test "x$build_nscd" = xdefault; then
   build_nscd=$use_nscd
 fi
 
-# Test for old glibc 2.0.x headers so that they can be removed properly
-# Search only in includedir.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for old glibc 2.0.x headers" >&5
-$as_echo_n "checking for old glibc 2.0.x headers... " >&6; }
-if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
-then
-  old_glibc_headers=yes
-else
-  old_glibc_headers=no
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $old_glibc_headers" >&5
-$as_echo "$old_glibc_headers" >&6; }
-if test ${old_glibc_headers} = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** During \"make install\" old headers from glibc 2.0.x will" >&5
-$as_echo "$as_me: WARNING: *** During \"make install\" old headers from glibc 2.0.x will" >&2;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** be removed." >&5
-$as_echo "$as_me: WARNING: *** be removed." >&2;}
-fi
-
-
-