The following bug has been logged on the website:
Bug reference: 18672
Logged by: Thierry Bastian
Email address: bastian.thierry@laposte.net
PostgreSQL version: 16.4
Operating system: macOS
Description:
In short, in src/interfaces/libpq/Makefile there is a check for lib-a to not
contain a call to exit. But the issue is that on macOS, it still uses
_atexit and pthread_exitm which are fine.
My fix to this is to apply the following patch:
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 0919d8f..65b07d3 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -118,7 +118,7 @@ backend_src = $(top_srcdir)/src/backend
libpq-refs-stamp: $(shlib)
ifneq ($(enable_coverage), yes)
ifeq (,$(filter aix solaris,$(PORTNAME)))
- @if nm -A -u $< 2>/dev/null | grep -v __cxa_atexit | grep exit; then \
+ @if nm -A -u $< 2>/dev/null | grep -v __cxa_atexit | grep -v _atexit |
grep -v pthread_exit | grep exit; then \
echo 'libpq must not be calling any function which invokes exit'; exit 1;
\
fi
endif