Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goHcj-0000gh-E0 for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jan 2019 00:51:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1goHci-0002SH-2O for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jan 2019 00:51:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goHch-0002S9-R3 for pgsql-hackers@lists.postgresql.org; Tue, 29 Jan 2019 00:51:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goHce-00035E-UW for pgsql-hackers@lists.postgresql.org; Tue, 29 Jan 2019 00:51:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x0T0pMbQ031364; Mon, 28 Jan 2019 19:51:22 -0500 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: Header checking failures on LLVM-less machines In-reply-to: <19808.1548692361@sss.pgh.pa.us> References: <19808.1548692361@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 28 Jan 2019 11:19:21 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31362.1548723082.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 28 Jan 2019 19:51:22 -0500 Message-ID: <31363.1548723082@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Since the LLVM stuff went in, src/tools/pginclude/cpluspluscheck > fails on my main devel machine, because Actually, it also fails on another machine that does have LLVM installed: In file included from /tmp/cpluspluscheck.LqnoZj/test.cpp:3: ./src/include/jit/llvmjit_emit.h: In function 'LLVMOpaqueValue* l_ptr_cons= t(void*, LLVMTypeRef)': ./src/include/jit/llvmjit_emit.h:22:32: error: 'TypeSizeT' was not declare= d in this scope LLVMValueRef c =3D LLVMConstInt(TypeSizeT, (uintptr_t) ptr, false); ^~~~~~~~~ ./src/include/jit/llvmjit_emit.h: In function 'LLVMOpaqueValue* l_sizet_co= nst(size_t)': ./src/include/jit/llvmjit_emit.h:78:22: error: 'TypeSizeT' was not declare= d in this scope return LLVMConstInt(TypeSizeT, i, false); ^~~~~~~~~ ./src/include/jit/llvmjit_emit.h: In function 'LLVMOpaqueValue* l_sbool_co= nst(bool)': ./src/include/jit/llvmjit_emit.h:87:22: error: 'TypeStorageBool' was not d= eclared in this scope return LLVMConstInt(TypeStorageBool, (int) i, false); ^~~~~~~~~~~~~~~ ./src/include/jit/llvmjit_emit.h: In function 'LLVMOpaqueValue* l_pbool_co= nst(bool)': ./src/include/jit/llvmjit_emit.h:96:22: error: 'TypeParamBool' was not dec= lared in this scope return LLVMConstInt(TypeParamBool, (int) i, false); ^~~~~~~~~~~~~ ./src/include/jit/llvmjit_emit.h: In function 'LLVMOpaqueValue* l_mcxt_swi= tch(LLVMModuleRef, LLVMBuilderRef, LLVMValueRef)': ./src/include/jit/llvmjit_emit.h:205:34: error: 'StructMemoryContextData' = was not declared in this scope cur =3D LLVMAddGlobal(mod, l_ptr(StructMemoryContextData), cmc); ^~~~~~~~~~~~~~~~~~~~~~~ ./src/include/jit/llvmjit_emit.h:205:34: note: suggested alternative: 'Mem= oryContextData' cur =3D LLVMAddGlobal(mod, l_ptr(StructMemoryContextData), cmc); ^~~~~~~~~~~~~~~~~~~~~~~ MemoryContextData ./src/include/jit/llvmjit_emit.h: In function 'LLVMOpaqueValue* l_funcnull= p(LLVMBuilderRef, LLVMValueRef, size_t)': ./src/include/jit/llvmjit_emit.h:223:9: error: 'FIELDNO_FUNCTIONCALLINFODA= TA_ARGS' was not declared in this scope FIELDNO_FUNCTIONCALLINFODATA_ARGS, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./src/include/jit/llvmjit_emit.h: In function 'LLVMOpaqueValue* l_funcvalu= ep(LLVMBuilderRef, LLVMValueRef, size_t)': ./src/include/jit/llvmjit_emit.h:241:9: error: 'FIELDNO_FUNCTIONCALLINFODA= TA_ARGS' was not declared in this scope FIELDNO_FUNCTIONCALLINFODATA_ARGS, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Evidently, llvmjit_emit.h doesn't meet the project standard that says it should be includable standalone (to ensure that header inclusion order isn't important in .c files). It looks like it needs to #include llvmjit.h and fmgr.h to satisfy these references. Is there a good reason why this wasn't done? regards, tom lane