Re: [PATCH] jit: fix build with LLVM-21

From: Holger Hoffstätte <holger(at)applied-asynchrony(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] jit: fix build with LLVM-21
Date: 2025-09-12 12:47:34
Message-ID: 33c4ba4e-0feb-1bc9-9b47-e88246afef29@applied-asynchrony.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-09-12 09:47, Holger Hoffstätte wrote:
> On 2025-09-12 08:36, Peter Eisentraut wrote:
>> In my testing with LLVM 21, I'm getting an additional error:
>>
>> ../src/backend/jit/llvm/llvmjit_wrap.cpp:56:18: error: no matching constructor for initialization of 'llvm::orc::RTDyldObjectLinkingLayer'
>>     56 |         return wrap(new llvm::orc::RTDyldObjectLinkingLayer(
>>        |                         ^
>>     57 |                 *unwrap(ES), [] { return std::make_unique<llvm::backport::SectionMemoryManager>(nullptr, true); }));
>>        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /opt/homebrew/Cellar/llvm/21.1.0/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:58:3: note: candidate constructor not viable: no known conversion from '(lambda at ../src/backend/jit/llvm/llvmjit_wrap.cpp:57:16)' to 'GetMemoryManagerFunction' (aka 'unique_function<std::unique_ptr<RuntimeDyld::MemoryManager> (const MemoryBuffer &)>') for 2nd argument
>>     58 |   RTDyldObjectLinkingLayer(ExecutionSession &ES,
>>        |   ^
>>     59 |                            GetMemoryManagerFunction GetMemoryManager);
>>        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /opt/homebrew/Cellar/llvm/21.1.0/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:37:16: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
>>     37 | class LLVM_ABI RTDyldObjectLinkingLayer
>>        |                ^~~~~~~~~~~~~~~~~~~~~~~~
>>
>> I gather you're not seeing that?

I temporarily removed the __arch64__ guard and can reproduce the above error,
using either gcc-15 or clang-21. It seems this llvm monkey patch backport thing
is affected by the following commit in llvm-21:
https://github.com/llvm/llvm-project/commit/cd585864c0bbbd74ed2a2b1ccc191eed4d1c8f90

Trying to figure out how to adapt the code..

chers
Holger

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2025-09-12 12:53:17 Re: Add support for specifying tables in pg_createsubscriber.
Previous Message Fabrice Chapuis 2025-09-12 12:44:42 Re: Issue with logical replication slot during switchover