GNU bug report logs - #61600
Subject: [PATCH 1/2] gnu: allow more cross target

Previous Next

Package: guix-patches;

Reported by: 路辉 <luhux76 <at> gmail.com>

Date: Sat, 18 Feb 2023 08:31:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 61600 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#61600; Package guix-patches. (Sat, 18 Feb 2023 08:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 路辉 <luhux76 <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 18 Feb 2023 08:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 路辉 <luhux76 <at> gmail.com>
To: guix-patches <guix-patches <at> gnu.org>
Subject: Subject: [PATCH 1/2] gnu: allow more cross target
Date: Sat, 18 Feb 2023 08:30:36 +0000
From 836c0e3e7112d5f3d3630aebfbabbd45242eb216 Mon Sep 17 00:00:00 2001
From: LuHui <luhux76 <at> gmail.com>
Date: Sat, 18 Feb 2023 16:18:52 +0800
Subject: [PATCH 1/2] gnu: allow more cross target

* gnu/packages/bootstrap.scm: add mips and riscv target.
---
 gnu/packages/bootstrap.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 75980f2148..f6b92a2aaa 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Léo Le Bouter <lle-bout <at> zaclys.net>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;; Copyright © 2021 Chris Marusich <cmmarusich <at> gmail.com>
+;;; Copyright © 2023 Lu Hui <luhux76 <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -329,6 +330,12 @@ (define* (glibc-dynamic-linker
      ;; here just so we can keep going.
      ((string=? system "arm-elf") "no-ld.so")
      ((string=? system "arm-eabi") "no-ld.so")
+     ((string=? system "mips-elf") "no-ld.so")
+     ((string=? system "mipsel-elf") "no-ld.so")
+     ((string=? system "mips64-elf") "no-ld.so")
+     ((string=? system "mips64el-elf") "no-ld.so")
+     ((string=? system "riscv32-elf") "no-ld.so")
+     ((string=? system "riscv64-elf") "no-ld.so")
      ((string=? system "xtensa-elf") "no-ld.so")
      ((string=? system "avr") "no-ld.so")
      ((string=? system "propeller-elf") "no-ld.so")
-- 
2.39.1




Information forwarded to guix-patches <at> gnu.org:
bug#61600; Package guix-patches. (Sat, 18 Feb 2023 08:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 61600 <at> debbugs.gnu.org (full text, mbox):

From: 路辉 <luhux76 <at> gmail.com>
To: 61600 <at> debbugs.gnu.org
Subject: Subject: [PATCH 2/2] gnu: add mips and riscv cross toolchain
Date: Sat, 18 Feb 2023 08:34:07 +0000
From 841c23f6919a16890cb2ec595019a12b656c4c68 Mon Sep 17 00:00:00 2001
From: LuHui <luhux76 <at> gmail.com>
Date: Sat, 18 Feb 2023 16:20:20 +0800
Subject: [PATCH 2/2] gnu: add mips and riscv cross toolchain

* gnu/packages/embedded.scm: add mips and riscv cross toolchain
---
 gnu/packages/embedded.scm | 78 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 87c572ba0f..d6e0a17fae 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith <at> outlook.com>
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe <at> gnu.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2023 Lu Hui <luhux76 <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,6 +49,7 @@ (define-module (gnu packages embedded)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages commencement)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages dejagnu)
@@ -1747,3 +1749,79 @@ (define-public ts4900-utils
 @item tssilomon
 @end itemize")
       (license license:bsd-2))))
+
+(define (make-cross-gcc-toolchain target)
+  (let* ((gcc (cross-gcc target))
+         (binutils (cross-binutils target)))
+    (package
+      (name (string-append "gcc-" target "-toolchain"))
+      (version (package-version gcc))
+      (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)
+                   #t)))))
+      (propagated-inputs
+       (list binutils gcc))
+      (synopsis (package-synopsis gcc-toolchain))
+      (description (package-description gcc-toolchain))
+      (home-page (package-home-page gcc-toolchain))
+      (license (package-license gcc-toolchain)))))
+
+(define (make-cross-gdb target)
+  (package
+    (inherit gdb)
+    (name (string-append "gdb-" target))
+    (arguments
+     `(#:configure-flags '(,(string-append "--target=" target)
+                           "--enable-multilib"
+                           "--enable-interwork"
+                           "--enable-languages=c,c++"
+                           "--disable-nls")
+       ,@(package-arguments gdb)))))
+
+;; A lot of cross toolchain for bare metal development
+
+(define-public gcc-mipsel-elf-toolchain
+  (make-cross-gcc-toolchain "mipsel-elf"))
+
+(define-public gcc-mips-elf-toolchain
+  (make-cross-gcc-toolchain "mips-elf"))
+
+(define-public gdb-mipsel-elf
+  (make-cross-gdb "mipsel-elf"))
+
+(define-public gdb-mips-elf
+  (make-cross-gdb "mips-elf"))
+
+(define-public gcc-mips64el-elf-toolchain
+  (make-cross-gcc-toolchain "mips64el-elf"))
+
+(define-public gcc-mips64-elf-toolchain
+  (make-cross-gcc-toolchain "mips64-elf"))
+
+(define-public gdb-mips64el-elf
+  (make-cross-gdb "mips64el-elf"))
+
+(define-public gdb-mips64-elf
+  (make-cross-gdb "mips64-elf"))
+
+(define-public gcc-riscv32-elf-toolchain
+  (make-cross-gcc-toolchain "riscv32-elf"))
+
+(define-public gcc-riscv64-elf-toolchain
+  (make-cross-gcc-toolchain "riscv64-elf"))
+
+(define-public gdb-riscv32-elf
+  (make-cross-gdb "riscv32-elf"))
+
+(define-public gdb-riscv64-elf
+  (make-cross-gdb "riscv64-elf"))
-- 
2.39.1




This bug report was last modified 1 year and 76 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.