This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] 25816 Add configure option to disable TLS...
Richard Henderson wrote:
On Tue, Jan 24, 2006 at 11:51:33AM -0800, David Daney wrote:
* configure.ac (enable_tls): New enable option.
(HAVE_AS_TLS): Don't do assembler check if enable_tls set.
* configure: Regenerate.
* doc/install.texi (--enable-tls): Document new option.
(--disable-tls): Ditto.
Ok.
Thanks Richard.
Committed to 4.1 as previously posted and thusly to the trunk (only line
numbers differ from the 4.1 version):
2006-01-24 David Daney <ddaney@avtrex.com>
PR java/25816
* configure.ac (enable_tls): New enable option.
(HAVE_AS_TLS): Don't do assembler check if enable_tls set.
* configure: Regenerate.
* doc/install.texi (--enable-tls): Document new option.
(--disable-tls): Ditto.
Index: configure.ac
===================================================================
--- configure.ac (revision 110198)
+++ configure.ac (working copy)
@@ -679,6 +679,17 @@
--enable-threads=LIB use LIB thread package for target GCC],,
[enable_threads=''])
+AC_ARG_ENABLE(tls,
+[ --enable-tls enable or disable generation of tls code
+ overriding the assembler check for tls support],
+[
+ case $enable_tls in
+ yes | no) ;;
+ *) AC_MSG_ERROR(['$enable_tls' is an invalid value for --enable-tls.
+Valid choices are 'yes' and 'no'.]) ;;
+ esac
+], [enable_tls=''])
+
AC_ARG_ENABLE(objc-gc,
[ --enable-objc-gc enable the use of Boehm's garbage collector with
the GNU Objective-C runtime],
@@ -2531,14 +2542,22 @@
;;
changequote([,])dnl
esac
-if test -z "$tls_first_major"; then
+set_have_as_tls=no
+if test "x$enable_tls" = xno ; then
+ : # TLS explicitly disabled.
+elif test "x$enable_tls" = xyes ; then
+ set_have_as_tls=yes # TLS explicitly enabled.
+elif test -z "$tls_first_major"; then
: # If we don't have a check, assume no support.
else
gcc_GAS_CHECK_FEATURE(thread-local storage support, gcc_cv_as_tls,
[$tls_first_major,$tls_first_minor,0], [$tls_as_opt], [$conftest_s],,
- [AC_DEFINE(HAVE_AS_TLS, 1,
- [Define if your assembler supports thread-local storage.])])
+ [set_have_as_tls=yes])
fi
+if test $set_have_as_tls = yes ; then
+ AC_DEFINE(HAVE_AS_TLS, 1,
+ [Define if your assembler supports thread-local storage.])
+fi
# Target-specific assembler checks.
Index: doc/install.texi
===================================================================
--- doc/install.texi (revision 110198)
+++ doc/install.texi (working copy)
@@ -945,6 +945,18 @@
Novell Kernel Services thread support.
@end table
+@item --enable-tls
+Specify that the target supports TLS (Thread Local Storage). Usually
+configure can correctly determine if TLS is supported. In cases where
+it guesses incorrectly, TLS can be explicitly enabled or disabled with
+@option{--enable-tls} or @option{--disable-tls}. This can happen if
+the assembler supports TLS but the C library does not, or if the
+assumptions made by the configure test are incorrect.
+
+@item --disable-tls
+Specify that the target does not support TLS.
+This is an alias for @option{--enable-tls=no}.
+
@item --with-cpu=@var{cpu}
Specify which cpu variant the compiler should generate code for by default.
@var{cpu} will be used as the default value of the @option{-mcpu=} switch.