diff options
author | Tom Lane | 2021-07-24 16:16:39 +0000 |
---|---|---|
committer | Tom Lane | 2021-07-24 16:16:39 +0000 |
commit | 76fa3db33654e543b5c796e28c6fc5b505a19c2a (patch) | |
tree | ccda453eb2844a387678081963a2faaf52f2ce1b /configure.ac | |
parent | 678f5448c2d86976a98b402ef14482a8ba3b159b (diff) |
Remove configure-time thread safety checking (thread_test.c).
This testing was useful when it was written, nigh twenty years ago,
but it seems fairly pointless for any platform built in the last
dozen or more years. (Compare also the comments at 8a2121185.)
Also we now have reports that the test program itself fails under
ThreadSanitizer. Rather than invest effort in fixing it, let's
just drop it, and assume that the few people who still care
already know they need to use --disable-thread-safety.
Back-patch into v14, for consistency with 8a2121185.
Discussion: https://postgr.es/m/CADhDkKzPSiNvA3Hyq+wSR_icuPmazG0cFe=YnC3U-CFcYLc8Xw@mail.gmail.com
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/configure.ac b/configure.ac index 099c4a5a45d..ed3cdb9a8e3 100644 --- a/configure.ac +++ b/configure.ac @@ -1178,17 +1178,13 @@ AC_SEARCH_LIBS(shm_unlink, rt) AC_SEARCH_LIBS(clock_gettime, [rt posix4]) # Solaris: AC_SEARCH_LIBS(fdatasync, [rt posix4]) -# Required for thread_test.c on Solaris -AC_SEARCH_LIBS(sched_yield, rt) -# Required for thread_test.c on Solaris 2.5: -# Other ports use it too (HP-UX) so test unconditionally -AC_SEARCH_LIBS(gethostbyname_r, nsl) # Cygwin: AC_SEARCH_LIBS(shmget, cygipc) # *BSD: AC_SEARCH_LIBS(backtrace_symbols, execinfo) if test "$enable_thread_safety" = yes; then + AC_SEARCH_LIBS(gethostbyname_r, nsl) AC_SEARCH_LIBS(pthread_barrier_wait, pthread) fi @@ -2362,38 +2358,6 @@ if test "$enable_tap_tests" = yes; then fi fi -# Thread testing - -# We have to run the thread test near the end so we have all our symbols -# defined. Cross compiling throws a warning. -# -if test "$enable_thread_safety" = yes; then -if test "$PORTNAME" != "win32" -then -AC_MSG_CHECKING([thread safety of required library functions]) - -_CFLAGS="$CFLAGS" -_LIBS="$LIBS" -CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -LIBS="$LIBS $PTHREAD_LIBS" -AC_RUN_IFELSE( - [AC_LANG_SOURCE([[#include "$srcdir/config/thread_test.c"]])], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - AC_MSG_ERROR([thread test program failed -This platform is not thread-safe. Check the file 'config.log' for the -exact reason, or use --disable-thread-safety to disable thread safety.])], - [AC_MSG_RESULT(maybe) - AC_MSG_WARN([ -*** Skipping thread test program because of cross-compile build. -])]) -CFLAGS="$_CFLAGS" -LIBS="$_LIBS" -else -AC_MSG_WARN([*** skipping thread test on Win32]) -fi -fi - # If compiler will take -Wl,--as-needed (or various platform-specific # spellings thereof) then add that to LDFLAGS. This is much easier than # trying to filter LIBS to the minimum for each executable. |