Re: Annoying build warnings from latest Apple toolchain

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Annoying build warnings from latest Apple toolchain
Date: 2023-10-05 17:31:47
Message-ID: 20231005173147.ovmn3s2kdbjhsymj@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-10-05 17:37:38 Re: Annoying build warnings from latest Apple toolchain
Previous Message Jeff Davis 2023-10-05 17:30:51 Re: Pre-proposal: unicode normalized text