Re: [PATCH] Fix build with LLVM 15 or above
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Zhihong Yu <zyu@yugabyte.com>
Cc: Andres Freund <andres@anarazel.de>, Po-Chuan Hsieh <sunpoet@sunpoet.net>, pgsql-hackers@lists.postgresql.org
Date: 2022-10-10T22:07:00Z
Lists: 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...).
Commits
-
Track LLVM 15 changes.
- da3a6825eb15 11.18 landed
- aa34bc4e2bc8 12.13 landed
- cf94cb58665a 13.9 landed
- d033f8f8bea9 14.6 landed
- af64846e1cca 15.1 landed
- c2ae01f695b1 16.0 landed