From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Jacob Champion <pchampion@vmware.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Daniel Gustafsson <daniel@yesql.se>
Subject: Re: Preventing abort() and exit() calls in libpq
Date: Wed, 30 Jun 2021 18:29:11 -0400
Message-ID: <630837.1625092151@sss.pgh.pa.us> (raw)
In-Reply-To: <622907.1625084114@sss.pgh.pa.us>
References: <3128896.1624742969@sss.pgh.pa.us>
<18eda75d-af6d-3fc0-03b6-607eff9f392a@enterprisedb.com>
<622907.1625084114@sss.pgh.pa.us>
I wrote:
> Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
>> Could we set this rule up a little bit differently so that it is only
>> run when the library is built.
>> Right now, make world on a built tree makes 17 calls to this "nm" line,
>> and make check-world calls it 81 times. I think once would be enough. ;-)
> Hmm, didn't realize that would happen. Will see what can be done.
Looks like we'd have to make use of a dummy stamp-file, more or less
as attached. Any objections?
regards, tom lane
Attachments:avoid-repeat-nm-checks.patch (text/x-diff, 1.4K) downloaddiff --git a/src/interfaces/libpq/.gitignore b/src/interfaces/libpq/.gitignoreindex a4afe7c1c6..7478dc344a 100644--- a/src/interfaces/libpq/.gitignore+++ b/src/interfaces/libpq/.gitignore@@ -1 +1,2 @@
/exports.list
+/libpq-refs-stampdiff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefileindex c2a35a488a..bb6ceec2c9 100644--- a/src/interfaces/libpq/Makefile+++ b/src/interfaces/libpq/Makefile@@ -96,7 +96,7 @@ SHLIB_EXPORTS = exports.txt
PKG_CONFIG_REQUIRES_PRIVATE = libssl libcrypto
-all: all-lib check-libpq-refs+all: all-lib libpq-refs-stamp
# Shared library stuff
include $(top_srcdir)/src/Makefile.shlib
@@ -108,9 +108,9 @@ backend_src = $(top_srcdir)/src/backend
# If nm doesn't exist or doesn't work on shlibs, this test will do nothing,
# which is fine. The exclusion of __cxa_atexit is necessary on OpenBSD,
# which seems to insert references to that even in pure C code.
-.PHONY: check-libpq-refs-check-libpq-refs: $(shlib)+libpq-refs-stamp: $(shlib)
! nm -A -g -u $< 2>/dev/null | grep -v __cxa_atexit | grep exit
+ touch $@
# Make dependencies on pg_config_paths.h visible in all builds.
fe-connect.o: fe-connect.c $(top_builddir)/src/port/pg_config_paths.h
@@ -141,7 +141,7 @@ uninstall: uninstall-lib
clean distclean: clean-lib
$(MAKE) -C test $@
- rm -f $(OBJS) pthread.h+ rm -f $(OBJS) pthread.h libpq-refs-stamp
# Might be left over from a Win32 client-only build
rm -f pg_config_paths.h
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com, michael@paquier.xyz, pchampion@vmware.com, daniel@yesql.se
Subject: Re: Preventing abort() and exit() calls in libpq
In-Reply-To: <630837.1625092151@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox