summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-06 14:00:46 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-06 14:00:46 +0000
commite4cbe54f5caef4e8c1178b7186221dcdfef3be30 (patch)
tree41af967850b0489a1585cb2751cc5c75b0cb21a3
parentac9d5119c25ab284634034da65b549a6501a9adb (diff)
downloadgcc-e4cbe54f5caef4e8c1178b7186221dcdfef3be30.tar.gz
config/
2007-07-06 H.J. Lu <hongjiu.lu@intel.com> * tls.m4 (GCC_CHECK_CC_TLS): New. libgcc/ 2007-07-06 H.J. Lu <hongjiu.lu@intel.com> * config.host (tmake_file): Add t-tls for i[34567]86-*-linux* and x86_64-*-linux*. * config/t-tls: New file. * Makefile.in (INTERNAL_CFLAGS): Add @set_have_cc_tls@. * configure.ac: Include ../config/enable.m4 and ../config/tls.m4. Use GCC_CHECK_CC_TLS to check if assembler supports TLS and substitute set_have_cc_tls. * configure: Regenerated. libbid/ 2007-07-06 H.J. Lu <hongjiu.lu@intel.com> Updated from Intel BID library: * bid_conf.h (BID_THREAD): Defined only if both HAVE_CC_TLS and USE_TLS are defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126416 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--config/ChangeLog6
-rw-r--r--config/tls.m413
-rw-r--r--libgcc/ChangeLog15
-rw-r--r--libgcc/Makefile.in3
-rw-r--r--libgcc/config.host6
-rw-r--r--libgcc/config/libbid/ChangeLog6
-rw-r--r--libgcc/config/libbid/bid_conf.h2
-rw-r--r--libgcc/config/t-tls2
-rw-r--r--libgcc/configure73
-rw-r--r--libgcc/configure.ac13
10 files changed, 134 insertions, 5 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index e75beddecb1..ffa8a92cd74 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,7 +1,11 @@
+2007-07-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * tls.m4 (GCC_CHECK_CC_TLS): New.
+
2007-07-05 Sebastian Pop <sebpop@gmail.com>
PR bootstrap/32622
- * config/mh-x86omitfp (BOOT_CFLAGS): Add -fomit-frame-pointer,
+ * mh-x86omitfp (BOOT_CFLAGS): Add -fomit-frame-pointer,
don't reset its value.
2007-06-27 Mike Stump <mrs@apple.com>
diff --git a/config/tls.m4 b/config/tls.m4
index c8f3ff0a373..69cf6d4f9d2 100644
--- a/config/tls.m4
+++ b/config/tls.m4
@@ -73,3 +73,16 @@ AC_DEFUN([GCC_CHECK_TLS], [
AC_DEFINE(HAVE_TLS, 1,
[Define to 1 if the target supports thread-local storage.])
fi])
+
+dnl Check whether the target assembler supports TLS.
+AC_DEFUN([GCC_CHECK_CC_TLS], [
+ GCC_ENABLE(tls, yes, [], [Use thread-local storage])
+ AC_CACHE_CHECK([whether the target asssembler upports thread-local storage],
+ have_cc_tls, [
+ AC_COMPILE_IFELSE([__thread int a; int b; int main() { return a = b; }],
+ [have_cc_tls=yes], [have_cc_tls=no])]
+ )])
+ if test "$enable_tls $have_cc_tls" = "yes yes"; then
+ AC_DEFINE(HAVE_CC_TLS, 1,
+ [Define to 1 if the target assembler supports thread-local storage.])
+ fi])
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 20751b3c42f..1ba29ac0f04 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,17 @@
+2007-07-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config.host (tmake_file): Add t-tls for i[34567]86-*-linux*
+ and x86_64-*-linux*.
+
+ * config/t-tls: New file.
+
+ * Makefile.in (INTERNAL_CFLAGS): Add @set_have_cc_tls@.
+
+ * configure.ac: Include ../config/enable.m4 and
+ ../config/tls.m4. Use GCC_CHECK_CC_TLS to check if assembler
+ supports TLS and substitute set_have_cc_tls.
+ * configure: Regenerated.
+
2007-07-04 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in: Use libbid for DFP when BID is enabled.
@@ -8,7 +22,6 @@
extra_parts. Add config/i386/t-cygming to tmake_file.
* config/i386/t-cygming: New file with rules for crtbegin.o, crtend.o.
-
2007-05-29 Zuxy Meng <zuxy.meng@gmail.com>
Danny Smith <dannysmith@users.sourceforge.net>
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index f8115ea76ef..ca7ed066a83 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -214,7 +214,8 @@ override CFLAGS := $(filter-out -fprofile-generate -fprofile-use,$(CFLAGS))
# options in LIBGCC2_CFLAGS. But LIBGCC2_CFLAGS may contain -g0, and CFLAGS
# will usually contain -g, so for the moment CFLAGS goes first. We must
# include CFLAGS - that's where multilib options live.
-INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) $(INCLUDES)
+INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
+ $(INCLUDES) @set_have_cc_tls@
MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
diff --git a/libgcc/config.host b/libgcc/config.host
index 79039abc8e1..642f45fdbdd 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -654,3 +654,9 @@ m32c-*-elf*)
exit 1
;;
esac
+
+case ${host} in
+i[34567]86-*-linux* | x86_64-*-linux*)
+ tmake_file="${tmake_file} t-tls"
+ ;;
+esac
diff --git a/libgcc/config/libbid/ChangeLog b/libgcc/config/libbid/ChangeLog
index 96ab3e55225..a660fcb7565 100644
--- a/libgcc/config/libbid/ChangeLog
+++ b/libgcc/config/libbid/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ Updated from Intel BID library:
+ * bid_conf.h (BID_THREAD): Defined only if both HAVE_CC_TLS
+ and USE_TLS are defined.
+
2007-07-05 H.J. Lu <hongjiu.lu@intel.com>
Updated from Intel BID library:
diff --git a/libgcc/config/libbid/bid_conf.h b/libgcc/config/libbid/bid_conf.h
index 5af98f3d954..b3038d342dd 100644
--- a/libgcc/config/libbid/bid_conf.h
+++ b/libgcc/config/libbid/bid_conf.h
@@ -41,7 +41,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#endif
#ifndef BID_THREAD
-#ifdef USE_TLS
+#if defined (HAVE_CC_TLS) && defined (USE_TLS)
#define BID_THREAD __thread
#endif
#endif
diff --git a/libgcc/config/t-tls b/libgcc/config/t-tls
new file mode 100644
index 00000000000..405128f78bf
--- /dev/null
+++ b/libgcc/config/t-tls
@@ -0,0 +1,2 @@
+# Use thread-local storage
+INTERNAL_CFLAGS += -DUSE_TLS
diff --git a/libgcc/configure b/libgcc/configure
index 24c1571bd24..b95512c84ac 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -272,7 +272,7 @@ PACKAGE_STRING='GNU C Runtime Library 1.0'
PACKAGE_BUGREPORT=''
ac_unique_file="static-object.mk"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float vis_hide tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float vis_hide set_have_cc_tls tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -815,6 +815,7 @@ Optional Features:
enable decimal float extension to C. Selecting 'bid'
or 'dpd' choses which decimal floating point format
to use
+ --enable-tls Use thread-local storage [default=yes]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -3365,6 +3366,75 @@ else
fi
+# See if we have thread-local storage. We can only test assembler
+# sicne link-time and run-time tests require the newly built
+# gcc, which can't be used to build executable due to that libgcc
+# is yet to be built here.
+
+ # Check whether --enable-tls or --disable-tls was given.
+if test "${enable_tls+set}" = set; then
+ enableval="$enable_tls"
+
+ case "$enableval" in
+ yes|no) ;;
+ *) { { echo "$as_me:$LINENO: error: Argument to enable/disable tls must be yes or no" >&5
+echo "$as_me: error: Argument to enable/disable tls must be yes or no" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ enable_tls=yes
+fi;
+
+ echo "$as_me:$LINENO: checking whether the target asssembler upports thread-local storage" >&5
+echo $ECHO_N "checking whether the target asssembler upports thread-local storage... $ECHO_C" >&6
+if test "${have_cc_tls+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+__thread int a; int b; int main() { return a = b; }
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ have_cc_tls=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+have_cc_tls=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $have_cc_tls" >&5
+echo "${ECHO_T}$have_cc_tls" >&6
+set_have_cc_tls
+if test "$enable_tls $have_cc_tls" = "yes yes"; then
+ set_have_cc_tls="-DHAVE_CC_TLS"
+fi
+
+
# Conditionalize the makefile for this target machine.
tmake_file_=
for f in ${tmake_file}
@@ -4083,6 +4153,7 @@ s,@CPP@,$CPP,;t t
s,@decimal_float@,$decimal_float,;t t
s,@enable_decimal_float@,$enable_decimal_float,;t t
s,@vis_hide@,$vis_hide,;t t
+s,@set_have_cc_tls@,$set_have_cc_tls,;t t
s,@tmake_file@,$tmake_file,;t t
s,@extra_parts@,$extra_parts,;t t
s,@asm_hidden_op@,$asm_hidden_op,;t t
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 1187d74cc4a..1bf3644aace 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -1,5 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
+sinclude(../config/enable.m4)
+sinclude(../config/tls.m4)
sinclude(../config/acx.m4)
sinclude(../config/no-executables.m4)
@@ -167,6 +169,17 @@ else
fi
AC_SUBST(vis_hide)
+# See if we have thread-local storage. We can only test assembler
+# sicne link-time and run-time tests require the newly built
+# gcc, which can't be used to build executable due to that libgcc
+# is yet to be built here.
+GCC_CHECK_CC_TLS
+set_have_cc_tls
+if test "$enable_tls $have_cc_tls" = "yes yes"; then
+ set_have_cc_tls="-DHAVE_CC_TLS"
+fi
+AC_SUBST(set_have_cc_tls)
+
# Conditionalize the makefile for this target machine.
tmake_file_=
for f in ${tmake_file}