Bug 521750 - Follow-up: add some actually used compilation options when detecting __thread support [r=bsmedberg a1.9.1.9=beltzner]
authorBartłomiej B. <bartml@wp.pl>
Mon, 16 Nov 2009 10:48:34 -0600
changeset 26839 0d8bde830a1a071e0a8c4484416ab2831a3a6402
parent 26838 bccec907649a908f567853ace33352da7f2d6b9f
child 26840 c307a617e5a50cd6c57c7210ce6a22b2996db372
child 26844 ad472940978c4bad6f9491c5185197f3a299b079
push id2312
push userdbaron@mozilla.com
push dateWed, 10 Mar 2010 21:42:13 +0000
reviewersbsmedberg
bugs521750
milestone1.9.1.9pre
Bug 521750 - Follow-up: add some actually used compilation options when detecting __thread support [r=bsmedberg a1.9.1.9=beltzner]
configure.in
--- a/configure.in
+++ b/configure.in
@@ -4011,22 +4011,26 @@ AC_CACHE_CHECK(for trouble comparing to 
                                 template <class T> int operator!=(const T2*, const T&) { return 0; }],
                                [Foo<int> f; return (0 != f);],
                                ac_cv_trouble_comparing_to_zero=no,
                                ac_cv_trouble_comparing_to_zero=yes)])
 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
   AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
 fi
 
+# try harder, when checking for __thread support, see bug 521750 comment #33 and below
+_SAVE_LDFLAGS=$LDFLAGS
+LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS"
 AC_CACHE_CHECK(for __thread keyword for TLS variables,
                ac_cv_thread_keyword,
                [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
                             [return tlsIsMainThread;],
                             ac_cv_thread_keyword=yes,
                             ac_cv_thread_keyword=no)])
+LDFLAGS=$_SAVE_LDFLAGS
 if test "$ac_cv_thread_keyword" = yes; then
   AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
 fi
 
 dnl End of C++ language/feature checks
 AC_LANG_C
 
 dnl ========================================================