From patchwork Sun Sep 15 19:03:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manolis Ragkousis X-Patchwork-Id: 68100 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6224927BBEA; Sun, 15 Sep 2024 20:04:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 78E0A27BBE2 for ; Sun, 15 Sep 2024 20:04:16 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spuXJ-0004Ku-SZ; Sun, 15 Sep 2024 15:03:54 -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 1spuXH-0004KQ-0S for guix-patches@gnu.org; Sun, 15 Sep 2024 15:03:52 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spuXG-0007xs-Nz for guix-patches@gnu.org; Sun, 15 Sep 2024 15:03:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=Uv6dlrBmK9xSuD6QoP089QJTpgV2PgsdtQMzsqIlMvM=; b=XJqGFfpROFziWnI3cMeAkliDo0flHdYkbAEMtXJsISyKbvRKW22KSiBj3mZo/plrq2hyzNP1R9OKsxiwhRlk5tk3qpcCLQ88szxYVJn0Mc0/xwXGNDx+J1xHXeGp71+5cL9Fo8fOTSkH/ADQtUIt2Y2pYnsmNq//VINSi+SlLaACnjTw99RTwK/Lj/3DwrJiyD1BqwtD+f+I5s7CObkLHSZD0pw+rv6IFvL+Lk/GXHd3Hb6a7GAXMhp9OrQUkNouV+1L0lS7I/t6aV5hwd/MwLpUnDJYhjgmGJyjRf5WZOnsB/uVxRKBdVPALztomjeiH00z8w+sxh9JjJy8dpWaUA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1spuXS-0006eA-GH for guix-patches@gnu.org; Sun, 15 Sep 2024 15:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73277] [PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant. Resent-From: manolis837@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Sep 2024 19:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73277 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73277@debbugs.gnu.org Cc: Manolis Ragkousis X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172642703825525 (code B ref -1); Sun, 15 Sep 2024 19:04:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Sep 2024 19:03:58 +0000 Received: from localhost ([127.0.0.1]:50502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spuXN-0006da-Gu for submit@debbugs.gnu.org; Sun, 15 Sep 2024 15:03:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:60498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spuXL-0006dS-EW for submit@debbugs.gnu.org; Sun, 15 Sep 2024 15:03:56 -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 1spuX8-0004Ju-DC for guix-patches@gnu.org; Sun, 15 Sep 2024 15:03:42 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spuX6-0007x4-Op for guix-patches@gnu.org; Sun, 15 Sep 2024 15:03:42 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a8d29b7edc2so495852566b.1 for ; Sun, 15 Sep 2024 12:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726427017; x=1727031817; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Uv6dlrBmK9xSuD6QoP089QJTpgV2PgsdtQMzsqIlMvM=; b=UHzpOEGinwYnS8xgm7cUO9p72ZKIwavg+CqAlYdLpU2plRiapIpChopakR3xJbt7P4 dKzfGY/3jER35w7XDWGKH1IYdp9h9W0/5/KvRUwnbunKbWyTcaofiQeCayzijxm5Y4lH QCpSdAdpUFyi6dndu3fSM/WyMz0ia0KCyH9kgcWEzUPIBhLdU2e2lUwkGgTYm0bLBdqV m12iTd/mS1z+xTBtnLr7VHfh9YHp+zizL/H5Es5xv79UG9VvmBveTQlwfQ3yplF5L6xL 0zLeF0jclTilEuaxxqoLnU9p3Q69ZAXD6rp/NzTyqlq8VeAmu5WOP2FUtF3P2zREQ78u phFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726427017; x=1727031817; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Uv6dlrBmK9xSuD6QoP089QJTpgV2PgsdtQMzsqIlMvM=; b=VuXbMtbimpdVYV7MsGzFFwQ379PN3D6kT1q+XvOSA7J6+vAzF4tDRR8wWoi2ukwY+C LY9+ZFiMPlpABw9QnPgUz/FhQ+E+ZLVwYKq2NuXwKaKp8yIqA67CZz0ef0nVWrdmcvUT 0gPy0sqo7ViAAmPSs094MX0VWzAcuyPUQlJGyibt+eiDjxOv/V2LzdAaxtRWV6v450bj 9rZeyYruu+P0SB+QH9Z6Uzgwgu/4Nln8kPqu+PvpgiFJENivThuWYt5XAiL5Zxznqj/+ NkhEzuBwWmb2I0NAI1152CDREIgGZw6DwpiS2015iUS95wTzf3cS97cI2C8Xb8oQh3Ho tGtQ== X-Gm-Message-State: AOJu0Yy0svRHRxn4JZzx9xukMPh16Fw2zScesMamegPMRmHYUDhJz+OK skYuklE5wHVi0MBsIIFoA/egsWm1Oz06MT3O+zNewQRvT0scKRMTy3iM X-Google-Smtp-Source: AGHT+IGfoCnL25J+zMxcKywaeU0V+GFOLBTs70tvX0x2wCNfBXN19NRVu2IZVmpOu8iYC8P/5diLXg== X-Received: by 2002:a17:907:7242:b0:a8b:6ee7:ba25 with SMTP id a640c23a62f3a-a9029617e57mr1345979366b.47.1726427016858; Sun, 15 Sep 2024 12:03:36 -0700 (PDT) Received: from prometheus.paros.xyz (ppp-94-68-92-8.home.otenet.gr. [94.68.92.8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9061321568sm222877266b.191.2024.09.15.12.03.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 12:03:36 -0700 (PDT) From: manolis837@gmail.com Date: Sun, 15 Sep 2024 22:03:30 +0300 Message-ID: <7c35f8694833a9371d84c51ce4a07119358e187e.1726426231.git.manolis837@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=manolis837@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Manolis Ragkousis * gnu/packages/embedded.scm (make-mipsel-none-elf-toolchain-ps1): New procedure. (make-gcc-mipsel-none-elf, make-mipsel-none-elf-toolchain): New variables. Change-Id: I8d4e1f5601bf255703750f95862d9427013e38e7 --- gnu/packages/embedded.scm | 86 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) base-commit: 61b6c7ceb1e2c3baf9cdfbd05e6ad4f6d2dc2a3c diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index bee65663b6..8779cc5e71 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2022 Mathieu Othacehe ;;; Copyright © 2022, 2023 Maxim Cournoyer ;;; Copyright © 2023 Janneke Nieuwenhuizen +;;; Copyright © 2024 Manolis Fragkiskos Ragkousis ;;; ;;; This file is part of GNU Guix. ;;; @@ -101,7 +102,9 @@ (define-module (gnu packages embedded) make-propeller-gcc-4 make-propeller-gcc-6 make-propeller-toolchain - make-propeller-development-suite)) + make-propeller-development-suite + + make-mipsel-none-elf-toolchain-ps1)) ;;; Commentary: ;;; @@ -1859,3 +1862,84 @@ (define-public ts4900-utils @item tssilomon @end itemize") (license license:bsd-2)))) + +(define make-gcc-mipsel-none-elf + (mlambda () + (let ((xgcc (cross-gcc "mipsel-none-elf" + #:xgcc gcc + #:xbinutils (cross-binutils "mipsel-none-elf")))) + (package + (inherit xgcc) + (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"))))) + (add-after 'unpack 'fix-genmultilib + (lambda _ + (substitute* "gcc/genmultilib" + (("#!/bin/sh") (string-append "#!" (which "sh")))))))) + ((#:configure-flags flags) + #~(append (list "--target=mipsel-none-elf" + "--disable-docs" + "--disable-nls" + "--disable-werror" + "--disable-libada" + "--disable-libssp" + "--disable-libquadmath" + "--disable-threads" + "--disable-libgomp" + "--disable-libstdcxx-pch" + "--disable-hosted-libstdcxx" + "--enable-languages=c,c++" + "--without-isl" + "--without-headers" + "--with-float=soft" + "--with-gnu-as" + "--with-gnu-ld") + #$flags)))))))) + +(define make-mipsel-none-elf-toolchain + (mlambda (xgcc) + "Produce a cross-compiler toolchain package with the compiler XGCC." + (let () + (package + (name "mipsel-none-elf-toolchain") + (version (package-version xgcc)) + (source #f) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build union)) + #:builder + (begin + (use-modules (ice-9 match) + (guix build union)) + (match %build-inputs + (((names . directories) ...) + (union-build (assoc-ref %outputs "out") + directories)))))) + (propagated-inputs + `(("binutils" ,(cross-binutils "mipsel-none-elf")) + ("gcc" ,xgcc))) + (synopsis "") + (description "") + (home-page (package-home-page xgcc)) + (license (package-license xgcc)))))) + +(define make-mipsel-none-elf-toolchain-ps1 + (mlambda () + (make-mipsel-none-elf-toolchain (make-gcc-mipsel-none-elf))))