Re: meson vs. llvm bitcode files

From: Christoph Berg <myon(at)debian(dot)org>
To: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: meson vs. llvm bitcode files
Date: 2026-07-15 12:10:52
Message-ID: ald4zLd-nes2CjuZ@msg.df7cb.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

thanks for picking this up. Missing LLVM bitcode support was the
blocker for using meson in package builds. (And using the speedup from
massive parallelization.)

I've been using the v12 patch for a few days now for building the
postgresql-20 snapshot packages on apt.postgresql.org. Afaict, it does
the right thing even though "are the .bc files really used" is hard to
test/tell.

Initially I had problems with the "install" step because the way I
used the Debian build machinery was calling "ninja install install-world".
The duplicated action cause weird errors like "not a directory"
because apparently it started two threads racing along. The problem
went away when changing to "ninja install-world". This is likely not a
bug in this patch, and possibly not even a meson/ninja bug, but
perhaps noteworthy here.

Re: Nazir Bilal Yavuz
> > + <literal>postgresql-&majorversion;-llvm-jit-bitcode.pc</literal>. It is
> >
> > Do we want to install these pc files even with -Dllvm=disabled?
>
> I think we want to install them as these pc files can be used for
> building extensions.

> This .pc file collects the cflags (in particular the include directories)
> needed to compile server code, so that the LLVM JIT bitcode emission can
> reuse them. It is versioned and intentionally scoped to JIT bitcode only,
> since there is not yet agreement on a stable, general extension-build
> interface.

Maybe this is the place to start a standard? There will be no users if
we are telling them not to use it. I'd just name it postgresql-$version-extension.pc.

$ cat /usr/lib/postgresql/20/lib/pkgconfig/postgresql-extension.pc
prefix=/usr
includedir=${prefix}/include/postgresql
libdir=${prefix}/lib/x86_64-linux-gnu

build_inc0=""
src_inc0=""
pkglibdir=${prefix}//usr/lib/postgresql/20/lib
dir_mod=${pkglibdir}
dir_data=${prefix}/share/postgresql/20/extension
dir_include=${prefix}/include/postgresql/20/server/extension
dir_doc=${prefix}//usr/share/doc/postgresql-doc-20/extension
dir_bitcode=${prefix}//usr/lib/postgresql/20/lib/bitcode
bindir=${prefix}/lib/postgresql/20/bin

There are some "/usr" too much in there.

> v14 is attached.

Will test that next, thanks.

Christoph

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-07-15 12:27:59 Re: Wrong argument name in error message from attribute_stats functions
Previous Message Stepan Neretin 2026-07-15 12:00:52 amcheck: detect duplicate PostingItem keys in GIN posting trees