mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Merge #16059: configure: Fix thread_local detection
480e3415d7 configure: Add flag for enabling thread_local. (Carl Dong) Pull request description: - When aiming for glibc compatibility, don't use thread_local. Fixes #15958. - FreeBSD has a buggy thread_local, don't use it. Fixes #16055. I've done a Gitian build on my local machine and the symbol tests seem to pass. ACKs for commit 480e34: MarcoFalke: utACK 480e3415d738a4e0e2ad9774c43f29937178ecae fanquake: tACK 480e341 Tree-SHA512: 334f21f7cf271c261b115a6410afd4ed4db3e84ad79b98c6c684c1dfa42b081f16d58e77695929e27b0fa173a894b959a327fe82821a3f3ed708b305a906ddd3
This commit is contained in:
parent
13b0efe1bd
commit
3c6ae97332
13
configure.ac
13
configure.ac
@ -195,6 +195,12 @@ AC_ARG_ENABLE([glibc-back-compat],
|
||||
[use_glibc_compat=$enableval],
|
||||
[use_glibc_compat=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 enabled if there is platform support and glibc-back-compat is not enabled)])],
|
||||
[use_thread_local=$enableval],
|
||||
[use_thread_local=auto])
|
||||
|
||||
AC_ARG_ENABLE([asm],
|
||||
[AS_HELP_STRING([--disable-asm],
|
||||
[disable assembly routines (enabled by default)])],
|
||||
@ -876,6 +882,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
]
|
||||
)
|
||||
|
||||
if test "x$use_thread_local" = xyes || { test "x$use_thread_local" = xauto && test "x$use_glibc_compat" = xno; }; then
|
||||
TEMP_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS"
|
||||
AC_MSG_CHECKING([for thread_local support])
|
||||
@ -901,6 +908,11 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
# supported (per https://stackoverflow.com/a/29929949)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*freebsd*)
|
||||
# FreeBSD's implementation of thread_local is also buggy (per
|
||||
# https://groups.google.com/d/msg/bsdmailinglist/22ncTZAbDp4/Dii_pII5AwAJ)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.])
|
||||
AC_MSG_RESULT(yes)
|
||||
@ -912,6 +924,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
]
|
||||
)
|
||||
LDFLAGS="$TEMP_LDFLAGS"
|
||||
fi
|
||||
|
||||
dnl check for gmtime_r(), fallback to gmtime_s() if that is unavailable
|
||||
dnl fail if neither are available.
|
||||
|
Loading…
Reference in New Issue
Block a user