From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id +JdhE7vjQmc6pwAAe85BDQ:P1 (envelope-from ) for ; Sun, 24 Nov 2024 08:28:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id +JdhE7vjQmc6pwAAe85BDQ (envelope-from ) for ; Sun, 24 Nov 2024 09:28:43 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=N35uk314; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732436923; a=rsa-sha256; cv=none; b=QhcT2fM4gzpY3+dKm0K7aPDY+a8Fsa9kJbMIV65Di2IFHIhXTsJlDUNPVztZPilr2NLJCI h/R11irSz1X2bgqqJCYfNR5JUSFDmqDYVhkjf7ljpXoUA6jGkrHOYuQFHza/P6vcTBnQCR YD1KhfkNUSNgazNZcigIJS8XHrKtaRIQmyByEWQVkTc3th+c0M0Jbnrrc/1UrD1Ox1UuXj mx1PO9kbRmA/h2Pw9Xw8eGqTDCY/5FRRyjfaUjPJawfAO7EoTesa5YV7C7U7AxZGWk0xJi LjCnmOCIo8Km3WNGRyTeQnr3Uvy8qJ7v2fdZASCxRwQIF4knGSpBqe1P16iyFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=N35uk314; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732436923; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tZYLGTAcPuwL0F1D2SC1Ew5oNz10DIWczUz87PV3rrk=; b=IdEnxInf0q7Hx9i3tBTbl+jA2cb5lGe8QDGKniT+K+PZh7KiMHfhKQaBw2dx8HqSP1puXp j8+YzX4wABd7L0piNSi59zBlpevYxxeTHhJa/IztaQ+yuyHz8ozRCyk5EyZVBM96DWb7zt 9iXkOC9Yv4Y86nSH9vU1pZF4vY++cZhhQxSlym5CpxMkouNgrtzu1AtfiN23oL5rMCT/Oh zoNVOcyu/VbqX9WJ+wJejzew4JyB3K0m2OvYnN3CN/NeDvuqk1X4YgCQYHzXjiM+OlZEzQ Rg5WhZ8DKV6N8LPZNy8vo2AY2IKGqmFMovYg5K6xBa24SRH13JVjKlCwmANg0w== 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 E624D792A9 for ; Sun, 24 Nov 2024 09:28:42 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tF7yI-0007su-Su; Sun, 24 Nov 2024 03:27:58 -0500 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 1tF7yF-0007sl-5z for guix-devel@gnu.org; Sun, 24 Nov 2024 03:27:55 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tF7yC-0006Kw-SI; Sun, 24 Nov 2024 03:27:54 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43152b79d25so31080995e9.1; Sun, 24 Nov 2024 00:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732436870; x=1733041670; darn=gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=tZYLGTAcPuwL0F1D2SC1Ew5oNz10DIWczUz87PV3rrk=; b=N35uk314yl5LDiNNsXbVhOCO+fluYXfUkjFBuA7wrr95UwJoeThh3UVFhRXBe6f/1V V+oi3YUnTO0Gh5SK/rbPEJyCU7N19VyfYuIwEnfqmAlS2i+AgiT1meXDQ75O71yjQ2ih 7TBD8lagDqXqB5MtF+BbEb21vImJBM/Agcj8ZRqDCdUvrtrN26MZxbOWWW1yGDEK/y0w 19aUDsmFfxfwuCMCA/fpxulAXhWKRO8HaaAuKXiotJ9GpEEC6J6d1osI+PhHL3Wm3Egm b3oVLb+bP56YRcBxHnXiTQ1gBu6jxwQn8NghHUyIhYpFHwQbuFowxgPwGhtSNH5VHTeX Wksw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732436870; x=1733041670; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tZYLGTAcPuwL0F1D2SC1Ew5oNz10DIWczUz87PV3rrk=; b=VZi7CamGAkNgbT8dqyOhLDnozQ+27ghZgjfteFB0BUmUHqs1U96h3Fmd2T3L5IYQRn PmtmD6EeF4dtIQjT9mtRDvtaJ2ZCs8W8i1xrHBeXzQnChN18GxS0EQPszE5ObIP8Ks5J Wm1LmqWYS2zK/5VbAm+JtLueJiY7MYJSf25tfSThhyKSGIR/hyZ79Q7tY+7c6SfpLa6l K6Tsnr8HSsAFb51P0UkLPntDk2kHSbFG2K5DHvd09m04SFguDurNeCegyZO8Vj+vAwtC 62cEdg4EB4A/60GDOLScamZWfXW+JW+VPFPyysKZS5sUCzE3fmJTWihsUEhMrj4e+LsF OqRg== X-Forwarded-Encrypted: i=1; AJvYcCUy8ztInws0XWn9NuYLGU9+3NgebSQqAfpKPe80h1lEz5VQEc8XN+ayd9rUYwOe2n0Yg9PafMdktdeA@gnu.org, AJvYcCW//z0HmOx9VBOGFOQUwEyQNvaEDZfyvKpv9zPk/YMfhrP8KdTkQ94B+YOtlP87HA2e8hewfFst6A==@gnu.org X-Gm-Message-State: AOJu0YxhodJ2l8a5oQ/Jc0lpFvvF2pPcx169jGS2bRU0OAnJXft10GIK rEo2e5d03NS2NrgwcfnVk68xxjpck5tNWh+rLJ62fIbxdkpwwWZj X-Gm-Gg: ASbGncuJlErL492U4gPIaEOh5o60nQrFumbEhrDsMbPUokNwzsW4fxat5CMtxU3lA87 NiHIALB3RYwGHkjChlaNbTWnor/wIFkgajQI1mV/68eX2jUlabVlKKUabDfoRUNRpI3D/htmaic fCnGG/NDH2ZB/KNY8SngTJZ+6czOCQPcIydhjx+HTi6fYMxDbYC7eKnHdf7+OQI2LSXnV8qgkzX rWy1Ju9J7wKwInMih54F6MMU7A5zEV+wlCoLKnflxmoxF7tZA== X-Google-Smtp-Source: AGHT+IGHgnf1t0lBdfgfI9nBmSSYZZREdaA0tBzIusROIoHkjhdDiJZOj0U0NUoruHqJBhRgsV+gsw== X-Received: by 2002:a05:6000:1acc:b0:37c:c5c4:627 with SMTP id ffacd0b85a97d-38260b46dc0mr7680564f8f.5.1732436870120; Sun, 24 Nov 2024 00:27:50 -0800 (PST) Received: from localhost ([188.120.129.43]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b4643217sm148211775e9.44.2024.11.24.00.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2024 00:27:49 -0800 (PST) Date: Sun, 24 Nov 2024 10:27:45 +0200 From: Efraim Flashner To: Ekaitz Zarraga Cc: Stefan , guix-devel@gnu.org, Attila Lendvai , Sergio Pastor =?utf-8?B?UMOpcmV6?= , Timothy Sample , janneke@gnu.org Subject: Re: A different way to bootstrap and build GCC Message-ID: Mail-Followup-To: Ekaitz Zarraga , Stefan , guix-devel@gnu.org, Attila Lendvai , Sergio Pastor =?utf-8?B?UMOpcmV6?= , Timothy Sample , janneke@gnu.org References: <21f4ee5a-cd62-3b55-f0c5-ffd5272d1194@vodafonemail.de> <0264411c-437d-4e3e-a5ea-20ea4886b3ef@elenq.tech> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cVgTAnjHBoudPLxt" Content-Disposition: inline In-Reply-To: <0264411c-437d-4e3e-a5ea-20ea4886b3ef@elenq.tech> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=efraim.flashner@gmail.com; helo=mail-wm1-x330.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: E624D792A9 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -6.67 X-Spam-Score: -6.67 X-TUID: hpV6ErYMSOhy --cVgTAnjHBoudPLxt Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 24, 2024 at 12:46:21AM +0100, Ekaitz Zarraga wrote: > Hi! >=20 > On 2024-11-24 00:20, Stefan wrote: > > Hi! > >=20 > > I got a step further with the different way to build GCC.=C2=A0 The pro= blem > > not using the proper multilib variant for embedded systems is solved now > > and I updated to GCC 14.2. > >=20 > > To cite myself, my gut feeling is that the whole GCC version chain > > starting in (gnu packages commencement) should be build this way.=C2=A0= So I > > started to play around with the bootstrapping of GCC. > >=20 > > Starting with only few packages from (gnu packages commencement) I so > > far managed to build a static GCC 10.4.0 using a static musl 1.2.5. > >=20 > > The initial packages I reuse are: > >=20 > > %bootstrap-guile > > gash-boot > > bootar > > gash-utils-boot > > tcc-boot0 > > gnu-make-mesboot0 > > gmp-boot > > mpfr-boot > > mpc-boot > >=20 > >=20 > > Using only these I build a recent TCC from 2024-08-20 with Mes from > > tcc-boot0 as C library, and then MUSL 1.2.5. Then (only) three > > iterations of TCC with musl are needed to get a stable TCC with working > > floating point support. > >=20 > > The chain continues with GNU Make 4.4.1, Binutils 2.42, Findutils > > 4.10.0, GCC 4.6.4 with gmp-boot, mpfr-boot, mpc-boot (the version with > > the RISC-V patches may just work), M4 1.4.19, GMP 6.3.0, MPFR 4.2.1, MPC > > 1.3.1, GCC 10.4.0. > >=20 > > These are all static builds so far.=C2=A0 I'm using latest versions of = all > > packages, except Binutils, whose version 2.43 does not link the object > > files from TCC.=C2=A0 I avoid to use --build=3Di686-unknown-linux-gnu t= o make > > it possible to build for other architectures as well. > >=20 > > I think the next step should be GCC 14, then glibc with shared library > > support and GCC 14 again. > >=20 > > I need several small patches to work around shortcomings in Mes, gash, > > gash-utils, missing functionality of version 3.8.0 of gnu-make-mesboot0 > > (version 3.81 would have it), bugs in TCC.=C2=A0 They are all described= in > > the comments.=C2=A0 Maybe gash and gash-utils could be improved in futu= re. > > The most annoying thing is that only one core can be used for the > > builds, otherwise they hang.=C2=A0 I guess it is related to gash in > > combination with %bootstrap-guile, at least using Make 4.4.1 makes no > > difference. > >=20 > > I published a git repository at > > .=C2=A0 Unfortunately it= 's not > > a proper channel yet.=C2=A0 If someone likes to give that bootstrap pat= h a > > try, use this command: > >=20 > > guix build --cores=3D1 -L GCC-10-bootstrap > >=20 > > The working GCCs can be build with > >=20 > > guix build -L GCC GCC-cross-picolibc-arm-none-eabi, > > GCC-cross-newlib-arm-none-eabi > >=20 > > There are GCC=E2=80=A6-toolchain package as well, which propagate ld an= d all the > > other tools from Binutils.=C2=A0 But if these tools are only used indir= ectly > > through the gcc or g++ drivers, these GCC=E2=80=A6-toolchain packages a= re not > > needed at all, as the GCC packages are standalone.=C2=A0 There are also > > GCC=E2=80=A6-c-toolchain variables for use with package-with-c-toolchai= n.=C2=A0 There > > is no separate libstdc++ package yet, the library is just part of GCC. > > A separate package will only be needed for Clang or other compilers > > (maybe Zig), but I'm not sure yet, if clang actually needs a dependency > > to GCC. > >=20 > > I hope this will be useful, maybe it can help the RISC-V bootstrap > > effort.=C2=A0 I'm open for suggestions how to proceed from here. > >=20 > >=20 > > Bye > >=20 > > Stefan >=20 >=20 > Very interesting work. I'll read it with more detail tomorrow but at the > moment it feels very similar to what we did for RISC-V (which is more or > less what live-bootstrap does): >=20 > https://github.com/ekaitz-zarraga/commencement.scm >=20 > Is there any obvious difference in the beginning of the chain that I'm > missing? >=20 > We also agreed in the RISC-V port that using musl makes everything easier, > mostly because of the RISC-V support is a complicated in glibc+gcc couple= s, > but also because Musl is very easy to compile (and also read and patch, w= hen > needed). >=20 > We also went straight for a modern GCC and left many other packages in the > way. >=20 > Efraim is working adapt that into Guix so he probably would have more to = say > about it. >=20 > Interesting work, thanks for sharing! Indeed, thank you very much! In terms of integrating the riscv64 bootstrap work I had gotten stuck building gcc-7 using Ekaitz's gcc-4.6.4 with riscv64 support patched in. In terms of what I've seen so far from your repo and reading your email I would suggest just trying to bump make from 3.80 to 3.82, it Just Worked=E2=84=A2 for me, even on riscv64. Also I had been using musl-1.1.24 as an intermediate step, but with some of your code I currently have 1.2.5 built and am testing that out. I'd also recommend checking out the wip-riscv-bootstrap branch on savannah https://git.savannah.gnu.org/cgit/guix.git/log/?h=3Dwip-riscv-boot= strap or one of my mirrors https://git.sr.ht/~efraim/guix/tree/wip-riscv-bootstrap to see some of the changes I've made to commencement.scm. For example I ended up rewriting the musl install phase. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --cVgTAnjHBoudPLxt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmdC434ACgkQQarn3Mo9 g1Htig//eSSWo0r6vI9dZ62tz9CiYntQx++ejuVjRlG4gnrfe4J9TBvHJjqmi5i0 I18Tl3eu7QhBz0NzUQJxLOnBjxitZ5wL80wWuVmdxZxRZGrjEHokwIG49/dHlhJV FklpIc9YEfVo5bnfTjOXKxw4kG+0euMZdA72WpcJcSZ8hPWZ3ZjJqvdeojc4Y8Vv qAlCLGQ4515Wh2oWw2MldOYLOigmNS3T+WeNvKoYRpg7npmt8S5hwnlwKM2GiLQi eiQ7O1qEW8HLPdRKJ1pg3908KgH+mEaH2VthD/N+O+irBbWYuwj8eonGuwK/WMD2 1XV3V7onwYm8PhjP1DPL4qwfz5qz8X6PYzt9HTUusu6NvpM7y3pm0LoWFADfzlMx oqNR7AJzEp9ndsVRZ4bGnzTPTKec+aTyMmmyJjwTK1E1BWdvWdgvsyfDMnHB33bd CZyIj/iNURFnDtir32Gw8HONC7GyK0fjmfQkpVz3AGD1byvMvfwQUzcngKQkQYj8 Z2c4I8T3cxwC7rivgbRKd8uBVKWOWp/jHQq+tHpYljwVMpIVx1ijBOFyn3TT2X2n 7szMwS1/xNDhGEBxxg3v/hC/Gev1Aq8EPDCMuvR4kzR6ffyRkfBl+WY2iIVaEqHa /uMjUkGRsFBYK+VA14SKkCfdLOe58yaKX+CRtEj14KCUraF0qac= =8usL -----END PGP SIGNATURE----- --cVgTAnjHBoudPLxt--