Re: [PATCH] Fix build with LLVM 15 or above - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [PATCH] Fix build with LLVM 15 or above
Date
Msg-id CA+hUKGJb7kaTU6qsQ7egrXb+kJ6amEvVV00UMn1Yrkn66HeHTg@mail.gmail.com
Whole thread Raw
In response to [PATCH] Fix build with LLVM 15 or above  (Po-Chuan Hsieh <sunpoet@sunpoet.net>)
List pgsql-hackers
On Tue, Oct 4, 2022 at 10:45 AM Zhihong Yu <zyu@yugabyte.com> wrote:
> On Mon, Oct 3, 2022 at 2:41 PM Andres Freund <andres@anarazel.de> wrote:
>> On 2022-10-03 12:16:12 -0700, Andres Freund wrote:
>> > I haven't yet run through the whole regression test with an assert enabled
>> > llvm because an assert-enabled llvm is *SLOW*, but it got through the first
>> > few parallel groups ok.  Using an optimized llvm 15, all tests pass with
>> > PGOPTIONS=-cjit_above_cost=0.

+    /*
+     * When targetting an llvm version with opaque pointers enabled by
+     * default, turn them off for the context we build our code in. Don't need
+     * to do so for other contexts (e.g. llvm_ts_context) - once the IR is
+     * generated, it carries the necessary information.
+     */
+#if LLVM_VERSION_MAJOR > 14
+    LLVMContextSetOpaquePointers(LLVMGetGlobalContext(), false);
+#endif

Ahh, right, thanks!

>> That did pass. But to be able to use clang >= 15 one more piece is
>> needed. Updated patch attached.

+  bitcode_cflags += ['-Xclang', '-no-opaque-pointers']

Oh, right.  That makes sense.

> I think `targetting` should be spelled as targeting

Yeah.

OK, I'll wait for the dust to settle on our 15 release and then
back-patch this.  Then I'll keep working on the opaque pointer support
for master, which LLVM 16 will need (I expect we'll eventually want to
back-patch that eventually, but first things first...).



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: meson PGXS compatibility
Next
From: David Rowley
Date:
Subject: Re: Reducing the chunk header sizes on all memory context types