Re: [meson] expose buildtype debug/optimization info to pg_config

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Junwang Zhao <zhjwpku(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [meson] expose buildtype debug/optimization info to pg_config
Date: 2023-12-26 19:58:55
Message-ID: f50374cc-2086-4fe8-bb3e-a59bf6bab44d@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.12.23 10:24, Junwang Zhao wrote:
> On Thu, Dec 14, 2023 at 4:50 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>>
>> On 12.12.23 11:40, Junwang Zhao wrote:
>>> build system using configure set VAL_CFLAGS with debug and
>>> optimization flags, so pg_config will show these infos. Some
>>> extensions depend on the mechanism.
>>>
>>> This patch exposes these flags with a typo fixed together.
>>
>> I have committed the typo fix.
>>
>> But I would like to learn more about the requirements of extensions in
>> this area. This seems a bit suspicious to me.
>
> This is what I found when building citus against an installation
> of meson debug build pg instance, since the CFLAGS doesn't
> contain -g flag, the binary doesn't include the debug information,
> which is different behavior from configure building system.

Ok, that makes sense.

I think a better place to add those options would the variable
var_cflags, which are the combined C flags that we export to
Makefile.global and pg_config. The cflags variable that you used is
more for internal use, for passing to the actual compilation commands,
so adding more options there would be duplicative.

And then set var_cxxflags as well.

Maybe you should also check whether the compiler takes unix-style
arguments, perhaps using cc.get_argument_syntax().

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-12-26 20:38:47 Re: No LINGUAS file yet for pg_combinebackup
Previous Message Alexander Korotkov 2023-12-26 19:35:37 Re: Bug in nbtree optimization to skip > operator comparisons (or < comparisons in backwards scans)