BUG #18672: failing to link postgresql - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18672: failing to link postgresql
Date
Msg-id 18672-66509a1043077366@postgresql.org
Whole thread Raw
Responses Re: BUG #18672: failing to link postgresql
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #18671: Unable to Run PostgreSQL on EndeavourOS without Modifying visudo
Next
From: Tom Lane
Date:
Subject: Re: BUG #18672: failing to link postgresql