Check if -fpic -mtls-dialect=gnu2 works
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 30 Jan 2012 21:13:30 +0000 (21:13 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 30 Jan 2012 21:13:30 +0000 (21:13 +0000)
2012-01-30  H.J. Lu  <hongjiu.lu@intel.com>

* configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
* configure: Regenerated.

gold/ChangeLog
gold/configure
gold/configure.ac

index 5535812300e915283c877ff55442b81548ef53cb..28ff513eb525d6bb7428bb0e92d83b90da8ff634 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
+       * configure: Regenerated.
+
 2012-01-27  Ian Lance Taylor  <iant@google.com>
 
        * reloc.h (Bits): New class with static functions, copied from
index aca7cabe9aa58cd42dcd5a8ae43b29ea1bd3f5bd..b1744a837ba99301c06af0827dae38d0d54f5b35 100755 (executable)
@@ -6437,10 +6437,16 @@ fi
 
 
 save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mtls-dialect=gnu2"
+CFLAGS="$CFLAGS -fpic -mtls-dialect=gnu2"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-int i;
+
+__thread int i;
+void foo (void)
+{
+  i = 10;
+}
+
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   have_tls_gnu2=yes
index e49bf211e6afcbc51b59d52502873046c1483fb7..edc591737f17d5c5b3219d0b75ecf29754de0655 100644 (file)
@@ -359,8 +359,14 @@ AM_CONDITIONAL(OMP_SUPPORT, test "$gold_cv_c_threadprivate" = "yes")
 
 dnl Test for the -ftls-dialect=gnu2 option.
 save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mtls-dialect=gnu2"
-AC_COMPILE_IFELSE([int i;], [have_tls_gnu2=yes], [have_tls_gnu2=no])
+CFLAGS="$CFLAGS -fpic -mtls-dialect=gnu2"
+AC_COMPILE_IFELSE([
+__thread int i;
+void foo (void)
+{
+  i = 10;
+}
+], [have_tls_gnu2=yes], [have_tls_gnu2=no])
 CFLAGS="$save_CFLAGS"
 AM_CONDITIONAL(TLS_GNU2_DIALECT, test "$have_tls_gnu2" = "yes")
 
This page took 0.036936 seconds and 4 git commands to generate.