Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r044y-0033Hp-PB for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Nov 2023 18:12:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r044w-000UZA-SJ for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Nov 2023 18:12:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r044v-000UYp-IO for pgsql-hackers@lists.postgresql.org; Mon, 06 Nov 2023 18:12:02 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r044s-004H11-8w for pgsql-hackers@lists.postgresql.org; Mon, 06 Nov 2023 18:12:00 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 2163B5C00CB; Mon, 6 Nov 2023 13:11:57 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 06 Nov 2023 13:11:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1699294317; x= 1699380717; bh=2bie0dmc00fsu87S8WaxXwRmWStXPGLnBkVqtiQe4GY=; b=q 762/g7XlVRxZAgNI89WA/QA+H4vaXoJG+6ClBH/n/VWEP79TcxcUOF8C9WttEw/z 4aU8YOpD/yUSCF35fsF7zaB+j1+ftL+K+mUpsym93nb1nWG+GUnI2bbE3C2ElgY+ 9vKskl8MNrxbt+kElR0UddQF8DsSz06ai7Gs+Dwzzs3ihVm3WeBPsIN7cM11Zs5l /2LwPWCGmOdRBEzNajrgCxNKoqNErWDQbUgfyPasZqwI8OzXtO8/mX7YGKtzxzGJ cUFjQR7aV8yjlbIZjfZoPzq8xN5Ld+8PPgf4zIjsCSQ3ZMMyGl1pc79v+ZY8+EHE LdsLj0js0z033CfO5Rxrw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddugedguddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpedttdeffeeitdfghfeiffdtteeikeefffejgffhgeef hfduudehvdefffeljeeuueenucffohhmrghinhepghhithhhuhgsrdgtohhmpdguvggsih grnhdrohhrghdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnh hoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Nov 2023 13:11:56 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1699294314; bh=MeDaXfJ4A79QwbJ1e0vGmPvUcKnVCfTvRU0cXulPcWo=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=D3yXMC47VmJW90v8tW+SZnUrhE2BhgQGO0ibTtLuuUjqdt6FoffTyQpx2ICEhyFwC 1JE04PaMrrtO0NWG9IxKgJ/Baig7ycjGxoIwGBMXkcgjQLs95HCo1yJ6nTMKH7rkHi IETzMG4Xp1g1UautyGKYfZRvzPKqj1nONiVj8R0jcr33627FfV6UC2bzr1qKGVcEZZ rb0H/Iex+1xIOcQMl+eFYPd1njDFEdmH3hyzdAI860Xrz5cdtdMl0d+mXSIJch7mBZ 9XgTtvTdUEGtUQ03pyUmhnvDzbx+HMYcitMGex4rEOVIOf+hbJcVR2bl+MiaCa26BG foix1dZaocgYA== Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 691C4C1; Mon, 6 Nov 2023 19:11:54 +0100 (CET) Date: Mon, 6 Nov 2023 19:11:54 +0100 From: Alvaro Herrera To: Thomas Munro Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: jit: Support opaque pointers in LLVM 16. Message-ID: <202311061811.m5heranea4gj@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nfuqkma7htztljj7" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --nfuqkma7htztljj7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2023-Oct-18, Thomas Munro wrote: > jit: Support opaque pointers in LLVM 16. > > Remove use of LLVMGetElementType() and provide the type of all pointers > to LLVMBuildXXX() functions when emitting IR, as required by modern LLVM > versions[1]. > > * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions. I have LLVM 14 (whatever Debian ships[*]), and running headerscheck results in a bunch of warnings from this: In file included from /tmp/headerscheck.s89Gdv/test.c:2: /pgsql/source/master/src/include/jit/llvmjit_emit.h: In function ‘l_call’: /pgsql/source/master/src/include/jit/llvmjit_emit.h:141:9: warning: ‘LLVMBuildCall’ is deprecated [-Wdeprecated-declarations] 141 | return LLVMBuildCall(b, fn, args, nargs, name); | ^~~~~~ In file included from /usr/include/llvm-c/Core.h:18, from /pgsql/source/master/src/include/jit/llvmjit_emit.h:18: /usr/include/llvm-c/Core.h:3991:1: note: declared here 3991 | LLVM_ATTRIBUTE_C_DEPRECATED( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ These warnings go away if I change the conditional from LLVM_VERSION_MAJOR < 16 to 14. Let's ... do that? As in the attached patch. In 13, there's a comment about it being deprecated, but no macro to make the compiler whine: https://github.com/hdoc/llvm-project/blob/release/13.x/llvm/include/llvm-c/Core.h#L3953 This changed in 14: https://github.com/hdoc/llvm-project/blob/release/14.x/llvm/include/llvm-c/Core.h#L3898 [*] apt policy llvm: llvm: Installed: 1:14.0-55.7~deb12u1 Candidate: 1:14.0-55.7~deb12u1 Version table: *** 1:14.0-55.7~deb12u1 500 500 http://ftp.de.debian.org/debian bookworm/main amd64 Packages 100 /var/lib/dpkg/status -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ --nfuqkma7htztljj7 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-use-non-deprecated-LLVM-functions-starting-with-its-.patch"