From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6LszI7VPfmRLtQAASxT56A (envelope-from ) for ; Mon, 05 Jun 2023 23:12:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sO4zI7VPfmQSHgEA9RJhRA (envelope-from ) for ; Mon, 05 Jun 2023 23:12:21 +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 1B9933A6F7 for ; Mon, 5 Jun 2023 23:12:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6HUl-0002tE-Mg; Mon, 05 Jun 2023 17:12:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6HUg-0002su-Nq for guix-patches@gnu.org; Mon, 05 Jun 2023 17:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q6HUg-0005PG-F7 for guix-patches@gnu.org; Mon, 05 Jun 2023 17:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q6HUf-0003MT-Rv for guix-patches@gnu.org; Mon, 05 Jun 2023 17:12:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63576] [PATCH v1 0/4] Add aarch64-none-elf-gcc-toolchain. Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 05 Jun 2023 21:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63576 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: ludo@gnu.org, 63576@debbugs.gnu.org X-Debbugs-Original-Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168599950812895 (code B ref -1); Mon, 05 Jun 2023 21:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jun 2023 21:11:48 +0000 Received: from localhost ([127.0.0.1]:50430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6HUS-0003Lv-4N for submit@debbugs.gnu.org; Mon, 05 Jun 2023 17:11:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:55218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6HUP-0003Ln-Cg for submit@debbugs.gnu.org; Mon, 05 Jun 2023 17:11:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6HUP-0002rQ-6b for guix-patches@gnu.org; Mon, 05 Jun 2023 17:11:45 -0400 Received: from cyberdimension.org ([80.67.179.20] helo=gnutoo.cyberdimension.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1q6HUN-0005IY-2r; Mon, 05 Jun 2023 17:11:44 -0400 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id e9560664; Mon, 5 Jun 2023 21:11:37 +0000 (UTC) Received: from primary_laptop (localhost [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id 528147fb; Mon, 5 Jun 2023 21:11:37 +0000 (UTC) Date: Mon, 5 Jun 2023 23:10:50 +0200 From: Denis 'GNUtoo' Carikli Message-ID: <20230605231050.14dcc398@primary_laptop> In-Reply-To: References: <20230518182434.15531-1-GNUtoo@cyberdimension.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/iKntjpxOreA5V7F16fzZT46"; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=80.67.179.20; envelope-from=GNUtoo@cyberdimension.org; helo=gnutoo.cyberdimension.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685999541; a=rsa-sha256; cv=none; b=QeAvvTuZPGnOtUXSEAV0nDyN2d2WkfezxMvYcBTRf15qgNWHiN6buQSNipgDrYeWiimTC0 pd5xXvocmFL64mr6zHKkEmkJEXJ1LJOPK5av1MRl1zA0EeujAkVOsdBmT3tuvp7F1uMX/1 VWfen0SdM/550T1y9a2Gsnxe6jPL4WgX2RWqSsMTePd+XO+8ObqhfzrRpNWoRMmELjsPkp y4hho1t6D6ztmmAtWkrqc8q1aX9+P12PeLLcnNbeqEQg4zc8/IXN88+huY8/lS4B5kQFEY u7ekJ1J8HnKokQ5B98/EGgKfFC+iyL0bDvn2i/7QZC4YuZYN5EX1mx/8ucgkvg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1685999541; 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: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; bh=yv9unHHwkLQ0/WgN7n526GhBfnweXm165EampZARJCc=; b=KWBttmezWjKdflBWmaD2GOYZAygyjtOj0Abg6fRS5uy6zTZ3vzoIGYT2+79PX0U2Gf0T+Q xLgTuQ51zPhHybprfvCj2MjAg3tqcbohbT2Lpu8aIXdUJ79fQQfIT4v7jE4v1Jni/qXuqN OHTaxHaSaV0qidksOkbPZNJBd1cLCgqEFJ1golCFJw7xkbltNBcf+dVCd+Ed1lh10L6vcn u4rQ4nIUlOWb5urvQDHHSZgllNK4dsr+NqiN5fl47vBGvkq/nwB8muNxZeDU6/c1pkIpp7 WpbuX1tujFrwQaoda5/I9gK8L8fzKqAx/pkucB2VMsd8ltZ1Nt3ciOZBwTPMgg== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -5.29 X-Spam-Score: -5.29 X-Migadu-Queue-Id: 1B9933A6F7 X-TUID: +3qB+Pjf92U+ --Sig_/iKntjpxOreA5V7F16fzZT46 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 4 Jun 2023 11:43:16 +0300 Efraim Flashner wrote: > On Thu, May 18, 2023 at 08:24:34PM +0200, Denis 'GNUtoo' Carikli > wrote: > > Hi, > >=20 > > Here's a patch serie to add a GCC cross toolchain for > > aarch64-none-elf. For now it doesn't contain C++ support but that > > can be added on later. > >=20 > > I've validated by building u-boot locally with it. >=20 > I'm not entirely sure what this means. How is it different from how we > build u-boot now? My use case here is not to build the u-boot package but rather to build kernels and u-boot images outside of Guix, to build not-yet released revisions and/or to do kernel or u-boot development.=20 That use case works fine if the host and target architectures are the same as people can simply install the gcc-toolchain package. But when it's not, it's convenient to be able to simply install packages of cross toolchains. Some distributions like Arch Linux[1], Debian[2], Ubuntu[3], and their derivatives (Parabola, PureOS, Trisquel, etc) do provide packages for cross toolchains. Here I've confirmed that the patches I submitted work fine by building u-boot from source (for aarch64) on an x86 laptop running Guix and by running the resulting u-boot images on hardware like the Pinephone (with u-boot patched to not use crust, and I didn't try to boot Linux) and the Rock 4C plus (this was more extensively tested than the Pinephone, I booted a Guix image on it etc). However I am unsure if the approach I took with my patch serie is the way to go here as here we have some duplication as some of the toolchain packages generated specifically for u-boot are for the exact same architecture (here aarch64). I also plan to add more toolchain packages (at least for or1k, RISCV 32). So at the end it kind of doubles the maintenance. In another hand my approach works and it also doesn't interfere with u-boot packages (so we don't have a risk of u-boot breakages when my toolchain packages are updated). What approach do you think would be best? Do you have ideas of better approaches than the ones I proposed here? PS: I also noticed later on that I need to update newlib to 4.1.0, but I can do that with a v2 or in a later patch depending on what you think is best. PPS: Note that when building u-boot or kernels locally (not as packages), in addition to the toolchain, there are also some tricks needed to make things work out of the box. For u-boot I use 'guix shell -D u-boot-rockpro64-rk3399 openssl@3 python python-pyelftools'. As I don't have to redistribute the binaries I didn't look into not using openssl@3, but I'll have to look into it at some point. I then have to pass HOSTCC=3Dgcc to make as cc isn't defined. I also have to pass the usual CROSS_COMPILE=3D, BL31=3D, etc to make. For xconfig I have to use something like that: 'PKG_CONFIG_PATH=3D/gnu/store/[...]-qtbase-5.15.8/lib/pkgconfig/ make ARCH=3Darm HOSTCC=3Dgcc xconfig'. References: ----------- [1]https://archlinux.org/packages/extra/x86_64/aarch64-linux-gnu-gcc/ [2]https://packages.debian.org/bullseye/gcc-10-aarch64-linux-gnu [3]https://packages.ubuntu.com/kinetic/gcc-10-aarch64-linux-gnu Denis. --Sig_/iKntjpxOreA5V7F16fzZT46 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmR+T1oACgkQX138wUF3 4mOr8w//TSdr4AK6V9HFazETFgtwhAw5FjTXSRqT71jC0dB4kOLQZ7bEqIlKmOMm zN0YhGYnsWA2attaikxXbCpAzJyTaoDBtRBJenYeaYwk2DWsPKKRbkAsVQCd+hNc b0lAX/YK/U7VaMnevMMRqRupifNlSwZ9qmbxw1Gw9raWdNw/r78nHQiD0sl87dNA aEmZ+6vTa/Sq1x9neunEddsJQ6YRSLXU/edlgLSxftlLCFTTmz9KYiOr4tTMR/nn wBETzYAEWRF25y8yt1Yde9fIG6rGEq25HZx8qi1mijJ6b/yzdGIDHqC1IbMCXNXK 51Nr18lgeT+cuify5y20/ODolGBMSvZeu64ssn90XO7UMIkgFBBJ1olcqTAaQajo MQmiQHSB1zCy71W8V4NSPzHY7Z65hhrwmxXCokZHDFy6E5DSV8Ek1oHQtIGTtI32 rXlCwHK8rsiUOMXMYzupKF9iCCyJEjE7MG3FEWekhIGAcwvmlsnerc3Eh4Er0z6i ZWAUaMGuIIHX4Sl9KfZREhZS/3oh3A/EeSW0BCcI/UH+rb2XdBlQApuDd1hEX9x2 wNGDZFhcgrtlmWyDXQs5qboQ5M2j+zzIym5J+eSLX8s1p4mUntxwIkecldDSZ9jY ewBgvMq6q+4VHuA4pRnfU9PXCDs7hf0NcWJhHKdgDoqpTzjwsdI= =x/OZ -----END PGP SIGNATURE----- --Sig_/iKntjpxOreA5V7F16fzZT46--