Re: [PATCH] Fix build with LLVM 15 or above

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Po-Chuan Hsieh <sunpoet(at)sunpoet(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Fix build with LLVM 15 or above
Date: 2022-10-10 22:07:00
Message-ID: CA+hUKGJb7kaTU6qsQ7egrXb+kJ6amEvVV00UMn1Yrkn66HeHTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 4, 2022 at 10:45 AM Zhihong Yu <zyu(at)yugabyte(dot)com> wrote:
> On Mon, Oct 3, 2022 at 2:41 PM Andres Freund <andres(at)anarazel(dot)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...).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2022-10-10 22:30:51 Re: Reducing the chunk header sizes on all memory context types
Previous Message Andres Freund 2022-10-10 21:35:14 Re: meson PGXS compatibility