diff options
author | Tom Tromey <tromey@redhat.com> | 2005-09-23 16:33:47 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-09-23 16:33:47 +0000 |
commit | e1e73e8db762a241a34ccf564e9592992535151e (patch) | |
tree | 9cbf55c3da9f19be71ffd49e2127da8c09829396 /config/tls.m4 | |
parent | 9304100dbfd990b391236e4fd870e19a77344d52 (diff) | |
download | gcc-e1e73e8db762a241a34ccf564e9592992535151e.zip gcc-e1e73e8db762a241a34ccf564e9592992535151e.tar.gz gcc-e1e73e8db762a241a34ccf564e9592992535151e.tar.bz2 |
enable.m4: New file.
config:
* enable.m4: New file.
* tls.m4: New file.
libmudflap:
* aclocal.m4, configure: Rebuilt.
* configure.ac: Use GCC_CHECK_TLS.
* acinclude.m4 (LIBMUDFLAP_CHECK_TLS, LIBMUDFLAP_ENABLE): Moved
to ../config.
From-SVN: r104571
Diffstat (limited to 'config/tls.m4')
-rw-r--r-- | config/tls.m4 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/config/tls.m4 b/config/tls.m4 new file mode 100644 index 0000000..5cbb685 --- /dev/null +++ b/config/tls.m4 @@ -0,0 +1,21 @@ +dnl Check whether the target supports TLS. +AC_DEFUN([GCC_CHECK_TLS], [ + GCC_ENABLE(tls, yes, [Use thread-local storage]) + AC_CACHE_CHECK([whether the target supports thread-local storage], + have_tls, [ + AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }], + [dnl If the test case passed with dynamic linking, try again with + dnl static linking. This fails at least with some older Red Hat + dnl releases. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="-static $LDFLAGS" + AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }], + [have_tls=yes], [have_tls=no], []) + LDFLAGS="$save_LDFLAGS"], + [have_tls=no], + [AC_COMPILE_IFELSE([__thread int foo;], [have_tls=yes], [have_tls=no])] + )]) + if test "$enable_tls $have_tls" = "yes yes"; then + AC_DEFINE(HAVE_TLS, 1, + [Define to 1 if the target supports thread-local storage.]) + fi]) |