From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id PzQEM7iPbWBCpAAAgWs5BA (envelope-from ) for ; Wed, 07 Apr 2021 12:55:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KNLAK7iPbWCmOwAAbx9fmQ (envelope-from ) for ; Wed, 07 Apr 2021 10:55:52 +0000 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 6221211E35 for ; Wed, 7 Apr 2021 12:55:52 +0200 (CEST) Received: from localhost ([::1]:44382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU5qh-0006qH-Co for larch@yhetil.org; Wed, 07 Apr 2021 06:55:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU5jt-0007JU-Vo for guix-devel@gnu.org; Wed, 07 Apr 2021 06:48:50 -0400 Received: from mail-40136.protonmail.ch ([185.70.40.136]:43478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU5jn-0002Ak-4v for guix-devel@gnu.org; Wed, 07 Apr 2021 06:48:47 -0400 Date: Wed, 07 Apr 2021 10:48:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail3; t=1617792516; bh=25FokPyvrttNrT+kVa1znwpu/3VYIDfdDFEMgGTGLf4=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=U0ckXUNCRneUk/ifsqCm4oHhfOS1z1TApvg8N5gkXBO2M4CzbYBdhnKnfDCubzmWw HKgvpZDwzEnCZYVTbaNjr4g2X4Gdzsl+aV+XBsj6CPN+h1eHIo8fpdtb5gX6QgiIUb uR+7z5jMPyImMxGvcfIXJYsWPoBhVndvtTZ9KLeqQ3l8DcWyHkTeG2UyEUDZ9ped4/ PsacD2CdNz+ed303i9u2oVvaq5WerMsfMaVe4ta2CLxZVu341nXCKj+Kq4wUacWI/D mFsMENNaH5uDs4uhEur1wGWWmv8aNIBKzoIkXglHfmQKKauaUZcGB/mIROmeE4V195 6N1vyWkbfJurw== To: "guix-devel\\@gnu.org" From: Ekaitz Zarraga Subject: Re: GCC: Canadian Cross + Dynamic linker issues Message-ID: <3fkeacs8utn3gE9NbPcDOyvCyS6o2fi09HtR7TI0JxEoWGxMog0fb0aPPkS5Ql99oJR2ine59PdzccC-XcVsjpxePdmzTxw2PdW1XT0OY0A=@elenq.tech> In-Reply-To: <_AbV1fmXZO2t0n9rEa7I0GVYI1tA0xCD5LM38VFA4-MeleekWvU1iPVJ_vgegmIBQ4LpwRFKzMKS2SY5_oXp6GbpnbaowL_MX5lwZNk61FI=@elenq.tech> References: <_AbV1fmXZO2t0n9rEa7I0GVYI1tA0xCD5LM38VFA4-MeleekWvU1iPVJ_vgegmIBQ4LpwRFKzMKS2SY5_oXp6GbpnbaowL_MX5lwZNk61FI=@elenq.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.136; envelope-from=ekaitz@elenq.tech; helo=mail-40136.protonmail.ch 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Ekaitz Zarraga Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617792952; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=25FokPyvrttNrT+kVa1znwpu/3VYIDfdDFEMgGTGLf4=; b=MuNN6aeiQy4Zvciu9Q4n1hBNYQ5eKeqlP+HqhucAdViFgKDDwExtJ9jpG/tn3pF1XVNCuF DVLn/CghYNmy71R5YBiM1ZQ6rsykCeFrK2CUEPeeJMMX3tTmhneAFcDjaiDd4l811XL1cq gGdB6umO3B28jfkjbiGLNOUySqMnhmlHLxtOCjmFxdWEHdkzx5wVTeVddjVupwnPbFK83f Ck990tckvKJa/Oimj08syaff4Fs1Ceth7vkyEU42R208gV4wMkawowrwzTKj1ZpN8eBFeH gbFTrbpV1PItlalfT2ZXwjelR2o7H17yU85AYCOU7BZy+nc6/bnT1Pz9KjhFbw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617792952; a=rsa-sha256; cv=none; b=CIcfa8FE89Pa56KmRTeNz9VdGKTvomf8kfg/+ZXiewhyM50yoC6NP3jMxGbiXvZj5mMown d1eai2CcA13IZqr70uD1GrYy3X0EvbBd5TpwpOymlOpET8/xUKxGR9yq1dQXmwvD3Lh5PR 6t2gYsQPRwvdrlbN0qT+dv4vUj/j1F78KmvxmdPO/hY/pW21jw6pBPGeSCQuuPvyQuTm2c juRsSPmM15nZtHVg0yS+dTr4PvPb0URnkLYeuZejSb8nLT13ozuvKQEqB7C2mAjzKoPoZT z3vqU7uNDVb4Xm6LpfloxMYjPr+vfZsbo8lgFJDjdbWrqccIFlit4ywIPkD/Fg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=elenq.tech header.s=protonmail3 header.b=U0ckXUNC; dmarc=pass (policy=none) header.from=elenq.tech; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -3.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=elenq.tech header.s=protonmail3 header.b=U0ckXUNC; dmarc=pass (policy=none) header.from=elenq.tech; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 6221211E35 X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: IHkMxXYwk61i Let me please bump this thread a little bit, since I didn't get any answer > Hi, > > I've been struggling with GCC package definition for a while and I hope s= omeone > can help me solve or improve what I think are issues in its definition. > > I'm working on a R7RS-Small Scheme implementation that compiles to RISC-V > assembly and I'm finding many issues to create a RISC-V cross compiler. > > Consider the following manifest file for my project, where I need a GCC f= or > a 32 bit RISC-V machine: > > (use-modules (gnu packages cross-base) > (gnu packages gcc) > (gnu packages embedded)) > > (packages->manifest > > (let* ((triplet "riscv32-unknown-elf") > (binutils (cross-binutils triplet))) > (list > binutils > (cross-gcc triplet > #:xbinutils binutils > #:libc #f)))) > > > The call to cross-gcc fails to find a dynamic linker and the installation > fails. > > This happens because GCC package definition calls to the function > `glibc-dynamic-linker` in `gnu/packages/bootstrap.scm`, that contains a l= ist of > possible triplets with their associated dynamic linker file name. > > I don't really understand why does a generic GCC package need to call a > function from the bootstrap module by default. I can see why GCC takes a = huge > part on the bootstrapping process of Guix but I think that kind of coupli= ng is > compromising the flexibility of the generic GCC package. Please, correct = me if > I'm wrong. > > That said, in the past, I sent a patch[^patch] as a workaround because I = saw > some references to AVR on the `glibc-dynamic-linker` that also used a fak= e > dynamic linker to avoid the function to fail but I got no response so I'm= not > sure if the change makes any sense. > > Digging further on the GCC package definition I found a note that says: > > > ;; None of the flags below are needed when doing a Canadian cross. > > ;; TODO: Simplify this. > > So I wonder if that's the source of the problems I'm finding here. > > The `glibc-dynamic-linker` function is being used twice in the block prec= eded > by that comment and only once more below, in some patches we are applying= on > top of the source code. > > At this level I'm not sure if there's any way to "fix" GCC package defini= tion > to be able to create cross-compilers or if I should create a separate pac= kage > for my specific use-case and forget about all this. > > I would love to take part and try to simplify the GCC package description= , but > as it is a fundamental package looks like a huge responsibility so I'd li= ke to > have some guidance first. > > Thanks, > > Ekaitz > > [^patch]: https://issues.guix.gnu.org/46059