Re: meson vs. llvm bitcode files
Nazir Bilal Yavuz <byavuz81@gmail.com>
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Diego Fronza <diego.fronza@percona.com>
Cc: Peter Eisentraut <peter@eisentraut.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>, Andres Freund <andres@anarazel.de>
Date: 2025-03-13T10:11:44Z
Lists: pgsql-hackers
Attachments
- v4-0001-meson-Add-generated-header-stamps.patch (text/x-patch) patch v4-0001
- v4-0002-meson-Add-postgresql-extension.pc-for-building-ex.patch (text/x-patch) patch v4-0002
- v4-0003-meson-Test-building-extensions-by-using-postgresq.patch (text/x-patch) patch v4-0003
- v4-0004-meson-WIP-Add-docs-for-postgresql-extension.pc.patch (text/x-patch) patch v4-0004
- v4-0005-meson-Add-architecture-for-LLVM-bitcode-emission.patch (text/x-patch) patch v4-0005
- v4-0006-meson-Add-LLVM-bitcode-emissions-for-contrib-libr.patch (text/x-patch) patch v4-0006
- v4-0007-meson-Add-LLVM-bitcode-emission-for-backend-sourc.patch (text/x-patch) patch v4-0007
Hi,
On Wed, 12 Mar 2025 at 16:39, Diego Fronza <diego.fronza@percona.com> wrote:
>
> Hi,
>
> The v7 patch looks good to me, handling the bitcode modules in a uniform way and also avoiding the hacky code and warnings, much better now.
>
> A small note about the bitcode emission for generated sources in contrib, using cube as example, currently it creates two dict entries in a list:
> bc_seg_gen_sources = [{'srcfiles': [seg_scan]}]
> bc_seg_gen_sources += {'srcfiles': [seg_parse[0]]}
>
> Then pass it to the bitcode_modules:
> bitcode_modules += {
> ...
> 'gen_srcfiles': bc_seg_gen_sources,
> }
>
> It could be passed as a list with a single dict, since both generated sources share the same compilation flags:
> bitcode_modules += {
> ...
> 'gen_srcfiles': [
> { 'srcfiles': [cube_scan, cube_parse[0]] }.
> ]
> }
>
> Both approaches work, the first one has the advantage of being able to pass separate additional_flags per generated source.
I liked the current approach as it makes bitcode_modules easier to
understand but both approaches work for me as well.
One thing I noticed is that gen_srcfiles['srcfiles'] seems wrong.
gen_sources is a better name compared to gen_srcfiles. So, I changed
it to gen_sources in v4.
--
Regards,
Nazir Bilal Yavuz
Microsoft