Bug 2127503 - postgresql-14.3-9.fc38 FTBFS: llvmjit_inline.cpp:771:37: error: incomplete type 'llvm::MemoryBuffer' used in nested name specifier
Summary: postgresql-14.3-9.fc38 FTBFS: llvmjit_inline.cpp:771:37: error: incomplete ty...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: postgresql
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Filip Januš
QA Contact: Fedora Extras Quality Assurance
URL: https://www.postgresql.org/message-id...
Whiteboard:
Depends On:
Blocks: F38FTBFS F39FTBFS F40FTBFS, RAWHIDEFTBFS
TreeView+ depends on / blocked
 
Reported: 2022-09-16 15:21 UTC by Petr Pisar
Modified: 2023-08-14 12:22 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2022-09-16 15:21:34 UTC
postgresql-14.3-9.fc38 fails to build in Fedora 38:

make[2]: Entering directory '/builddir/build/BUILD/postgresql-14.3/src/backend/jit/llvm'
g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -std=c++14 -fPIC -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -I/usr/include  -I../../../../src/include  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o llvmjit_inline.o llvmjit_inline.cpp
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,
      |                       ^~~~~~~~~~~
make[2]: *** [<builtin>: llvmjit_inline.o] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/postgresql-14.3/src/backend/jit/llvm'

A difference between a passing and failing build root is at <https://koschei.fedoraproject.org/build/13703514>. An upgrade of clang from
14.0.5-7.fc38 to 15.0.0-2.fc38 looks suspicious.

Comment 1 Daan De Meyer 2022-10-19 17:31:43 UTC
This should be fixed by https://github.com/postgres/postgres/commit/c2ae01f695b1605bc5e3908ff52b24fce6636caa. Can we pull that commit in as a patch and backport to Fedora 37 as well?

Comment 2 Ben Cotton 2023-02-07 14:55:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.


Note You need to log in before you can comment on or make changes to this bug.