X-Loop: help-debbugs@HIDDEN Subject: [bug#73277] [PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant. Resent-From: manolis837@HIDDEN Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Sun, 15 Sep 2024 19:04:02 +0000 Resent-Message-ID: <handler.73277.B.172642703825525 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 73277 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73277 <at> debbugs.gnu.org Cc: Manolis Ragkousis <manolis837@HIDDEN> X-Debbugs-Original-To: guix-patches@HIDDEN Received: via spool by submit <at> 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 <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1spuXN-0006da-Gu for submit <at> 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 <manolis837@HIDDEN>) id 1spuXL-0006dS-EW for submit <at> 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 <manolis837@HIDDEN>) id 1spuX8-0004Ju-DC for guix-patches@HIDDEN; 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 <manolis837@HIDDEN>) id 1spuX6-0007x4-Op for guix-patches@HIDDEN; Sun, 15 Sep 2024 15:03:42 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a8d29b7edc2so495852566b.1 for <guix-patches@HIDDEN>; 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@HIDDEN Date: Sun, 15 Sep 2024 22:03:30 +0300 Message-ID: <7c35f8694833a9371d84c51ce4a07119358e187e.1726426231.git.manolis837@HIDDEN> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=manolis837@HIDDEN; 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-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.1 (--) From: Manolis Ragkousis <manolis837@HIDDEN> * 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(-) 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 <othacehe@HIDDEN> ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@HIDDEN> +;;; Copyright © 2024 Manolis Fragkiskos Ragkousis <manolis837@HIDDEN> ;;; ;;; 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)))) base-commit: 61b6c7ceb1e2c3baf9cdfbd05e6ad4f6d2dc2a3c -- 2.46.0
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: manolis837@HIDDEN Subject: bug#73277: Acknowledgement ([PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant.) Message-ID: <handler.73277.B.172642703825525.ack <at> debbugs.gnu.org> References: <7c35f8694833a9371d84c51ce4a07119358e187e.1726426231.git.manolis837@HIDDEN> X-Gnu-PR-Message: ack 73277 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 73277 <at> debbugs.gnu.org Date: Sun, 15 Sep 2024 19:04:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): guix-patches@HIDDEN If you wish to submit further information on this problem, please send it to 73277 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 73277: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D73277 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: [bug#73277] [PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant. References: <7c35f8694833a9371d84c51ce4a07119358e187e.1726426231.git.manolis837@HIDDEN> In-Reply-To: <7c35f8694833a9371d84c51ce4a07119358e187e.1726426231.git.manolis837@HIDDEN> Resent-From: Jean-Pierre De Jesus Diaz <jean@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Mon, 16 Sep 2024 12:02:02 +0000 Resent-Message-ID: <handler.73277.B73277.172648811012742 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 73277 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73277 <at> debbugs.gnu.org Cc: manolis837@HIDDEN Received: via spool by 73277-submit <at> debbugs.gnu.org id=B73277.172648811012742 (code B ref 73277); Mon, 16 Sep 2024 12:02:02 +0000 Received: (at 73277) by debbugs.gnu.org; 16 Sep 2024 12:01:50 +0000 Received: from localhost ([127.0.0.1]:51212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sqAQP-0003JR-KB for submit <at> debbugs.gnu.org; Mon, 16 Sep 2024 08:01:49 -0400 Received: from mail-ua1-f49.google.com ([209.85.222.49]:42020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jean@HIDDEN>) id 1sqAQN-0003JB-Ua for 73277 <at> debbugs.gnu.org; Mon, 16 Sep 2024 08:01:48 -0400 Received: by mail-ua1-f49.google.com with SMTP id a1e0cc1a2514c-846bc2104c8so2348093241.0 for <73277 <at> debbugs.gnu.org>; Mon, 16 Sep 2024 05:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundation.xyz; s=google; t=1726488029; x=1727092829; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=RhwhDTLY/gpsmTE9x2YEae9poCnmMKMC2IxF1BA06J4=; b=M4k9n8CDlaZEOSakEcPt54qiUvn5B8pKF/fAqXhI6cO3lI9J+gVS29+LvjlddZU9LR s0auaElrEzQfROv9YBtNqCnepyeR6QbkCJ5SxW86i9hWeHov3BwCpTg2mCKfYhhOQ2H5 +pqpHcamHSslUz07xd6ZW/4gqzef+qP+cxkHxB33tOnyvcZRY0I6eZboqjiFaHhe3OL2 c7Mc6KbMeZgbSmdWgFuThLsGbiQb53nhpKXPHLDqltqoHVFncBRxkRKXZ3p3W0Sm06S5 osHZvkvPOeB5J9cupIz4HEF6BNuzPg3xBikjNPR+VPhrNU4zrG9VyaQ/kVyJQX5kLOVA pKHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726488029; x=1727092829; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RhwhDTLY/gpsmTE9x2YEae9poCnmMKMC2IxF1BA06J4=; b=jPxtP9QKD1nZ13pGFUn8DOtkeK0G03Rc/8SHZn70paSq2eT4UMzGLWtoUGh+DOID4q gaFdPjBDWp+aCZE/qvLsjmwljqmNyS7t4V1dh63EMTihMxHsUmSVMGpRr+5GDj+nHu2T zAObrGK2SFPz4ohw8QShEOF29Tcs+YsyKnwm46YH5U5GLI8eLSe80Gc9sQi/M4288TRg wXDwRxopHidW3EQFu1tVzofowkIj/NcD2XsY7VeDU9SQo9zvPAI0+z1676OehY35yMpw cWJBIRsvijB1lzYbcFm/bsc5FAERuywYsGcbdUImfkQkD53Umed7BO8CkZsBrt5Rk2t7 7v4Q== X-Gm-Message-State: AOJu0YzP6dw+RF+xV6FRi7N9t/IF0EyPQ7T/GvLO2B9jjayx15F8Kcxq +qwHKep0ihtV78pYyjFPtMimI1F4ffXkdkhOhVFtAL+1irGyKC1lmUjPWabZbaGiljyMjqo2Sa9 kiUE3wr34M/TgKGaRb0iBG+Bsks1kvxv4qd+I+N3ZbsGh+1AD X-Google-Smtp-Source: AGHT+IHHA+bswDY7UafEdKC1GkNNXYIkYxHwD9UWD9AvftHMbr+P2GDqZlBhLeeuN+8qADAVwSR6i9BP2M/pnuVyDlI= X-Received: by 2002:a05:6102:dcc:b0:498:cfe3:f4e0 with SMTP id ada2fe7eead31-49c1582f992mr15671892137.0.1726488028822; Mon, 16 Sep 2024 05:00:28 -0700 (PDT) MIME-Version: 1.0 From: Jean-Pierre De Jesus Diaz <jean@HIDDEN> Date: Mon, 16 Sep 2024 12:00:17 +0000 Message-ID: <CAG1gdUoivp3tRQKiMWqAQWb90VnkO0tQpskQKmbOk-3Qo2a40g@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Just letting you know that using `cross-gcc-toolchain` is preferred and since the usage is to provide a PS1 SDK I think you can add this to the list of bare metal targets in Guix. See `guix build --list-targets', for example it contains avr, xtensa-ath9k-elf and or1k-elf. This can be done by adding a variable to: - `guix/platforms/mips.scm' So, this should allow to add this target as an argument to your `psn00bsdk' package: For example: (arguments (list #:target "mipsel-none-elf" ...)) And the build system will: 1. Automayically add the cross-gcc compiler. 2. Will also cross-compile inputs (excluding native-inputs, of course). So that will allow you to unbundle the dependencies as you could just build each one independently for that target (or for all ones, if the library supports it). With this though you'll probably need to create a separate package for the tools and one for the code that runs on the PS1 itself. You can take inspiration from the existing bare-metal targets and packages compiled like this (which are few), there is firmware on `gnu/packages/firmware.scm' that does this. Also the QMK firmware for keyboards use the Guix cross-compilation mechanism too. Additionally, you can provide the toolchain as a package on the `gnu/package/cross-toolchain.scm` module.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.