Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyihq-0002zw-L6 for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Jun 2021 22:29:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyihp-0008VX-GI for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Jun 2021 22:29:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyihp-0008VP-8t for pgsql-hackers@lists.postgresql.org; Wed, 30 Jun 2021 22:29:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyihn-0004d1-8S for pgsql-hackers@postgresql.org; Wed, 30 Jun 2021 22:29:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15UMTBhp630838; Wed, 30 Jun 2021 18:29:11 -0400 From: Tom Lane To: Peter Eisentraut cc: Michael Paquier , Jacob Champion , "pgsql-hackers@postgresql.org" , Daniel Gustafsson Subject: Re: Preventing abort() and exit() calls in libpq 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> Comments: In-reply-to Tom Lane message dated "Wed, 30 Jun 2021 16:15:14 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <630822.1625092136.0@sss.pgh.pa.us> Date: Wed, 30 Jun 2021 18:29:11 -0400 Message-ID: <630837.1625092151@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <630822.1625092136.1@sss.pgh.pa.us> I wrote: > Peter Eisentraut 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 ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="avoid-repeat-nm-checks.patch"; charset="us-ascii" Content-ID: <630822.1625092136.2@sss.pgh.pa.us> Content-Description: avoid-repeat-nm-checks.patch diff --git a/src/interfaces/libpq/.gitignore b/src/interfaces/libpq/.gitignore index a4afe7c1c6..7478dc344a 100644 --- a/src/interfaces/libpq/.gitignore +++ b/src/interfaces/libpq/.gitignore @@ -1 +1,2 @@ /exports.list +/libpq-refs-stamp diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile index 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 ------- =_aaaaaaaaaa0--