From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: libpq: Refactor logic checking for exit() in shared library buil
Date: Tue, 09 Dec 2025 01:39:53 +0000
Message-ID: <E1vSmhl-003Wnv-1Y@gemulon.postgresql.org> (raw)
libpq: Refactor logic checking for exit() in shared library builds
This commit refactors the sanity check done by libpq to ensure that
there is no exit() reference in the build, moving the check from a
standalone Makefile rule to a perl script.
Platform-specific checks are now part of the script, avoiding most of
the duplication created by the introduction of this check for meson, but
not all of them:
- Solaris and Windows skipped in the script.
- Whitelist of symbols is in the script.
- nm availability, with its path given as an option of the script. Its
execution is checked in the script.
- Check is disabled if coverage reports are enabled. This part is not
pushed down to the script.
- Check is disabled for static builds of libpq. This part is filtered
out in each build script.
A trick is required for the stamp file, in the shape of an optional
argument that can be given to the script. Meson expects the stamp in
output and uses this argument, generating the stamp file in the script.
Meson is able to handle the removal of the stamp file internally when
libpq needs to be rebuilt and the check done again.
This refactoring piece has come up while discussing the addition of more
items in the symbols considered as acceptable.
This sanity check has never been run by meson since its introduction in
dc227eb82ea8, so it is possible that this fails in some of the buildfarm
members. At least the CI is happy with it, but let's see how it goes.
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Co-authored-by: VASUKI M <vasukim1992002@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/19095-6d8256d0c37d4be2@postgresql.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/4a8e6f43a6b56289cd3806b239c20ae31aa4cf2e
Modified Files
--------------
configure | 42 +++++++++++++++++
configure.ac | 2 +
meson.build | 1 +
src/Makefile.global.in | 1 +
src/interfaces/libpq/Makefile | 23 +++-------
src/interfaces/libpq/libpq_check.pl | 91 +++++++++++++++++++++++++++++++++++++
src/interfaces/libpq/meson.build | 18 ++++++++
7 files changed, 161 insertions(+), 17 deletions(-)
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-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: libpq: Refactor logic checking for exit() in shared library buil
In-Reply-To: <E1vSmhl-003Wnv-1Y@gemulon.postgresql.org>
* 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