From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id IKIyH3hpQmf5yQAAe85BDQ:P1 (envelope-from ) for ; Sat, 23 Nov 2024 23:47:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id IKIyH3hpQmf5yQAAe85BDQ (envelope-from ) for ; Sun, 24 Nov 2024 00:47:04 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=elenq.tech header.s=soverin1 header.b=FuMrALML; 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=1732405624; a=rsa-sha256; cv=none; b=Zc3bPKV+rCngSGoAcl5jJKVPxk6gsHSHDAc4+dq59AD6COYcGvMGDxr/lpmZsDf5l6yXh7 6kiMX4jaejgfadmvM4OgZmK4RCxZSvcVGqLAo4Xf/8qkyI+pTlvErkR6PRSUkH+jIcZVSU s114QqCcAIYUcW5gzRQRtLG7p8aCY4dpm1Zwy6Ldokt9DiZznvfrTtXmkrEGUqq+MhTRME OA/Rj1jTGzO4oxp7HavbOPMfF4J8NGVvIbXyIyZZXnhmNEOOAQ11cTHO5UVnGFab4fgmD9 7T1X8I7KW5vrIj8H5iBBGAV5db/Ut2xoeZMLVLUSXqqHHZz+RFD+FbMrYjbQIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=elenq.tech header.s=soverin1 header.b=FuMrALML; 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=1732405624; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature:autocrypt:autocrypt; bh=ABmD76+lfpcFOJcRnm/1dlLLp/TZurtE17n7JwftB+k=; b=u1xAcKBPs0oIh2n5tS4RDnmovxwpM+m6IMP7/7KdY/er+ufzuVPf+sAs0OgK5+g1SpoUNT Hi2tQM79D44y2bdHwphau9ZOrLSKe5nCklWnmtlhSEb6Ore3/BtXT5iSqzoGSgctEO6Kbu Ky33GRuVeHYrynd8DxKr7jNROF6vYh66ElKVbPUxbsipSLlhBLNp2210wiid47qtRRzN9j e1nDwp15Zan5sREaPdHjkx4rEABElUmjqL+/QSjyAUPUE4ZEY8/9BVCF2T50cUS/JEUNBr Sw3gHSr04euImsI7Xu87x4FawRdBaUWFE5MdkiMmc/8zHCUNGJsrzXePPslA1w== 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 C0BC9779BC for ; Sun, 24 Nov 2024 00:47:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEzpq-0006vx-Vm; Sat, 23 Nov 2024 18:46:43 -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 1tEzpp-0006va-0r for guix-devel@gnu.org; Sat, 23 Nov 2024 18:46:41 -0500 Received: from dane.soverin.net ([185.233.34.148]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tEzpl-0002Al-Ls; Sat, 23 Nov 2024 18:46:40 -0500 Received: from smtp.soverin.net (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4XwpWy2vcrz2xQg; Sat, 23 Nov 2024 23:46:22 +0000 (UTC) Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4XwpWx4JvhzTq; Sat, 23 Nov 2024 23:46:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=soverin1; t=1732405582; h=from:from: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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ABmD76+lfpcFOJcRnm/1dlLLp/TZurtE17n7JwftB+k=; b=FuMrALMLqmP8souAezOW2TmU7c/SgDaKu6OD2WJT2+Kt7LYMLhpwtYxTPnH1sWOz2ZaZWh S8LObrhcWhk8hF9vyLw2zZlNfQTE+tfaV2A7qKQLiifdWWb8pTH5eiBF857dQno9H95Uea fxUDrOFMxnRwg84EFskXpmEpmyFXPzn49jj/hrKmFMMSL/1N9VLl9E6NXWnx5sp2qlXyID rJ4RfnLBWFzOlr1fAEV0k3J2TolmrTy2KqFQV6PIK/PE4/nIXl9xGO+/PxzKKY4V8lsyoV gzAz8vkRIihhKSv/0qPh8rWg6oanhXKp6JtiLVV5X2C+Ts85gR6Vs+GDqX38gw== Message-ID: <0264411c-437d-4e3e-a5ea-20ea4886b3ef@elenq.tech> Date: Sun, 24 Nov 2024 00:46:21 +0100 MIME-Version: 1.0 Subject: Re: A different way to bootstrap and build GCC To: Stefan , guix-devel@gnu.org Cc: Attila Lendvai , =?UTF-8?Q?Sergio_Pastor_P=C3=A9rez?= , Efraim Flashner , Timothy Sample , janneke@gnu.org References: <21f4ee5a-cd62-3b55-f0c5-ffd5272d1194@vodafonemail.de> Content-Language: en-US, es-ES, eu From: Ekaitz Zarraga Autocrypt: addr=ekaitz@elenq.tech; keydata= xsFNBGcvh/QBEACePF16wEeQaqfJNgeaSQB6ty6PzLaYtl8UVApPSCF1PYNEhDtxQOOpBXeu k6h68cjhRX7hmug8mAraXotw4aG4Z3kbUro4fzXOYW3rCi/mAm5NFXLUmBX3E1AV1pcD8hDA 5s3LeGzfTo4xRGTW4zTzxGEyrvbChkVib7wTSk52a/WkFas6l3sXnepF8HmIEOWkwQcYdcuo gaNDFP1kjZYvqfKJXmCZnY+lC8Zfe/vlD/x8FZQYBQ5xgXIfbSR0xlRz/XIHfJv6j+3myUUr 2UKMku1dkjlkhNkyfw+RypQzmbJ0oJ4bk76/ju0nnlN65/LvyeTVUh/2O2VnPnZ49keL8sqr APXF4di4pWT+/mPxfoEtiSDtjyzbr8+ajcwLa4SSKLlexqjZj8X6R4tt31Rf/Pliwe4TdPmd 2leE3BIJl9bAuslEvd5tqZ1oa3Zfb62tvpaJCRYMtOEWuGkYdyrwTW7UXJPQpam4X7WoW2jW c5aTpAnpnqIPzaWJmua1lGQjEXgt4xvVdhVmZq32fkTy/rXw9l5a+XU7N4/Zz8AR/0xO+UBc Q1J+wHADjL8Q0v0tZLEaiWL72AsxN3GMWNPXWAplaTPUNPUlNK0JPHwhTX/cQVkIc9avSKc3 BeUofC96d13I7QmRjQ0gcBaLtV9lMOuYwbC+6tb70x2fQsI3bwARAQABzSJFa2FpdHogWmFy cmFnYSA8ZWthaXR6QGVsZW5xLnRlY2g+wsGUBBMBCAA+FiEEXb4j05BTZSZ/jMdq/blSvT9z VtYFAmcvh/QCGwMFCQPCZwAFCwkIBwIGFQ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L2PaDk+2TdfrzNwNFbkABJ+C7BHNAytQ6h9cpUbg== In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spampanel-Class: ham Received-SPF: pass client-ip=185.233.34.148; envelope-from=ekaitz@elenq.tech; helo=dane.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.77 X-Spam-Score: -6.77 X-Migadu-Queue-Id: C0BC9779BC X-Migadu-Scanner: mx10.migadu.com X-TUID: J8+34hJgIKuw Hi! On 2024-11-24 00:20, Stefan wrote: > Hi! > > I got a step further with the different way to build GCC.  The problem > not using the proper multilib variant for embedded systems is solved now > and I updated to GCC 14.2. > > To cite myself, my gut feeling is that the whole GCC version chain > starting in (gnu packages commencement) should be build this way.  So I > started to play around with the bootstrapping of GCC. > > 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. > > The initial packages I reuse are: > > %bootstrap-guile > gash-boot > bootar > gash-utils-boot > tcc-boot0 > gnu-make-mesboot0 > gmp-boot > mpfr-boot > mpc-boot > > > 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. > > 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. > > These are all static builds so far.  I'm using latest versions of all > packages, except Binutils, whose version 2.43 does not link the object > files from TCC.  I avoid to use --build=i686-unknown-linux-gnu to make > it possible to build for other architectures as well. > > I think the next step should be GCC 14, then glibc with shared library > support and GCC 14 again. > > 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.  They are all described in > the comments.  Maybe gash and gash-utils could be improved in future. > The most annoying thing is that only one core can be used for the > builds, otherwise they hang.  I guess it is related to gash in > combination with %bootstrap-guile, at least using Make 4.4.1 makes no > difference. > > I published a git repository at > .  Unfortunately it's not > a proper channel yet.  If someone likes to give that bootstrap path a > try, use this command: > > guix build --cores=1 -L GCC-10-bootstrap > > The working GCCs can be build with > > guix build -L GCC GCC-cross-picolibc-arm-none-eabi, > GCC-cross-newlib-arm-none-eabi > > There are GCC…-toolchain package as well, which propagate ld and all the > other tools from Binutils.  But if these tools are only used indirectly > through the gcc or g++ drivers, these GCC…-toolchain packages are not > needed at all, as the GCC packages are standalone.  There are also > GCC…-c-toolchain variables for use with package-with-c-toolchain.  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. > > I hope this will be useful, maybe it can help the RISC-V bootstrap > effort.  I'm open for suggestions how to proceed from here. > > > Bye > > Stefan 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): https://github.com/ekaitz-zarraga/commencement.scm Is there any obvious difference in the beginning of the chain that I'm missing? 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 couples, but also because Musl is very easy to compile (and also read and patch, when needed). We also went straight for a modern GCC and left many other packages in the way. Efraim is working adapt that into Guix so he probably would have more to say about it. Interesting work, thanks for sharing! Ekaitz