Re: [PATCH] Add an ldflags_sl meson build option

Поиск
Список
Период
Сортировка
От Matt Smith (matts3)
Тема Re: [PATCH] Add an ldflags_sl meson build option
Дата
Msg-id MW6PR11MB8310A5856FF47036410A011B8C72A@MW6PR11MB8310.namprd11.prod.outlook.com
обсуждение исходный текст
Ответ на [PATCH] Add an ldflags_sl meson build option  ("Matt Smith (matts3)" <matts3@cisco.com>)
Ответы Re: [PATCH] Add an ldflags_sl meson build option
Список pgsql-hackers
Yes I understand what you're saying. I know Meson tries to set some of these flags. But I want the source of truth for my flags for each target type to be outside Meson.  Which Meson is not designed to do.

When you're building many 3rd party deps all with different build systems and all trying to tweak flags here and there, it introduces much better consistency to specify "all targets of a certain type use this flag set".  Otherwise you end up having to write logic to filter flags per build system/package. And yes I realize we live in an imperfect world and packages such as postgres will in fact need to set project-specific flags, but this should be an exception.

I have raised an issue on Meson itself: https://github.com/mesonbuild/meson/issues/14621

Cmake has functionality whereby you can specify linker flags per target type and it will set them accordingly.  Meson doesn't have this type of feature and instead sets base flags itself across all targets.

So it would be helpful if postgresql could "drill a hole" as you say to shared_library() flags because then at least those flags can be overrriden externally just for those targets.

If you don't mind me asking - I assume ldflags_sl exists as a way for postgres internally to be able to set flags across all shared libs?





From: Peter Eisentraut <peter@eisentraut.org>
Sent: Wednesday, June 18, 2025 3:34 PM
To: Matt Smith (matts3) <matts3@cisco.com>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Add an ldflags_sl meson build option
 
On 18.06.25 03:11, Matt Smith (matts3) wrote:
> An example of a shared library-specific flag is -shared on linux or -
> dynamiclib on darwin.

But those options are already added by the build system itself.
LDFLAGS_SL would be if you wanted to pass some additional custom linker
flag just for shared libraries.

The reason I'm skeptical is that Meson generally wants to handle that
sort of thing with higher-level build options, not by passing flags
through directly.  So I wouldn't want to drill additional holes into
that system without a clear use case.

В списке pgsql-hackers по дате отправления: