Skip to content

Commit 2f7bae2

Browse files
committed
Improve build-time check that libpq doesn't call exit().
Further fixes for commit dc227eb. Per suggestion from Peter Eisentraut, use a stamp-file to control when the check is run, avoiding repeated executions during "make all". Also, remove "-g" switch for nm: it's useless and some versions of nm consider it to conflict with "-u". (Thanks to Noah Misch for running down that portability issue.) Discussion: https://postgr.es/m/3128896.1624742969@sss.pgh.pa.us
1 parent a0fc813 commit 2f7bae2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/interfaces/libpq/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/exports.list
2+
/libpq-refs-stamp

src/interfaces/libpq/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ SHLIB_EXPORTS = exports.txt
9696

9797
PKG_CONFIG_REQUIRES_PRIVATE = libssl libcrypto
9898

99-
all: all-lib check-libpq-refs
99+
all: all-lib libpq-refs-stamp
100100

101101
# Shared library stuff
102102
include $(top_srcdir)/src/Makefile.shlib
@@ -108,9 +108,9 @@ backend_src = $(top_srcdir)/src/backend
108108
# If nm doesn't exist or doesn't work on shlibs, this test will do nothing,
109109
# which is fine. The exclusion of __cxa_atexit is necessary on OpenBSD,
110110
# which seems to insert references to that even in pure C code.
111-
.PHONY: check-libpq-refs
112-
check-libpq-refs: $(shlib)
113-
! nm -A -g -u $< 2>/dev/null | grep -v __cxa_atexit | grep exit
111+
libpq-refs-stamp: $(shlib)
112+
! nm -A -u $< 2>/dev/null | grep -v __cxa_atexit | grep exit
113+
touch $@
114114

115115
# Make dependencies on pg_config_paths.h visible in all builds.
116116
fe-connect.o: fe-connect.c $(top_builddir)/src/port/pg_config_paths.h
@@ -141,7 +141,7 @@ uninstall: uninstall-lib
141141

142142
clean distclean: clean-lib
143143
$(MAKE) -C test $@
144-
rm -f $(OBJS) pthread.h
144+
rm -f $(OBJS) pthread.h libpq-refs-stamp
145145
# Might be left over from a Win32 client-only build
146146
rm -f pg_config_paths.h
147147

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy