Re: BUG #18289: postgresql14-devel-14.10-2PGDG.rhel8.x86_64.rpm Contains invalid cLang option in Makefile.global - Mailing list pgsql-bugs

From Thomas Munro
Subject Re: BUG #18289: postgresql14-devel-14.10-2PGDG.rhel8.x86_64.rpm Contains invalid cLang option in Makefile.global
Date
Msg-id CA+hUKGK2HG4ZdBfVHuT6kUnUcy-bBZZWM_QifE-pYEQFMyPtPA@mail.gmail.com
Whole thread Raw
In response to BUG #18289: postgresql14-devel-14.10-2PGDG.rhel8.x86_64.rpm Contains invalid cLang option in Makefile.global  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18289: postgresql14-devel-14.10-2PGDG.rhel8.x86_64.rpm Contains invalid cLang option in Makefile.global  (Devrim Gündüz <devrim@gunduz.org>)
RE: [EXTERNAL] Re: BUG #18289: postgresql14-devel-14.10-2PGDG.rhel8.x86_64.rpm Contains invalid cLang option in Makefile.global  ("Fensterman, John P" <John.Fensterman@charter.com>)
List pgsql-bugs
On Sat, Jan 13, 2024 at 7:34 AM PG Bug reporting form
<noreply@postgresql.org> wrote:
> make
> /usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv
> -fexcess-precision=standard -Xclang -no-opaque-pointers
> -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro
> -Wno-deprecated-non-prototype -O2  -I. -I./ -I/usr/pgsql-14/include/server
> -I/usr/pgsql-14/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2
> -I/usr/include -flto=thin -emit-llvm -c -o temporal_tables.bc
> temporal_tables.c
> error: unknown argument: '-no-opaque-pointers'

Which version of clang is that?  And can you tell from any of the
artefacts in that -devel package which version of clang was used when
it was configured?

LLVM 13-15 had optional opaque pointers, and LLVM 16+ required them.
We only started using them when they were absolutely required, at the
same time as we added support for LLVM 16.  Since we weren't sure what
might break if we changed the behaviour with already-released code, eg
.bc files that might be part of an extension, we figured it would be
best to keep using -no-opaque-pointers with older clangs that will
accept it.  There is a test in the configure script:

checking whether /usr/bin/clang supports -Xclang -no-opaque-pointers,
for BITCODE_CFLAGS... (cached) no
checking whether /usr/bin/clang -xc++ supports -Xclang
-no-opaque-pointers, for BITCODE_CXXFLAGS... (cached) no

Now if the package maintainer used a different major version of clang
than you're using to compile your extension, it may have some compiler
flags that your compiler doesn't like.  I guess that problem is more
general than LLVM, though?



pgsql-bugs by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends
Next
From: Tom Lane
Date:
Subject: Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger