[PATCH] Fix build with LLVM 15 or above

From: Po-Chuan Hsieh <sunpoet(at)sunpoet(dot)net>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Fix build with LLVM 15 or above
Date: 2022-10-03 03:55:32
Message-ID: CAMHz58Sf_xncdyqsekoVsNeKcruKootLtVH6cYXVhhUR1oKPCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

While building PostgreSQL 15 RC 1 with LLVM 15, I got a build failure as
follows:

cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Werror=vla -Werror=unguarded-availability-new -Wendif-labels
-Wmissing-format-attribute -Wcast-function-type -Wformat-security
-fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument
-Wno-compound-token-split-by-macro -O2 -pipe -O3 -funroll-loops
-fstack-protector-strong -fno-strict-aliasing -Wno-deprecated-declarations
-fPIC -DPIC -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_CONSTANT_MACROS -I/usr/local/llvm15/include
-I../../../../src/include -I/usr/local/include -I/usr/local/include
-I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include
-I/usr/local/include -I/usr/local/include -c -o llvmjit.o llvmjit.c
llvmjit.c:1115:50: error: use of undeclared identifier
'LLVMJITCSymbolMapPair'
LLVMOrcCSymbolMapPairs symbols =
palloc0(sizeof(LLVMJITCSymbolMapPair) * LookupSetSize);
^
llvmjit.c:1233:81: error: too few arguments to function call, expected 3,
have 2
ref_gen =
LLVMOrcCreateCustomCAPIDefinitionGenerator(llvm_resolve_symbols, NULL);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^
/usr/local/llvm15/include/llvm-c/Orc.h:997:31: note:
'LLVMOrcCreateCustomCAPIDefinitionGenerator' declared here
LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(
^
2 errors generated.
gmake: *** [<builtin>: llvmjit.o] Error 1
*** Error code 2

I've prepared a patch (attached) to fix the build issue with LLVM 15 or
above. It is also available at
https://people.FreeBSD.org/~sunpoet/patch/postgres/0001-Fix-build-with-LLVM-15-or-above.patch
Thanks.

Regards,
sunpoet

Attachment Content-Type Size
0001-Fix-build-with-LLVM-15-or-above.patch application/x-patch 1.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2022-10-03 04:00:12 Re: proposal: possibility to read dumped table's name from file
Previous Message Thomas Munro 2022-10-03 03:03:12 Re: pg_upgrade test failure