diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-16 23:18:08 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-16 23:18:08 +0000 |
commit | 0a475b3bd1fd8b60157ccd41a5552dd06829ca4c (patch) | |
tree | 6a9d1f831db6953462b13b291bcb5681d08b073f /config | |
parent | 389dd41bd043170e7dc7660304f14a5f16af3562 (diff) | |
download | gcc-0a475b3bd1fd8b60157ccd41a5552dd06829ca4c.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149725 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'config')
-rw-r--r-- | config/ChangeLog | 5 | ||||
-rw-r--r-- | config/tls.m4 | 20 |
2 files changed, 24 insertions, 1 deletions
diff --git a/config/ChangeLog b/config/ChangeLog index 481af803499..6f20dd8b328 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2009-07-16 Joseph Myers <joseph@codesourcery.com> + + * tls.m4 (GCC_CHECK_TLS): Also test TLS in a shared library when + cross-compiling. + 2009-06-25 Olivier Hainque <hainque@adacore.com> * config/mh-ppc-aix (BOOT_ADAFLAGS): Remove -mminimal-toc. diff --git a/config/tls.m4 b/config/tls.m4 index e77742c7603..e0870682d51 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 |