Re: clang 15 doesn't like our JIT code

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: clang 15 doesn't like our JIT code
Date: 2022-09-16 18:45:30
Message-ID: 20220916184530.rdrtvstywtoulxms@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-09-16 11:40:46 -0400, Tom Lane wrote:
> According to
>
> https://bugzilla.redhat.com/show_bug.cgi?id=2127503
>
> bleeding-edge clang complains thusly:
>
> llvmjit_inline.cpp: In function 'std::unique_ptr<llvm::ModuleSummaryIndex> llvm_load_summary(llvm::StringRef)':
> llvmjit_inline.cpp:771:37: error: incomplete type 'llvm::MemoryBuffer' used in nested name specifier
> 771 | llvm::MemoryBuffer::getFile(path);
> | ^~~~~~~
> In file included from /usr/include/c++/12/memory:76,
> from /usr/include/llvm/ADT/SmallVector.h:28,
> from /usr/include/llvm/ADT/ArrayRef.h:14,
> from /usr/include/llvm/ADT/SetVector.h:23,
> from llvmjit_inline.cpp:48:
> /usr/include/c++/12/bits/unique_ptr.h: In instantiation of 'void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = llvm::MemoryBuffer]':
> /usr/include/c++/12/bits/unique_ptr.h:396:17: required from 'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = llvm::MemoryBuffer; _Dp = std::default_delete<llvm::MemoryBuffer>]'
> /usr/include/llvm/Support/ErrorOr.h:142:34: required from 'llvm::ErrorOr<T>::~ErrorOr() [with T = std::unique_ptr<llvm::MemoryBuffer>]'
> llvmjit_inline.cpp:771:35: required from here
> /usr/include/c++/12/bits/unique_ptr.h:93:23: error: invalid application of 'sizeof' to incomplete type 'llvm::MemoryBuffer'
> 93 | static_assert(sizeof(_Tp)>0,
> | ^~~~~~~~~~~
>
> I suspect this is less about clang and more about LLVM APIs,
> but anyway it seems like we gotta fix something.

Yea, there's definitely a bunch of llvm 15 issues that need to be fixed - this
particular failure is pretty easy to fix, but there's some others that are
harder. They redesigned a fairly core part of the IR representation. Thomas
has a WIP fix, I think.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-09-16 18:49:03 Re: [RFC] building postgres with meson - v13
Previous Message Imseih (AWS), Sami 2022-09-16 18:32:34 Improve cursor handling in pg_stat_statements