[PATCH] jit: fix build with LLVM-21

Holger Hoffstätte <holger@applied-asynchrony.com>

From: Holger Hoffstätte <holger@applied-asynchrony.com>
To: pgsql-hackers@postgresql.org
Date: 2025-09-08T13:20:38Z
Lists: pgsql-hackers

Attachments

(please cc: me on replies)

Hello!

I tried building against LLVM-21 and noticed that a function for symbol
lookup was renamed (without semantic changes), breaking the LLVM JIT.
The following patch fixes this by adding a version guard. It applies equally
to both master and 17.6. Passes the test suite and verified on 17.6 with the
jit example from the documentation.

cheers,
Holger

Commits

  1. jit: Adjust AArch64-only code for LLVM 21.

  2. jit: fix build with LLVM-21

  3. Monkey-patch LLVM code to fix ARM relocation bug.