Re: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: yangxiaoming2019(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt
Date: 2023-12-20 21:02:58
Message-ID: CA+hUKGLx0VgqwCz9YG0++-JBzUHmn1XXiDPjmkb1zHVxiE-kMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Dec 21, 2023 at 9:31 AM PG Bug reporting form
<noreply(at)postgresql(dot)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(at)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(at)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...

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Xiaoming 2023-12-21 02:31:37 Re: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt
Previous Message PG Bug reporting form 2023-12-20 10:51:52 BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt