aboutsummaryrefslogtreecommitdiff
path: root/bfd/configure
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-08-27 11:37:38 -0600
committerTom Tromey <tom@tromey.com>2023-11-07 17:47:12 -0700
commitc6d6a048f5a6f422e470c7c4bdb21a0c59d7c8fd (patch)
tree6059da9eaca725a1e8582e4ae8c919f34019b430 /bfd/configure
parent426931be4b538078c89c09d89ae3ecbab3146f46 (diff)
downloadgdb-c6d6a048f5a6f422e470c7c4bdb21a0c59d7c8fd.zip
gdb-c6d6a048f5a6f422e470c7c4bdb21a0c59d7c8fd.tar.gz
gdb-c6d6a048f5a6f422e470c7c4bdb21a0c59d7c8fd.tar.bz2
Make various error-related globals thread-local
This changes bfd_error et al to be thread-local. * Makefile.in: Regenerate. * aclocal.m4: Include ax_tls.m4. * ax_tls.m4: New file. * bfd.c: (bfd_error, input_error, input_bfd, _bfd_error_buf): Now thread-local. (bfd_asprintf): Update docs. * config.in, configure: Regenerate. * configure.ac: Call AX_TLS. * po/bfd.pot: Regenerate.
Diffstat (limited to 'bfd/configure')
-rwxr-xr-xbfd/configure51
1 files changed, 51 insertions, 0 deletions
diff --git a/bfd/configure b/bfd/configure
index f0a07ff..de94019 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -13283,6 +13283,57 @@ $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h
;;
esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) class" >&5
+$as_echo_n "checking for thread local storage (TLS) class... " >&6; }
+ if ${ac_cv_tls+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do
+ case $ax_tls_keyword in #(
+ none) :
+ ac_cv_tls=none ; break ;; #(
+ *) :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+int
+main ()
+{
+static $ax_tls_keyword int bar;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_tls=$ax_tls_keyword ; break
+else
+ ac_cv_tls=none
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+esac
+ done
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
+$as_echo "$ac_cv_tls" >&6; }
+
+ if test "$ac_cv_tls" != "none"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define TLS $ac_cv_tls
+_ACEOF
+
+ :
+else
+ :
+fi
+
+
# Link in zlib/zstd if we can. This allows us to read compressed debug sections.
# This is used only by compress.c.