Re: --with-llvm on 32-bit platforms?

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dmitry Mityugov <d.mityugov@postgrespro.ru>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers@postgresql.org
Date: 2025-09-15T23:09:02Z
Lists: pgsql-hackers
On Tue, Sep 16, 2025 at 8:22 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dmitry Mityugov <d.mityugov@postgrespro.ru> writes:
> > What's interesting is that when I add the following (quick and dirty)
> > assertion to DatumGetPointer on 32-bit Linux platforms,
>
> > DatumGetPointer(Datum X)
> > {
> >          Assert((X & 0xFFFFFFFF00000000) == 0);
> >          return (Pointer) (uintptr_t) X;
> > }
>
> > I get a failure in Postgres executable early on startup.
>
> Interesting, but again, how about a stack trace?

Hmm.  We use TypeSizeT in generated IR for Datum, which is obviously
incorrect in this configuration.



Commits

  1. jit: Fix type used for Datum values in LLVM IR.

  2. Avoid faulty alignment of Datums in build_sorted_items().

  3. Make type Datum be 8 bytes wide everywhere.