summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2021-03-13 17:21:01 +1300
committerThomas Munro <tmunro@postgresql.org>2021-03-13 17:21:41 +1300
commitde91c3b976cfacddacd45a9b52046264c0e44b11 (patch)
treefbe5451977a3fbe4b6d6f6f24ec35d8d6db5e29d /configure.ac
parentc5be48f092016b1caf597b2e21d588b56c88a23e (diff)
downloadpostgresql-de91c3b976cfacddacd45a9b52046264c0e44b11.tar.gz
Fix new pthread code to respect --disable-thread-safety.
Don't try to compile src/port/pthread_barrier_wait.c if we opted out of threads at configure time. Revealed by build farm member gaur, which can't compile this code because of problems with its pthread implementation. It shouldn't be trying to, because it's using --disable-thread-safety. Defect in commit 44bf3d50. Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/2568537.1615603606%40sss.pgh.pa.us
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 8 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 0ed53571dd..2f1585adc0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1143,7 +1143,6 @@ AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt])
AC_SEARCH_LIBS(shm_open, rt)
AC_SEARCH_LIBS(shm_unlink, rt)
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
-AC_SEARCH_LIBS(pthread_barrier_wait, pthread)
# Solaris:
AC_SEARCH_LIBS(fdatasync, [rt posix4])
# Required for thread_test.c on Solaris
@@ -1156,6 +1155,10 @@ AC_SEARCH_LIBS(shmget, cygipc)
# *BSD:
AC_SEARCH_LIBS(backtrace_symbols, execinfo)
+if test "$enable_thread_safety" = yes; then
+ AC_SEARCH_LIBS(pthread_barrier_wait, pthread)
+fi
+
if test "$with_readline" = yes; then
PGAC_CHECK_READLINE
if test x"$pgac_cv_check_readline" = x"no"; then
@@ -1744,7 +1747,6 @@ AC_REPLACE_FUNCS(m4_normalize([
mkdtemp
pread
preadv
- pthread_barrier_wait
pwrite
pwritev
random
@@ -1755,6 +1757,10 @@ AC_REPLACE_FUNCS(m4_normalize([
strtof
]))
+if test "$enable_thread_safety" = yes; then
+ AC_REPLACE_FUNCS(pthread_barrier_wait)
+fi
+
if test "$PORTNAME" = "win32" -o "$PORTNAME" = "cygwin"; then
# Cygwin and (apparently, based on test results) Mingw both
# have a broken strtof(), so substitute the same replacement