Re: Annoying build warnings from latest Apple toolchain
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Noah Misch <noah@leadboat.com>, pgsql-hackers@lists.postgresql.org
Date: 2023-10-05T17:31:47Z
Lists: pgsql-hackers
Hi,
On 2023-10-05 13:17:25 -0400, Tom Lane wrote:
> I wrote:
> > 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.
I think that's a good plan. IIRC I previously complained about the symbols
existing in multiple places... Don't remember the details, IIRCI I saw
warnings about symbol conflicts in extensions using libpq.
> > 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).
>
> Here's a v2 that addresses the meson infrastructure as well.
> (This is my first attempt at writing meson code, so feel free
> to critique.) I propose not bothering to fix src/tools/msvc/,
> on the grounds that (a) that infrastructure will likely be gone
> before v17 ships, and (b) the latent problem with version
> skew between libpq.dll and calling programs seems much less
> likely to matter in the Windows world in the first place.
Makes sense.
> +# Note: it's important that we link to encnames.o from libpgcommon, not
> +# from libpq, else we have risks of version skew if we run with a libpq
> +# shared library from a different PG version. Define
> +# USE_PRIVATE_ENCODING_FUNCS to ensure that that happens.
> +c_args = default_bin_args.get('c_args', []) + ['-DUSE_PRIVATE_ENCODING_FUNCS']
> +
> initdb = executable('initdb',
> initdb_sources,
> include_directories: [timezone_inc],
> dependencies: [frontend_code, libpq, icu, icu_i18n],
> - kwargs: default_bin_args,
> + kwargs: default_bin_args + {
> + 'c_args': c_args,
> + },
I think you can just pass c_args directly to executable() here, I think adding
c_args to default_bin_args would be a bad idea.
Greetings,
Andres Freund
Commits
-
meson: macos: Avoid warnings on Sonoma
- a3da95deee38 17.0 landed
- 9158e4b9eb99 16.3 landed
-
Restore proper linkage of pg_char_to_encoding() and friends.
- b6c7cfac88c4 17.0 landed
-
meson: macos: Correct -exported_symbols_list syntax for Sonoma compat
- d5c5312dc8b6 16.1 landed
- b1a8dc846da4 17.0 landed
-
Suppress macOS warnings about duplicate libraries in link commands.
- e9d1560d3e4d 14.10 landed
- d8ceb98e4cb0 12.17 landed
- be3398ea155c 15.5 landed
- 75c562653cbe 16.1 landed
- 4d10fda52042 11.22 landed
- 1b64e374c981 13.13 landed
- 06843df4abc5 17.0 landed
-
Stop using "-multiply_defined suppress" on macOS.
- e73d6a0df42c 16.1 landed
- abe423712a12 12.17 landed
- 78f17fb97a7e 15.5 landed
- 5d60e8ed3f18 14.10 landed
- 53cc19bfa807 13.13 landed
- 3aa021b29b0e 17.0 landed
- 0e0de20c88b9 11.22 landed
-
Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: the
- 8468146b03c8 8.3.0 cited
-
Cause libpq and ecpg libraries to be built as proper shared libraries
- 9df30869725a 8.0.0 cited