From 5bba43312c0ceccfe18bd4d086e12ec0497ed926 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 14 May 2024 17:04:37 +0100 Subject: build: Enable `thread_local` for MinGW-w64 builds The assumption in the commit 188ca75e5fe4837d16241446558c7566912f67b2 about the broken `thread_local` implementation in GCC was misguided because the initial failure was not due to GCC, but a bug in the Wine runtime, as evidenced, for example, here: - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917307 - https://bugs.freedesktop.org/show_bug.cgi?id=108662 Consequently, it is safe to re-enable `thread_local` support for MinGW-w64 builds. --- configure.ac | 6 ------ 1 file changed, 6 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index bfc1e54921..b80466b13e 100644 --- a/configure.ac +++ b/configure.ac @@ -1043,12 +1043,6 @@ if test "$use_thread_local" = "yes" || test "$use_thread_local" = "auto"; then ])], [ case $host in - *mingw*) - dnl mingw32's implementation of thread_local has also been shown to behave - dnl erroneously under concurrent usage; see: - dnl https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605 - AC_MSG_RESULT([no]) - ;; *) AC_DEFINE([HAVE_THREAD_LOCAL], [1], [Define if thread_local is supported.]) AC_MSG_RESULT([yes]) -- cgit v1.2.3 From 17fe948cce2eb75f0f3f4b0db9d0d90648c7d4af Mon Sep 17 00:00:00 2001 From: fanquake Date: Sat, 18 May 2024 10:59:55 +0800 Subject: build: remove --enable-threadlocal --- configure.ac | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b80466b13e..d539e4436f 100644 --- a/configure.ac +++ b/configure.ac @@ -244,12 +244,6 @@ AC_ARG_ENABLE([lcov-branch-coverage], [use_lcov_branch=yes], [use_lcov_branch=no]) -AC_ARG_ENABLE([threadlocal], - [AS_HELP_STRING([--enable-threadlocal], - [enable features that depend on the c++ thread_local keyword (currently just thread names in debug logs). (default is to enable if there is platform support)])], - [use_thread_local=$enableval], - [use_thread_local=auto]) - AC_ARG_ENABLE([zmq], [AS_HELP_STRING([--disable-zmq], [disable ZMQ notifications])], @@ -1028,34 +1022,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ [AC_MSG_RESULT([no])] ) -if test "$use_thread_local" = "yes" || test "$use_thread_local" = "auto"; then - TEMP_LDFLAGS="$LDFLAGS" - LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS" - AC_MSG_CHECKING([for thread_local support]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include - static thread_local int foo = 0; - static void run_thread() { foo++;} - int main(){ - for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();} - return foo; - } - ])], - [ - case $host in - *) - AC_DEFINE([HAVE_THREAD_LOCAL], [1], [Define if thread_local is supported.]) - AC_MSG_RESULT([yes]) - ;; - esac - ], - [ - AC_MSG_RESULT([no]) - ] - ) - LDFLAGS="$TEMP_LDFLAGS" -fi - dnl Check for different ways of gathering OS randomness AC_MSG_CHECKING([for Linux getrandom function]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -- cgit v1.2.3