Re: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt - Mailing list pgsql-bugs

From Thomas Munro
Subject Re: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt
Date
Msg-id CA+hUKGLx0VgqwCz9YG0++-JBzUHmn1XXiDPjmkb1zHVxiE-kMA@mail.gmail.com
Whole thread Raw
In response to BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt
List pgsql-bugs
On Thu, Dec 21, 2023 at 9:31 AM PG Bug reporting form
<noreply@postgresql.org> wrote:
>   ERROR: could not load library "/usr/local/lib/postgresql/llvmjit.so":
> /usr/local/lib/postgresql/llvmjit.so: Undefined symbol
> "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt8optionalINS_5AlignEE"

> Demangle the symbol
> `_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt8optionalINS_5AlignEE` is
> `llvm::MemoryBuffer::getFile(llvm::Twine const&, bool, bool, bool,
> std::optional<llvm::Align>)`

My OS and LLVM (installed with pkg) are the same as yours,
though I'm building the master branch of PostgreSQL... hmm, I see a
slightly different name here:

tmunro@build1:~/projects/postgresql $ nm -DC
~/install/lib/postgresql/llvmjit.so | grep
'llvm::MemoryBuffer::getFile'
                 U llvm::MemoryBuffer::getFile(llvm::Twine const&,
bool, bool, bool, std::__1::optional<llvm::Align>)@LLVM_16

tmunro@build1:~/projects/postgresql $ nm -DC
/usr/local/llvm16/lib/libLLVM.so | grep
'llvm::MemoryBuffer::getFile(llvm::Twine'
00000000038ba2d0 T llvm::MemoryBuffer::getFile(llvm::Twine const&,
bool, bool, bool, std::__1::optional<llvm::Align>)@@LLVM_16

Note "std::__1::optional".  Could this be a clue about C++ standard
library mismatch, or something like that?  Google is telling me that
stdlib=libc++ (LLVM's standard library) has the __1 namespace, but
stdlib=libstdc++ (GNU's standard library) lacks it, but I didn't look
too hard...



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt
Next
From: Xiaoming
Date:
Subject: Re: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt