re PR libgomp/25865 (libgomp incorrectly detects support for TLS)
authorRichard Henderson <rth@redhat.com>
Tue, 25 Apr 2006 20:58:25 +0000 (13:58 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 25 Apr 2006 20:58:25 +0000 (13:58 -0700)
        PR libgomp/25865
        * configure.ac: Use GCC_CHECK_TLS.
        * acinclude.m4 (LIBGOMP_CHECK_TLS): Remove.
        * Makefile.in, aclocal.m4, configure: Regenerate.

From-SVN: r113256

libgomp/ChangeLog
libgomp/Makefile.in
libgomp/acinclude.m4
libgomp/aclocal.m4
libgomp/configure
libgomp/configure.ac
libgomp/testsuite/Makefile.in

index 2f8fe74..41b3a09 100644 (file)
@@ -1,3 +1,10 @@
+2006-04-25  Richard Henderson  <rth@redhat.com>
+
+       PR libgomp/25865
+       * configure.ac: Use GCC_CHECK_TLS.
+       * acinclude.m4 (LIBGOMP_CHECK_TLS): Remove.
+       * Makefile.in, aclocal.m4, configure: Regenerate.
+
 2006-04-10  Matthias Klose  <doko@debian.org>
 
        * testsuite/lib/libgomp.exp (libgomp_init): Recognize multilib
index 3ddc854..31faff0 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -15,8 +15,6 @@
 @SET_MAKE@
 
 
-SOURCES = $(libgomp_la_SOURCES)
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
@@ -51,8 +49,10 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/../config.guess \
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
+       $(top_srcdir)/../config/enable.m4 \
        $(top_srcdir)/../config/lead-dot.m4 \
-       $(top_srcdir)/../config/stdint.m4 $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/../config/stdint.m4 \
+       $(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
        $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
index b66cc9f..b7428cf 100644 (file)
@@ -1,15 +1,3 @@
-dnl Check whether the target supports TLS.
-AC_DEFUN([LIBGOMP_CHECK_TLS], [
-  LIBGOMP_ENABLE(tls, yes, [Use thread-local storage])
-  AC_CACHE_CHECK([whether the target supports thread-local storage],
-                have_tls, [
-    AC_TRY_COMPILE([__thread int foo;],
-                  [], have_tls=$enable_tls, have_tls=no)])
-  if test $have_tls = yes; then
-    AC_DEFINE(HAVE_TLS, 1,
-             [Define to 1 if the target supports thread-local storage.])
-  fi])
-
 dnl ----------------------------------------------------------------------
 dnl This whole bit snagged from libgfortran.
 
index eaada1f..fb9be46 100644 (file)
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005  Free Software Foundation, Inc.
@@ -28,7 +28,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
 # Call AM_AUTOMAKE_VERSION so it can be traced.
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-        [AM_AUTOMAKE_VERSION([1.9.5])])
+        [AM_AUTOMAKE_VERSION([1.9.6])])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
@@ -915,6 +915,8 @@ AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
 m4_include([../config/depstand.m4])
+m4_include([../config/enable.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/stdint.m4])
+m4_include([../config/tls.m4])
 m4_include([acinclude.m4])
index 2d94826..5d906f6 100755 (executable)
@@ -8611,20 +8611,9 @@ if test "${have_tls+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+    if test "$cross_compiling" = yes; then
+  cat >conftest.$ac_ext <<_ACEOF
 __thread int foo;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -8648,7 +8637,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  have_tls=$enable_tls
+  have_tls=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -8656,10 +8645,71 @@ sed 's/^/| /' conftest.$ac_ext >&5
 have_tls=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./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
+                    save_LDFLAGS="$LDFLAGS"
+      LDFLAGS="-static $LDFLAGS"
+      if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./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
+  have_tls=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+have_tls=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+      LDFLAGS="$save_LDFLAGS"
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+have_tls=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 fi
 echo "$as_me:$LINENO: result: $have_tls" >&5
 echo "${ECHO_T}$have_tls" >&6
-  if test $have_tls = yes; then
+  if test "$enable_tls $have_tls" = "yes yes"; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_TLS 1
index 08f6724..606a0fd 100644 (file)
@@ -183,7 +183,7 @@ if test $ac_cv_func_clock_gettime = no; then
 fi
 
 # See if we support thread-local storage.
-LIBGOMP_CHECK_TLS
+GCC_CHECK_TLS
 
 # See what sort of export controls are availible.
 LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY
index 743bb05..01227b6 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -40,8 +40,10 @@ subdir = testsuite
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
+       $(top_srcdir)/../config/enable.m4 \
        $(top_srcdir)/../config/lead-dot.m4 \
-       $(top_srcdir)/../config/stdint.m4 $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/../config/stdint.m4 \
+       $(top_srcdir)/../config/tls.m4 $(top_srcdir)/acinclude.m4 \
        $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)