summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-10-15 23:52:00 +0200
committerLudovic Courtès <ludo@gnu.org>2009-10-15 23:52:00 +0200
commit96e15df109ccfdcc2f6b2cffc0b64a083f000903 (patch)
tree1f5a87a5156b2698d1d46d1a650309685f54bdee /acinclude.m4
parentd94dcf59c684c3cf52c148ebd3867b0e98b6faa0 (diff)
downloadguile-96e15df109ccfdcc2f6b2cffc0b64a083f000903.tar.gz
Improve TLS detection for systems with compiler support but no libc support.release_1-9-4
* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Use `AC_LINK_IFELSE' instead of `AC_COMPILE_IFELSE'.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m47
1 files changed, 5 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index ed537d0bd..43a227bc9 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -341,8 +341,11 @@ dnl Check for compiler thread-local storage (TLS) support.
AC_DEFUN([GUILE_THREAD_LOCAL_STORAGE], [
AC_CACHE_CHECK([whether the `__thread' storage class is available],
[ac_cv_have_thread_storage_class],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([__thread int tls_integer;],
- [tls_integer = 123;])],
+ [dnl On some systems, e.g., NetBSD 5.0 with GCC 4.1, `__thread' is
+ dnl properly compiled but fails to link due to the lack of TLS
+ dnl support in the C library. Thus we try to link, not just compile.
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([__thread int tls_integer;],
+ [tls_integer = 123;])],
[ac_cv_have_thread_storage_class="yes"],
[ac_cv_have_thread_storage_class="no"])])