Subject: Re: [bug#63341] [PATCH] gnu: Add dummy linker for riscv64-elf.

From: 宋文武 <[email-masked]>
Date: Sun, 07 May 2023 21:22:25 +0800

Efraim Flashner <[email-masked]> writes:

> I have a couple of dummy *-elf systems I sometimes add and remove
> depending on what I'm working on. What do you think about adding and
> entry for ((string-suffix? "-elf" system) "no-ld.so") and being done
> with these one-off targets?

I think that's fine, or how about only error for '-linux' or '-gnu'
systems, i think that's where a glibc linker is needed.

>From 2a972a30b9fcf743036bf9e81044e79854b62fde Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <[email-masked]>
Date: Sun, 7 May 2023 21:15:20 +0800
Subject: [PATCH] gnu: Use dummy linker for systems without a 'linux' or 'gnu'
 suffix.

* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Use dummy linker for
systems without a 'linux' or 'gnu' suffix.
---
 gnu/packages/bootstrap.scm | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 9a46f97c81..12a84b8265 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -323,19 +323,11 @@ (define* (glibc-dynamic-linker
      ((string=? system "powerpc64-linux") "/lib/ld64.so.1")
      ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
 
-     ;; XXX: This one is used bare-bones, without a libc, so add a case
-     ;; here just so we can keep going.
-     ((string=? system "arm-elf") "no-ld.so")
-     ((string=? system "arm-eabi") "no-ld.so")
-     ((string=? system "xtensa-elf") "no-ld.so")
-     ((string=? system "avr") "no-ld.so")
-     ((string=? system "propeller-elf") "no-ld.so")
-     ((string=? system "i686-mingw") "no-ld.so")
-     ((string=? system "x86_64-mingw") "no-ld.so")
-     ((string=? system "vc4-elf") "no-ld.so")
-
-     (else (error "dynamic linker name not known for this system"
-                  system)))))
+     ((or (string-suffix? "-linux" system) (string-suffix? "-gnu" system))
+      (error "dynamic linker name not known for this system" system))
+
+     ;; For bare-bones without a libc, eg: arm-elf, arm-eabi, xtensa-elf, etc.
+     (else "no-ld.so"))))
 
 
 ;;;

base-commit: 7612610c44f16fc8f2ff395d9a2d58101a7356aa
-- 
2.39.2

(I'm unable to write a satisfied commit message..)