From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 9SxMNUsV02JyXQEAbAwnHQ (envelope-from ) for ; Sat, 16 Jul 2022 21:45:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EMlWNEsV02LHfQAAauVa8A (envelope-from ) for ; Sat, 16 Jul 2022 21:45:15 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A2FA838E18 for ; Sat, 16 Jul 2022 21:45:15 +0200 (CEST) Received: from localhost ([::1]:46192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCniz-00041h-Lu for larch@yhetil.org; Sat, 16 Jul 2022 15:45:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnio-00041Z-DB for guix-patches@gnu.org; Sat, 16 Jul 2022 15:45:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48376) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnio-00046F-3k for guix-patches@gnu.org; Sat, 16 Jul 2022 15:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnin-00057h-UL for guix-patches@gnu.org; Sat, 16 Jul 2022 15:45:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH] gnu: Add cross-clang. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 54239@debbugs.gnu.org, Pierre Langlois , Maxime Devos Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800069319664 (code B ref 54239); Sat, 16 Jul 2022 19:45:01 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:44:53 +0000 Received: from localhost ([127.0.0.1]:46135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnie-000576-Ll for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:44:52 -0400 Received: from lepiller.eu ([89.234.186.109]:44364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnia-00056u-I7 for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:44:50 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 96e8afd9; Sat, 16 Jul 2022 19:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=3RoRLhemxTxW uF9tBlSRtHvbbj3WJfWO9j8qLnqe0Kk=; b=TJ0x9ziL1K66tUL2uLvSFB6ugCAr WEB75gw9qEMre3B5d17Bv0C95oADpliHnLS57IRr/CbCFtDPPT5enyKukzJs3HRV hIG9WLOocvQUync9M6gURB+NxbDY71x/Cpg/gz68RP9ENy93TExzo1GE5BOMDwb6 LiUOfmGoigvjSh280lEIgjbJXroz+1df9N+KIIx8/emnruHDEhnPawHA3NTPSA3O vUM3DJYq3kKBgCR7IK2dRt3p2CJBEmwmUsaw74XJI5RSArhLZg8hw4ou1+pJCkSl kLIuV0O80di+P5JEGTOPm4Fh5cK8zr9B5RSZBdfGndiaJvla9ZklUvgXHQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3e92a1db (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 16 Jul 2022 19:44:44 +0000 (UTC) Date: Sat, 16 Jul 2022 21:44:24 +0200 From: Julien Lepiller Message-ID: <20220716214424.1d521d65@sybil.lepiller.eu> In-Reply-To: <87czg7uho8.fsf_-_@gnu.org> References: <499e5dba47ef40df93a8b33fbb8e41cc2354e7a1.1646387919.git.julien@lepiller.eu> <937fd2ca36d8368ea83be56ae29dbec1a97bfb41.1646387919.git.julien@lepiller.eu> <04c47fe2e1f964a675697f3e389f6226e11f9815.camel@telenet.be> <87czg7uho8.fsf_-_@gnu.org> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658000715; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=vMr6etfnApsLjFQ3dBMR6aQJAGKqVWypqVLV4CVc1/4=; b=ViH6v0NSI7rqkgXL5mbd/lhJzKAMX8UWWctzwsnuNtSGfryt9oPmH8x3wE2Hq7Y4KgSjrv eqHc0ipFCes+f8iLDpgO2CyOP5PrarK2oL7VbpUcCQ3phPxlORWpyRjOL0EfVeWJvJt5a+ eM78ayycN4eIW16rMv86dSSryFY0/3QbpprqpMMQ5YExLndU31jcXYASGAJsT7SVvGDE55 kxSaVW3/V4HdJpl+fkcc/cu0lsMRqdFj7phLEoz7QLJnKdREsJyhxsdIbqQsc6ax1ga7qT qOqGOwlnoZ3bksK+O+B7FQBDLLca0++cG1i05HvPFKp23JX5SZtIo28GF8BlSA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658000715; a=rsa-sha256; cv=none; b=II/hPGXlQOTPbrEW4BG5sMzik+nwxATwKp5OQOMUeDIWfRuhYtDb+5nqqBgK1ekEsZE3jk uEFwgLhUkGjOuES/eEsW6PeFnZVySOFKv41MSHEhvCr/C7SMK+tGU8iVlplEDoQDZBh1sC ELeVVST9OyrYSp75oH/7xqBig3YYpof+KQmhNrOQf+ejrxiYB5N+IXBJqE4Hf/BLjUwkGr r2eg5QRLRPh0ZCmdpPmHw7dmjqrh27F5dlEEZsUfQDSi2anUsYinvdE5TXH+Lcl5dRQMTC 4T3z+vgqXfCRS5HEs2m1xJPpiyO6GAV0LKckwPZagN54/9s0wwXb0GWD4CUTyA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=TJ0x9ziL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.26 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=TJ0x9ziL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A2FA838E18 X-Spam-Score: 5.26 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6+0lKr8YI6WP So, I tried using only a wrapper around clang to pass --target. However, this doesn't seem to be enough: the code disables LIBRARY_PATH when cross-compiling and it picks up the wrong gcc:lib and libc headers. Instead, I tried to improve the previous patches, and here is v3. To reply (maybe again) to remarks on the previous version: - no it's not necessary to build a specific llvm package, but that way we make sure that the default target is the one we want, so we don't have to change the instructions for packages that use it, or to use a wrapper to pass the --target argument. Maybe a wrapper could work better though. - clang-for-target was added in the patch that adds cross-clang. - the configure flags are now a gexp - I kept the substitute for "/lib64/ld-linux-x86-64.so.2", it's the same instructions as in clang, so I prefer not to change it. It's a bit sad that we'll have to change in both places if needed :/ - (gnu packages cross-base) is autoloaded now - I'll leave documenting limitations of package-with-c-toolchain (or improving it) to another time. - I have no idea how to make it work for wasm, but that can probably be fixed another time. Also, it's not listed in supported targets, and guix doesn't let me build for that target anymore. - Fixed build issues for clang >=10. I also agree that clang-runtime should be cross-compiled. It is a propagated-input, but cross-clang is a native package that is a cross-compiler for another architecture, so the inputs are native too. Since I couldn't figure out how to make a package for a given target, I added a transformation to (guix build-system) that replaces the keywords to force a package to build for a given architecture. Also, I added libcxx and libcxxabi 12 at the end because I need them for the newer versions of android tools.