From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id dkUjB11jU2DqTAAA0tVLHw (envelope-from ) for ; Thu, 18 Mar 2021 14:27:41 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EFJVAl1jU2AbKgAAB5/wlQ (envelope-from ) for ; Thu, 18 Mar 2021 14:27:41 +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 aspmx2.migadu.com (Postfix) with ESMTPS id 86FAAC4FF for ; Thu, 18 Mar 2021 15:27:40 +0100 (CET) Received: from localhost ([::1]:57150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMtch-0002AJ-OV for larch@yhetil.org; Thu, 18 Mar 2021 10:27:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMr6Z-0001FG-N5 for guix-devel@gnu.org; Thu, 18 Mar 2021 07:46:19 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:29873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMr6T-0002au-HJ for guix-devel@gnu.org; Thu, 18 Mar 2021 07:46:19 -0400 Date: Thu, 18 Mar 2021 11:45:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail3; t=1616067962; bh=fLXBhOLK0m4sB7drmkf/r00dVEtH5jV33JTGhenf3EM=; h=Date:To:From:Reply-To:Subject:From; b=MCcXA/wWeN7kMymsda9XQvqLpl9RBV58vHnK9YfelgtCHdJXZnqm8GxV1KqwCpCYw wDNNoXoO0peFPYfTBzKEJ3uuj6sU+ZITm1h0Y0QwCPAJgft8L6BjQq1VcTtZ5QN10N oX+dY8D7IhrK/s4GFNpnXuJMPn5T3uD/Bmsak00m2IcJStIkQpwgEShpu8JUDJXv3q 1An0LGm+Opsmb0b+YJMqO570UMIh1oSEIb53fdwwSSD4ZnGRusCB34xYCuPv+s5HcV VPzqhnEMBdL19N29Vm99iqJSbW60bmZR0p0M6l6opushTFeLGtnJH0L2JfuHXvouj8 Ej52pgSs3q0vQ== To: "guix-devel\\@gnu.org" From: Ekaitz Zarraga Subject: GCC: Canadian Cross + Dynamic linker issues Message-ID: <_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.22; envelope-from=ekaitz@elenq.tech; helo=mail2.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-Mailman-Approved-At: Thu, 18 Mar 2021 10:27:21 -0400 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=1616077660; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=fLXBhOLK0m4sB7drmkf/r00dVEtH5jV33JTGhenf3EM=; b=Gj6ncR7l2ZKbNNv/OtGfnbMd3lbuj+AghIgAXxVZcUIxBn/pILANS29gQk/gBI0MrKBs11 +qGDM2tqmu6xf9S24zaRlD+RKpxdEJ/Guh+mhlHDEWiiVSBQKBZK2AZMv5+GuklyCLRooU wLvzB2ewd/KCcknG3t5ZHg9MUOr0mxqPC3IqmtVKALLJsUeBLl3yGnQSylh/Xbh2tXzeqW r6AXTsNTcfgUmHf5hYKjLnD8RYJsfoCh3wmcMBHoyeQF0EXLQ14gsMonKRpizhsgNdFBXs 6tAOvt+GQ8nS0zj7HvT0qjK9K/eLk/oICde/UcWmFs6LjADxuAp96RsLt7W4RQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616077660; a=rsa-sha256; cv=none; b=eCXBDtzB0ELq60pmWd5B9KBbJqRfpdwFfY5ohWOjsi+DM5bjKFfi8zIK+W50kLFncvotCi 9yHCU/paC9MXNwb7ybZugGj5Tm1ZXDaHNoHUCWeCfd6/5qMzvBdDEC5d3R9wARDBtbDTNk 0oHsZFg7PwWguBPSx1vTi0IT894tntENafm05v4x8dhImSnoRHVhavYr3kcXwujgLI6onG /Un0bOVnDGfHVpinOyMxmXwe0gHzSMpwtCioJN8tonNWbFyuerm4ZBNm7SwHAZZj+KmGJQ IsPing3xwYSBYW5SzFw/x1bE5wSRXWp2P/RJVBTWiOKdUqeQnkvJ44pKtbjE5g== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=pass header.d=elenq.tech header.s=protonmail3 header.b="MCcXA/wW"; dmarc=pass (policy=none) header.from=elenq.tech; spf=pass (aspmx2.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.11 Authentication-Results: aspmx2.migadu.com; dkim=pass header.d=elenq.tech header.s=protonmail3 header.b="MCcXA/wW"; dmarc=pass (policy=none) header.from=elenq.tech; spf=pass (aspmx2.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: 86FAAC4FF X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: 57M6XuT6wCJF Hi, I've been struggling with GCC package definition for a while and I hope som= eone 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 for a 32 bit RISC-V machine: ``` scheme (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 lis= t 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 hu= ge part on the bootstrapping process of Guix but I think that kind of coupling= 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 sa= w some references to AVR on the `glibc-dynamic-linker` that also used a fake dynamic linker to avoid the function to fail but I got no response so I'm n= ot 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 preced= ed by that comment and only once more below, in some patches we are applying o= n top of the source code. At this level I'm not sure if there's any way to "fix" GCC package definiti= on to be able to create cross-compilers or if I should create a separate packa= ge 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 like= to have some guidance first. Thanks, Ekaitz [^patch]: https://issues.guix.gnu.org/46059