From 396b7fa48aa8a9ebfb09d30a03db5170001903d9 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 17 Jul 2009 00:18:08 +0100 Subject: [PATCH] tls.m4 (GCC_CHECK_TLS): Also test TLS in a shared library when cross-compiling. config: * tls.m4 (GCC_CHECK_TLS): Also test TLS in a shared library when cross-compiling. libgomp: * configure: Regenerate. libjava: * configure: Regenerate. libmudflap: * configure: Regenerate. libstdc++-v3: * configure: Regenerate. From-SVN: r149725 --- config/ChangeLog | 5 + config/tls.m4 | 20 +++- libgomp/ChangeLog | 4 + libgomp/configure | 80 +++++++++++++ libjava/ChangeLog | 4 + libjava/configure | 87 ++++++++++++++ libmudflap/ChangeLog | 4 + libmudflap/configure | 80 +++++++++++++ libstdc++-v3/ChangeLog | 4 + libstdc++-v3/configure | 261 +++++++++++++++++++++++++++++++++++++++++ 10 files changed, 548 insertions(+), 1 deletion(-) diff --git a/config/ChangeLog b/config/ChangeLog index 481af8034990..6f20dd8b328f 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2009-07-16 Joseph Myers + + * tls.m4 (GCC_CHECK_TLS): Also test TLS in a shared library when + cross-compiling. + 2009-06-25 Olivier Hainque * config/mh-ppc-aix (BOOT_ADAFLAGS): Remove -mminimal-toc. diff --git a/config/tls.m4 b/config/tls.m4 index e77742c76034..e0870682d514 100644 --- a/config/tls.m4 +++ b/config/tls.m4 @@ -1,5 +1,6 @@ dnl Check whether the target supports TLS. AC_DEFUN([GCC_CHECK_TLS], [ + AC_REQUIRE([AC_CANONICAL_HOST]) GCC_ENABLE(tls, yes, [], [Use thread-local storage]) AC_CACHE_CHECK([whether the target supports thread-local storage], gcc_cv_have_tls, [ @@ -66,7 +67,24 @@ AC_DEFUN([GCC_CHECK_TLS], [ [dnl This is the cross-compiling case. Assume libc supports TLS if the dnl binutils and the compiler do. AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }], - [gcc_cv_have_tls=yes], [gcc_cv_have_tls=no]) + [chktls_save_LDFLAGS="$LDFLAGS" + dnl Shared library options may depend on the host; this check + dnl is only known to be needed for GNU/Linux. + case $host in + *-*-linux*) + LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" + ;; + esac + chktls_save_CFLAGS="$CFLAGS" + CFLAGS="-fPIC $CFLAGS" + dnl If -shared works, test if TLS works in a shared library. + AC_LINK_IFELSE([int f() { return 0; }], + AC_LINK_IFELSE([__thread int a; int b; int f() { return a = b; }], + [gcc_cv_have_tls=yes], + [gcc_cv_have_tls=no]), + [gcc_cv_have_tls=yes]) + CFLAGS="$chktls_save_CFLAGS" + LDFLAGS="$chktls_save_LDFLAGS"], [gcc_cv_have_tls=no]) ] )]) if test "$enable_tls $gcc_cv_have_tls" = "yes yes"; then diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 89157021e971..5ef1785e2139 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,7 @@ +2009-07-16 Joseph Myers + + * configure: Regenerate. + 2009-07-11 Richard Sandiford PR testsuite/40699 diff --git a/libgomp/configure b/libgomp/configure index deef67334057..cadb9322974b 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -17859,6 +17859,7 @@ fi # See if we support thread-local storage. + # Check whether --enable-tls or --disable-tls was given. if test "${enable_tls+set}" = set; then enableval="$enable_tls" @@ -17885,6 +17886,64 @@ else __thread int a; int b; int main() { return a = b; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + chktls_save_LDFLAGS="$LDFLAGS" + case $host in + *-*-linux*) + LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" + ;; + esac + chktls_save_CFLAGS="$CFLAGS" + CFLAGS="-fPIC $CFLAGS" + cat >conftest.$ac_ext <<_ACEOF +int f() { return 0; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >conftest.$ac_ext <<_ACEOF +__thread int a; int b; int f() { return a = b; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? @@ -17911,6 +17970,24 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +gcc_cv_have_tls=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_have_tls=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$chktls_save_CFLAGS" + LDFLAGS="$chktls_save_LDFLAGS" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_have_tls=no fi rm -f conftest.err conftest.$ac_objext \ @@ -22285,6 +22362,9 @@ ac_configure_args="${multilib_arg} ${ac_configure_args}" multi_basedir="$multi_basedir" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} CC="$CC" +CXX="$CXX" +GFORTRAN="$GFORTRAN" +GCJ="$GCJ" AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" diff --git a/libjava/ChangeLog b/libjava/ChangeLog index cad3e377fe73..22feaedf7d5c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2009-07-16 Joseph Myers + + * configure: Regenerate. + 2009-07-11 Richard Sandiford PR testsuite/40699 diff --git a/libjava/configure b/libjava/configure index 8fa8ed3616d7..82911d155ac7 100755 --- a/libjava/configure +++ b/libjava/configure @@ -27610,6 +27610,7 @@ fi # See if we support thread-local storage. + # Check whether --enable-tls or --disable-tls was given. if test "${enable_tls+set}" = set; then enableval="$enable_tls" @@ -27641,6 +27642,74 @@ cat >conftest.$ac_ext <<_ACEOF __thread int a; int b; int main() { return a = b; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + chktls_save_LDFLAGS="$LDFLAGS" + case $host in + *-*-linux*) + LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" + ;; + esac + chktls_save_CFLAGS="$CFLAGS" + CFLAGS="-fPIC $CFLAGS" + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +int f() { return 0; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after ." >&5 +echo "$as_me: error: Link tests are not allowed after ." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +__thread int a; int b; int f() { return a = b; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? @@ -27667,6 +27736,24 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +gcc_cv_have_tls=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_have_tls=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$chktls_save_CFLAGS" + LDFLAGS="$chktls_save_LDFLAGS" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_have_tls=no fi rm -f conftest.err conftest.$ac_objext \ diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog index 78507bc017b5..edb0958cd40c 100644 --- a/libmudflap/ChangeLog +++ b/libmudflap/ChangeLog @@ -1,3 +1,7 @@ +2009-07-16 Joseph Myers + + * configure: Regenerate. + 2009-07-11 Richard Sandiford PR testsuite/40699 diff --git a/libmudflap/configure b/libmudflap/configure index ae1be92e2074..954ffa1e7cb8 100755 --- a/libmudflap/configure +++ b/libmudflap/configure @@ -12740,6 +12740,7 @@ fi # See if we support thread-local storage. + # Check whether --enable-tls or --disable-tls was given. if test "${enable_tls+set}" = set; then enableval="$enable_tls" @@ -12766,6 +12767,64 @@ else __thread int a; int b; int main() { return a = b; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + chktls_save_LDFLAGS="$LDFLAGS" + case $host in + *-*-linux*) + LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" + ;; + esac + chktls_save_CFLAGS="$CFLAGS" + CFLAGS="-fPIC $CFLAGS" + cat >conftest.$ac_ext <<_ACEOF +int f() { return 0; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >conftest.$ac_ext <<_ACEOF +__thread int a; int b; int f() { return a = b; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? @@ -12792,6 +12851,24 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +gcc_cv_have_tls=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_have_tls=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$chktls_save_CFLAGS" + LDFLAGS="$chktls_save_LDFLAGS" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_have_tls=no fi rm -f conftest.err conftest.$ac_objext \ @@ -13624,6 +13701,9 @@ ac_configure_args="${multilib_arg} ${ac_configure_args}" multi_basedir="$multi_basedir" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} CC="$CC" +CXX="$CXX" +GFORTRAN="$GFORTRAN" +GCJ="$GCJ" AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 60c1c3fe3ad0..3c6ba9b2dd37 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2009-07-16 Joseph Myers + + * configure: Regenerate. + 2009-07-16 Jason Merrill PR libstdc++/37907 diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 0f19ba59f5c0..d9e9f8df5f1a 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -40678,6 +40678,7 @@ _ACEOF # For TLS support. + # Check whether --enable-tls or --disable-tls was given. if test "${enable_tls+set}" = set; then enableval="$enable_tls" @@ -40709,6 +40710,74 @@ cat >conftest.$ac_ext <<_ACEOF __thread int a; int b; int main() { return a = b; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + chktls_save_LDFLAGS="$LDFLAGS" + case $host in + *-*-linux*) + LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" + ;; + esac + chktls_save_CFLAGS="$CFLAGS" + CFLAGS="-fPIC $CFLAGS" + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +int f() { return 0; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after ." >&5 +echo "$as_me: error: Link tests are not allowed after ." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +__thread int a; int b; int f() { return a = b; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? @@ -40735,6 +40804,24 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +gcc_cv_have_tls=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_have_tls=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$chktls_save_CFLAGS" + LDFLAGS="$chktls_save_LDFLAGS" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_have_tls=no fi rm -f conftest.err conftest.$ac_objext \ @@ -94326,6 +94413,7 @@ _ACEOF + # Check whether --enable-tls or --disable-tls was given. if test "${enable_tls+set}" = set; then enableval="$enable_tls" @@ -94357,6 +94445,74 @@ cat >conftest.$ac_ext <<_ACEOF __thread int a; int b; int main() { return a = b; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + chktls_save_LDFLAGS="$LDFLAGS" + case $host in + *-*-linux*) + LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" + ;; + esac + chktls_save_CFLAGS="$CFLAGS" + CFLAGS="-fPIC $CFLAGS" + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +int f() { return 0; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after ." >&5 +echo "$as_me: error: Link tests are not allowed after ." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +__thread int a; int b; int f() { return a = b; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? @@ -94383,6 +94539,24 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +gcc_cv_have_tls=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_have_tls=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$chktls_save_CFLAGS" + LDFLAGS="$chktls_save_LDFLAGS" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_have_tls=no fi rm -f conftest.err conftest.$ac_objext \ @@ -111941,6 +112115,7 @@ done _ACEOF + # Check whether --enable-tls or --disable-tls was given. if test "${enable_tls+set}" = set; then enableval="$enable_tls" @@ -111972,6 +112147,74 @@ cat >conftest.$ac_ext <<_ACEOF __thread int a; int b; int main() { return a = b; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + chktls_save_LDFLAGS="$LDFLAGS" + case $host in + *-*-linux*) + LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" + ;; + esac + chktls_save_CFLAGS="$CFLAGS" + CFLAGS="-fPIC $CFLAGS" + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +int f() { return 0; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after ." >&5 +echo "$as_me: error: Link tests are not allowed after ." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +__thread int a; int b; int f() { return a = b; } +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? @@ -111998,6 +112241,24 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +gcc_cv_have_tls=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_have_tls=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$chktls_save_CFLAGS" + LDFLAGS="$chktls_save_LDFLAGS" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_have_tls=no fi rm -f conftest.err conftest.$ac_objext \ -- 2.43.5