From 63887f3df5f9d17a88da98bdd2a761f830d61191 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 30 Jan 2012 21:13:30 +0000 Subject: [PATCH] Check if -fpic -mtls-dialect=gnu2 works 2012-01-30 H.J. Lu * configure.ac: Check if -fpic -mtls-dialect=gnu2 works. * configure: Regenerated. --- gold/ChangeLog | 5 +++++ gold/configure | 10 ++++++++-- gold/configure.ac | 10 ++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 5535812300e..28ff513eb52 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2012-01-30 H.J. Lu + + * configure.ac: Check if -fpic -mtls-dialect=gnu2 works. + * configure: Regenerated. + 2012-01-27 Ian Lance Taylor * reloc.h (Bits): New class with static functions, copied from diff --git a/gold/configure b/gold/configure index aca7cabe9aa..b1744a837ba 100755 --- a/gold/configure +++ b/gold/configure @@ -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 diff --git a/gold/configure.ac b/gold/configure.ac index e49bf211e6a..edc591737f1 100644 --- a/gold/configure.ac +++ b/gold/configure.ac @@ -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") -- 2.30.2