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

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: john(dot)fensterman(at)charter(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18289: postgresql14-devel-14.10-2PGDG.rhel8.x86_64.rpm Contains invalid cLang option in Makefile.global
Date: 2024-01-13 04:33:50
Message-ID: CA+hUKGK2HG4ZdBfVHuT6kUnUcy-bBZZWM_QifE-pYEQFMyPtPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Jan 13, 2024 at 7:34 AM PG Bug reporting form
<noreply(at)postgresql(dot)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?

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-01-13 23:29:15 Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger
Previous Message Jonathan S. Katz 2024-01-13 03:50:25 Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends