From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id uFqaNHduZmSwfgEASxT56A (envelope-from ) for ; Thu, 18 May 2023 20:29:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8LyWNHduZmRzXAAA9RJhRA (envelope-from ) for ; Thu, 18 May 2023 20:29:11 +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 7EF8B17E6B for ; Thu, 18 May 2023 20:29:11 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pziN7-0005I5-UH; Thu, 18 May 2023 14:29:05 -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 1pziN6-0005Fj-6e for guix-patches@gnu.org; Thu, 18 May 2023 14:29:04 -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 1pziN5-0003XN-3i for guix-patches@gnu.org; Thu, 18 May 2023 14:29:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pziN4-0002kz-Sr for guix-patches@gnu.org; Thu, 18 May 2023 14:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63576] [PATCH v1 2/4] gnu: Add aarch64-none-elf-gcc. Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 18 May 2023 18:29:02 +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: 63576@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Efraim Flashner , Denis 'GNUtoo' Carikli Received: via spool by 63576-submit@debbugs.gnu.org id=B63576.168443452510553 (code B ref 63576); Thu, 18 May 2023 18:29:02 +0000 Received: (at 63576) by debbugs.gnu.org; 18 May 2023 18:28:45 +0000 Received: from localhost ([127.0.0.1]:54515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pziMn-0002k8-0f for submit@debbugs.gnu.org; Thu, 18 May 2023 14:28:45 -0400 Received: from cyberdimension.org ([80.67.179.20]:34922 helo=gnutoo.cyberdimension.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pziMi-0002jY-H6 for 63576@debbugs.gnu.org; Thu, 18 May 2023 14:28:41 -0400 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id 1179e8db; Thu, 18 May 2023 18:28:36 +0000 (UTC) Received: from localhost.localdomain (localhost [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id aea57366; Thu, 18 May 2023 18:28:36 +0000 (UTC) From: Denis 'GNUtoo' Carikli Date: Thu, 18 May 2023 20:28:12 +0200 Message-Id: <20230518182814.15881-2-GNUtoo@cyberdimension.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230518182814.15881-1-GNUtoo@cyberdimension.org> References: <20230518182814.15881-1-GNUtoo@cyberdimension.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684434551; a=rsa-sha256; cv=none; b=rHHdI3TtsPvqwwcWiF58xhrtqLSp+Whk2Ig3DDL06vU/RafpDBHP/9C+s422mafYXpSjhW uuzdXLt4gEJv7Xi+79k/MXKFn9bUrM1jSkg++voTwW/jj+XEGhSoPc5O/LBO3wNsG25NUv 3+l+Rx3oTdN7qI9PySTq7AwZi0YOho3lkmcSGwpfD8lMWdoovtOUW4PtspQVojRi62u1ua Teruu8wGhcu7KF10/H05Jo408zZoTf/X5SktXuRwMWkWDClKy0OpxdNkcfGnG+HTKIDFVn lEaI0s49Ri888Phji7dqeSUSASL4sr5xxR19LCH8tWHjo5aBfF3UYlzP6WAYsg== 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=1684434551; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: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=f6uX+AhE6bdyO8kvF5L00NHqRn9PPfVkuM/leh/nrXQ=; b=qlU5Lj/Mx4u7nq2gYpQssLuj0/wgJQktNL7yo5ngIdJ4FvQxQzWkq2WAJR+EEVD3TJKB0G VVNeoCm0yMqoEiBtho8ztlbkAaioCvAb19+NvkXapUN522n+LBjl8VVsTDN+/yyodgVuOn Pr8Otjcy2qdVELJfor31SLMfEBKiRJLkuEA60/9OucROsIGnYq8PFd/QcFZGy5ONg2beS7 HW91hE4+O7KsS/LTJ8KKP+NsekMQ6yaK3rBQkYH75aHnn89EO048Cdi9fHLPLwzFpDJC/K K47Sr8n37XAloIYhD9/1SlB+mQy8+plVAOzyH7G2Fypb83zuUTKKFclGD3LvaA== X-Migadu-Scanner: scn1.migadu.com 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-Spam-Score: -1.69 X-Spam-Score: -1.69 X-Migadu-Queue-Id: 7EF8B17E6B X-TUID: qIuDkckW3Hq0 * gnu/packages/aarch64-none-elf-toolchain.scm (aarch64-none-elf-gcc): New variable. --- gnu/packages/aarch64-none-elf-toolchain.scm | 59 ++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/gnu/packages/aarch64-none-elf-toolchain.scm b/gnu/packages/aarch64-none-elf-toolchain.scm index 14569036ce..88a2abb1f9 100644 --- a/gnu/packages/aarch64-none-elf-toolchain.scm +++ b/gnu/packages/aarch64-none-elf-toolchain.scm @@ -17,10 +17,67 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages aarch64-none-elf-toolchain) + #:use-module (guix gexp) + #:use-module (guix utils) #:use-module (guix packages) - #:use-module (gnu packages cross-base)) + #:use-module (gnu packages cross-base) + #:use-module (gnu packages gcc)) (define-public aarch64-none-elf-binutils (package (inherit (cross-binutils "aarch64-none-elf")) (name "aarch64-none-elf-binutils"))) + +(define aarch64-none-elf-gcc + (let ((xgcc (cross-gcc "aarch64-none-elf" #:xgcc gcc #:xbinutils aarch64-none-elf-binutils))) + (package + (inherit xgcc) + (name "aarch64-none-elf-gcc") + (arguments + (substitute-keyword-arguments (package-arguments xgcc) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH + (lambda* (#:key inputs #:allow-other-keys) + (let ((gcc (assoc-ref inputs "gcc"))) + ;; Remove the default compiler from CPLUS_INCLUDE_PATH to + ;; prevent header conflict with the GCC from native-inputs. + (setenv "CPLUS_INCLUDE_PATH" + (string-join + (delete (string-append gcc "/include/c++") + (string-split (getenv "CPLUS_INCLUDE_PATH") + #\:)) + ":")) + (format #t + "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" + (getenv "CPLUS_INCLUDE_PATH"))))) + ;; Without a working multilib build, the resulting GCC lacks + ;; support for nearly every AARCH64-NONE-ELF chip. + (add-after 'unpack 'fix-genmultilib + (lambda _ + ;; patch-shebang doesn't work here because there are actually + ;; several scripts inside this script, each with a #!/bin/sh + ;; that needs patching. + (substitute* "gcc/genmultilib" + (("#!/bin/sh") (string-append "#!" (which "sh")))))))) + ((#:configure-flags flags) + #~(delete "--disable-multilib" #$flags)))) + (native-search-paths + (list (search-path-specification + (variable "CROSS_C_INCLUDE_PATH") + (files '("aarch64-none-elf/include"))) + (search-path-specification + (variable "CROSS_CPLUS_INCLUDE_PATH") + (files '("aarch64-none-elf/include"))) + (search-path-specification + (variable "CROSS_OBJC_INCLUDE_PATH") + (files '("aarch64-none-elf/include"))) + (search-path-specification + (variable "CROSS_OBJCPLUS_INCLUDE_PATH") + (files '("aarch64-none-elf/include"))) + (search-path-specification + (variable "CROSS_LIBRARY_PATH") + (files '("aarch64-none-elf/lib"))))) + (native-inputs + `(("gcc" ,gcc) + ,@(package-native-inputs xgcc)))))) -- 2.40.1