Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qCPZX-0001IE-R3 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jun 2023 19:02:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qCPZV-0008BD-Qo for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jun 2023 19:02:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qCPZU-00089g-4P for pgsql-hackers@lists.postgresql.org; Thu, 22 Jun 2023 19:02:21 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qCPZQ-003fWL-J5 for pgsql-hackers@postgresql.org; Thu, 22 Jun 2023 19:02:18 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9AE493200657; Thu, 22 Jun 2023 15:02:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 22 Jun 2023 15:02:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1687460533; x=1687546933; bh=IO l5kChjUzdkxNDwXHZ6MUO+WiH2NlJh1LztHQosGsE=; b=i5W3ADxB+dx4lvN8fp Xt5jcGEsm5DTnLT+zG9cyJqKMC3UqRFlviNsFFdnoXn3RzcWfH4BuC69WRr/kstf SkMRirCs4CJlqrNDLlyrdKgpnj5eFdEkyzssXiXE6ENwC/QuYK+17SMHwa7Geqf6 0ksxQGVF7g5p7KQsDBv7/8UJGpZ9+3ER/ilasR+vzdf3XIgLH6fogj6mMwLJSR08 Y6G7i/CaAoYjQKlMwshH+iWN+82oKQgynz99rtjb2T6ojaRD80QVq1pC0jB4vCqZ Mi6q0uT4m/aY+NMXJ6Cw/LSFsgf2r9SldYN4x2USpdMwApqzw1BpqZJWl5bz1xnJ 4kpg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1687460533; x=1687546933; bh=IOl5kChjUzdkx NDwXHZ6MUO+WiH2NlJh1LztHQosGsE=; b=D8tZynyY7+qQh7oEvVu4BWoXHXpXJ dTG05nfL7PtcIALmTaWinn5f67AFFhK15/U3SOJY2ksnmF44yKUuhJMEcrX+KzCz b+ul4VHVozyDEtLflPShztX+fB+qEH06mIvxSrepJPhMQnzh02IY21jagMf6YJUZ zOB+EWt3qRd5SerRPHanleOI4ecU1kDvC52uGNNL+J6whP4FIW6/5fWMjMLqY85O +4wFNqzkyg3/vh7mkL6wxvIHeh3cUM+MWeYHd1FwPt973pekHpeUTXqvLPPD/axf jhpQ42bfsRdG+ktohFOptF3nLKXrQmoHXZjqx+dZl5+dJXgt7v9fm31SQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeeguddgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteev udeitedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 22 Jun 2023 15:02:12 -0400 (EDT) Date: Thu, 22 Jun 2023 12:02:10 -0700 From: Andres Freund To: Palle Girgensohn Cc: PostgreSQL Hackers Subject: Re: OK to build LLVM (*.bc) with CLANG but rest of postgresql with CC (other compiler)? Message-ID: <20230622190210.ns5iatr3zahwv6pt@awork3.anarazel.de> References: <1622CA17-30EE-4838-9180-126E8E66EC53@pingpong.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1622CA17-30EE-4838-9180-126E8E66EC53@pingpong.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-06-13 11:20:52 +0200, Palle Girgensohn wrote: > CLANG is used to compile *.bc files during postgresql build. Is it OK to > have a different compiler for the rest of the build? gcc, or even another > version of clang? Yes. > LLVM is an optional add-on, a package. The default version is 15, and it also installs the clang15 binary for the corresponding clang version 15. > > As I understand, you're "better off" compiling the LLVM stuff in PostgreSQL with the same version clang compiler as the LLVM version you're using. Hence, with LLVM 15, set the environment variable CLANG=/path/to/clang15 when running configure. If the .bc files will get compiled by the base system clang compiler, this can lead to a ThinLTO link error, if the base system compiler is a newer versione of llvm. Yea, the compatibility matrix for llvm bitcode is complicated. > The question is if it is a bad idea to use the base compiler, say clang13, > to build postgresql, but set CLANG=clang15 to match the LLVM version. Am I > better off using clang15 for everything then? That should be entirely fine. If you already have the newer clang version, it might also make sense to just use it from a simplicity perspective (e.g. compiler warnings being the same etc), but it's not required. It works just fine to compile the postgres binary with gcc and use clang for the bitcode after all. Greetings, Andres Freund