This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] 25816 Add configure option to disable TLS...


Alexandre Oliva wrote:
+Usually configure can correctly determine if TLS is supported.  In
+cases where it guesses wrong, TLS can be disabled with
+@option{--disable-tls}.


What if it guesses TLS support is not present, but you know it is?
As in, it performs a version test but the version in configure.in is
for a final release, whereas what you're using is a pre-release that
contains support but doesn't pass the version test?

Either you have to soften the `guesses wrong' to make it clear that it
only matches the false positives or change the code such that
--enable-tls forces TLS support on even if it doesn't look like the
assembler can take it.


+if test x$enable_tls = xno ; then


Missing quotes around $enable_tls here.  This will barf if one passes
say --enable-tls="some string containing blanks"


New version. This should address the problems noted above.



2006-01-16 David Daney <ddaney@avtrex.com>


	PR java/25816
        * configure.ac (enable_tls): New enable option.
        (HAVE_AS_TLS): Don't set if enable_tls = no.
	* configure: Regenerate.
        * doc/install.texi (--disable-tls): Document new option.


This is a regression that prevents me from using 4.1 on mipsel-linux.


Currently testing on i686-pc-linux and mipsel-linux cross compiler.

OK to commit to 4.1 if no regressions?

If so I will also commit to the trunk after testing there.

David Daney
Index: doc/install.texi
===================================================================
--- doc/install.texi	(revision 109804)
+++ doc/install.texi	(working copy)
@@ -945,6 +945,17 @@
 Novell Kernel Services thread support.
 @end table
 
+@item --disable-tls
+Specify that the target does not support TLS (Thread Local Storage).
+
+Usually configure can correctly determine if TLS is supported.  In
+cases where it guesses that TLS is supported, TLS can be disabled with
+@option{--disable-tls}.  This can happen if the assembler supports TLS
+but the C library does not.
+
+Note that: @option{--enable-tls} does nothing.  If configure
+determines that TLS is not supported, this option will not enable it.
+
 @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.
Index: configure
===================================================================
--- configure	(revision 109804)
+++ configure	(working copy)
@@ -882,6 +882,7 @@
   --enable-__cxa_atexit   enable __cxa_atexit for C++
   --enable-threads        enable thread usage for target GCC
   --enable-threads=LIB    use LIB thread package for target GCC
+  --disable-tls           disable generation of tls code even if assembler supports it
   --enable-objc-gc	  enable the use of Boehm's garbage collector with
 			  the GNU Objective-C runtime
   --disable-shared        don't provide a shared libgcc
@@ -6891,6 +6892,15 @@
   enable_threads=''
 fi;
 
+
+# Check whether --enable-tls or --disable-tls was given.
+if test "${enable_tls+set}" = set; then
+  enableval="$enable_tls"
+
+else
+  enable_tls=''
+fi;
+
 # Check whether --enable-objc-gc or --disable-objc-gc was given.
 if test "${enable_objc_gc+set}" = set; then
   enableval="$enable_objc_gc"
@@ -7473,7 +7483,7 @@
 else
     ac_prog_version=`$MAKEINFO --version 2>&1 |
                    sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
-  echo "configure:7476: version of makeinfo is $ac_prog_version" >&5
+  echo "configure:7486: version of makeinfo is $ac_prog_version" >&5
   case $ac_prog_version in
     '')     gcc_cv_prog_makeinfo_modern=no;;
     4.[2-9]*)
@@ -14817,7 +14827,9 @@
       fi
 	;;
 esac
-if test -z "$tls_first_major"; then
+if test "x$enable_tls" = xno ; then
+  : # TLS explicitly disabled.
+elif test -z "$tls_first_major"; then
   : # If we don't have a check, assume no support.
 else
   echo "$as_me:$LINENO: checking assembler for thread-local storage support" >&5
Index: configure.ac
===================================================================
--- configure.ac	(revision 109804)
+++ configure.ac	(working copy)
@@ -647,6 +647,11 @@
   --enable-threads=LIB    use LIB thread package for target GCC],,
 [enable_threads=''])
 
+
+AC_ARG_ENABLE(tls,
+[  --disable-tls           disable generation of tls code even if assembler supports it],,
+[enable_tls=''])
+
 AC_ARG_ENABLE(objc-gc,
 [  --enable-objc-gc	  enable the use of Boehm's garbage collector with
 			  the GNU Objective-C runtime],
@@ -2499,7 +2504,9 @@
 	;;
 changequote([,])dnl
 esac
-if test -z "$tls_first_major"; then
+if test "x$enable_tls" = xno ; then
+  : # TLS explicitly disabled.
+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,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]