Re: Annoying build warnings from latest Apple toolchain

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>, Noah Misch <noah@leadboat.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2023-10-03T20:07:30Z
Lists: pgsql-hackers

Attachments

I wrote:
> Assuming that this problem is restricted to initdb, which I think
> is true, probably the best fix is to cause the initdb link *only*
> to link libpgcommon before libpq.  Every other non-backend program
> is interested in libpq's encoding IDs if it cares at all.

The more I thought about that the less I liked it.  We're trying to
get away from link order dependencies, not add more.  And the fact
that we've had a latent bug for awhile from random-ish changes in
link order should reinforce our desire to get out of that business.

So I experimented with fixing things so that the versions of these
functions exported by libpq have physically different names from those
that you'd get from linking to libpgcommon.a or libpgcommon_srv.a.
Then, there's certainty about which one a given usage will link to,
based on what the #define environment is when the call is compiled.

This leads to a pleasingly small patch, at least in the Makefile
universe (I've not attempted to sync the meson or MSVC infrastructure
with this yet).  As a bonus, it should silence those new warnings
on AIX.  A disadvantage is that this causes an ABI break for
backend extensions, so we couldn't consider back-patching it.
But I think that's fine given that the problem is only latent
in released branches.

Thoughts?

			regards, tom lane


Commits

  1. meson: macos: Avoid warnings on Sonoma

  2. Restore proper linkage of pg_char_to_encoding() and friends.

  3. meson: macos: Correct -exported_symbols_list syntax for Sonoma compat

  4. Suppress macOS warnings about duplicate libraries in link commands.

  5. Stop using "-multiply_defined suppress" on macOS.

  6. Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: the

  7. Cause libpq and ecpg libraries to be built as proper shared libraries