[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/08: platform: Add glibc-dynamic-linker field.
From: |
guix-commits |
Subject: |
05/08: platform: Add glibc-dynamic-linker field. |
Date: |
Sun, 22 May 2022 09:15:57 -0400 (EDT) |
mothacehe pushed a commit to branch master
in repository guix.
commit 4cf7d0f836d08fd41aab02e1f6793146ce3cad8d
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sat May 7 17:02:51 2022 +0200
platform: Add glibc-dynamic-linker field.
* gnu/platform.scm (<platform>)[glibc-dynamic-linker]: New field.
(platform-glibc-dynamic-linker, lookup-platform-by-system): New procedures.
* gnu/platforms/arm.scm (armhf-linux, aarch64-linux): Add the
glibc-dynamic-linker field.
* gnu/platforms/hurd.scm (hurd): Ditto.
* gnu/platforms/intel.scm (intel32-linux, intel64-linux, intel32-mingw,
intel64-linux): Ditto.
* gnu/platforms/mips.scm (mips64el-linux): Ditto.
* gnu/platforms/powerpc.scm (powerpc-linux, powerpc64-linux): Ditto.
* gnu/platforms/riscv.scm (riscv64-linux): Ditto.
* gnu/platforms/s390.scm (riscv64-linux): Ditto.
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Adapt it.
---
gnu/packages/bootstrap.scm | 47 +++++++++++++++++-------------------
gnu/platform.scm | 14 ++++++++---
gnu/platforms/arm.scm | 6 +++--
gnu/platforms/{s390.scm => hurd.scm} | 14 +++++------
gnu/platforms/mips.scm | 3 ++-
gnu/platforms/powerpc.scm | 6 +++--
gnu/platforms/riscv.scm | 3 ++-
gnu/platforms/s390.scm | 3 ++-
gnu/platforms/x86.scm | 15 ++++++++----
9 files changed, 63 insertions(+), 48 deletions(-)
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 8bd0c4eaf3..5337617a53 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -26,6 +26,7 @@
(define-module (gnu packages bootstrap)
#:use-module (guix licenses)
#:use-module (gnu packages)
+ #:use-module (gnu platform)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system)
@@ -314,33 +315,29 @@ or false to signal an error."
(%current-system))))
"Return the name of Glibc's dynamic linker for SYSTEM."
;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc.
- (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2")
- ((string=? system "i686-linux") "/lib/ld-linux.so.2")
- ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3")
- ((string=? system "mips64el-linux") "/lib/ld.so.1")
- ((string=? system "i586-gnu") "/lib/ld.so.1")
- ((string=? system "i686-gnu") "/lib/ld.so.1")
- ((string=? system "aarch64-linux") "/lib/ld-linux-aarch64.so.1")
- ((string=? system "powerpc-linux") "/lib/ld.so.1")
- ((string=? system "powerpc64-linux") "/lib/ld64.so.1")
- ((string=? system "powerpc64le-linux") "/lib/ld64.so.2")
- ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
- ((string=? system "s390x-linux") "/lib/ld64.so.1")
- ((string=? system "riscv64-linux") "/lib/ld-linux-riscv64-lp64d.so.1")
+ (let ((platform (lookup-platform-by-system system)))
+ (cond
+ ((platform? platform)
+ (platform-glibc-dynamic-linker platform))
- ;; 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")
+ ;; TODO: Define those as platforms.
+ ((string=? system "i686-gnu") "/lib/ld.so.1")
+ ((string=? system "powerpc64-linux") "/lib/ld64.so.1")
+ ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
- (else (error "dynamic linker name not known for this system"
- system))))
+ ;; 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)))))
;;;
diff --git a/gnu/platform.scm b/gnu/platform.scm
index 4c5211e107..fdc3685e7c 100644
--- a/gnu/platform.scm
+++ b/gnu/platform.scm
@@ -27,6 +27,7 @@
platform-target
platform-system
platform-linux-architecture
+ platform-glibc-dynamic-linker
platform-modules
platforms
@@ -58,12 +59,17 @@
;;
;; The 'linux-architecture' is only relevant if the kernel is Linux. In that
;; case, it corresponds to the ARCH variable used when building Linux.
+;;
+;; The 'glibc-dynamic-linker' field is the name of Glibc's dynamic linker for
+;; the corresponding system.
(define-record-type* <platform> platform make-platform
platform?
- (target platform-target) ;"x86_64-linux-gnu"
- (system platform-system) ;"x86_64-linux"
- (linux-architecture platform-linux-architecture ;"x86"
- (default #f)))
+ (target platform-target)
+ (system platform-system)
+ (linux-architecture platform-linux-architecture
+ (default #f))
+ (glibc-dynamic-linker platform-glibc-dynamic-linker))
+
;;;
;;; Platforms.
diff --git a/gnu/platforms/arm.scm b/gnu/platforms/arm.scm
index 1e61741a35..bf68b2d00f 100644
--- a/gnu/platforms/arm.scm
+++ b/gnu/platforms/arm.scm
@@ -27,10 +27,12 @@
(platform
(target "arm-linux-gnueabihf")
(system "armhf-linux")
- (linux-architecture "arm")))
+ (linux-architecture "arm")
+ (glibc-dynamic-linker "/lib/ld-linux-armhf.so.3")))
(define aarch64-linux
(platform
(target "aarch64-linux-gnu")
(system "aarch64-linux")
- (linux-architecture "arm64")))
+ (linux-architecture "arm64")
+ (glibc-dynamic-linker "/lib/ld-linux-aarch64.so.1")))
diff --git a/gnu/platforms/s390.scm b/gnu/platforms/hurd.scm
similarity index 78%
copy from gnu/platforms/s390.scm
copy to gnu/platforms/hurd.scm
index c8caafbe45..328e9818ad 100644
--- a/gnu/platforms/s390.scm
+++ b/gnu/platforms/hurd.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -16,14 +16,14 @@
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
-(define-module (gnu platforms s390)
+(define-module (gnu platforms hurd)
#:use-module (gnu platform)
#:use-module (gnu packages linux)
#:use-module (guix records)
- #:export (s390x-linux))
+ #:export (hurd))
-(define s390x-linux
+(define hurd
(platform
- (target "s390x-linux-gnu")
- (system "s390x-linux")
- (linux-architecture "s390")))
+ (target "i586-pc-gnu")
+ (system "i586-gnu")
+ (glibc-dynamic-linker "/lib/ld.so.1")))
diff --git a/gnu/platforms/mips.scm b/gnu/platforms/mips.scm
index 84a492699d..174657da13 100644
--- a/gnu/platforms/mips.scm
+++ b/gnu/platforms/mips.scm
@@ -26,4 +26,5 @@
(platform
(target "mips64el-linux-gnu")
(system "mips64el-linux")
- (linux-architecture "mips")))
+ (linux-architecture "mips")
+ (glibc-dynamic-linker "/lib/ld.so.1")))
diff --git a/gnu/platforms/powerpc.scm b/gnu/platforms/powerpc.scm
index 8fadfe88de..1d0b5cb666 100644
--- a/gnu/platforms/powerpc.scm
+++ b/gnu/platforms/powerpc.scm
@@ -27,10 +27,12 @@
(platform
(target "powerpc-linux-gnu")
(system "powerpc-linux")
- (linux-architecture "powerpc")))
+ (linux-architecture "powerpc")
+ (glibc-dynamic-linker "/lib/ld.so.1")))
(define powerpc64le-linux
(platform
(target "powerpc64le-linux-gnu")
(system "powerpc64le-linux")
- (linux-architecture "powerpc")))
+ (linux-architecture "powerpc")
+ (glibc-dynamic-linker "/lib/ld64.so.2")))
diff --git a/gnu/platforms/riscv.scm b/gnu/platforms/riscv.scm
index 29a34402a2..c2b4850e55 100644
--- a/gnu/platforms/riscv.scm
+++ b/gnu/platforms/riscv.scm
@@ -26,4 +26,5 @@
(platform
(target "riscv64-linux-gnu")
(system "riscv64-linux")
- (linux-architecture "riscv")))
+ (linux-architecture "riscv")
+ (glibc-dynamic-linker "/lib/ld-linux-riscv64-lp64d.so.1")))
diff --git a/gnu/platforms/s390.scm b/gnu/platforms/s390.scm
index c8caafbe45..d3b1133974 100644
--- a/gnu/platforms/s390.scm
+++ b/gnu/platforms/s390.scm
@@ -26,4 +26,5 @@
(platform
(target "s390x-linux-gnu")
(system "s390x-linux")
- (linux-architecture "s390")))
+ (linux-architecture "s390")
+ (glibc-dynamic-linker "/lib/ld64.so.1")))
diff --git a/gnu/platforms/x86.scm b/gnu/platforms/x86.scm
index 1a5d6a3284..927d359ae8 100644
--- a/gnu/platforms/x86.scm
+++ b/gnu/platforms/x86.scm
@@ -29,25 +29,30 @@
(platform
(target "i686-linux-gnu")
(system "i686-linux")
- (linux-architecture "i386")))
+ (linux-architecture "i386")
+ (glibc-dynamic-linker "/lib/ld-linux.so.2")))
(define x86_64-linux
(platform
(target "x86_64-linux-gnu")
(system "x86_64-linux")
- (linux-architecture "x86_64")))
+ (linux-architecture "x86_64")
+ (glibc-dynamic-linker "/lib/ld-linux-x86-64.so.2")))
(define i686-mingw
(platform
(target "i686-w64-mingw32")
- (system #f)))
+ (system #f)
+ (glibc-dynamic-linker #f)))
(define x86_64-mingw
(platform
(target "x86_64-w64-mingw32")
- (system #f)))
+ (system #f)
+ (glibc-dynamic-linker #f)))
(define hurd
(platform
(target "i586-pc-gnu")
- (system "i586-gnu")))
+ (system "i586-gnu")
+ (glibc-dynamic-linker "/lib/ld.so.1")))
- branch master updated (6e0b2adf5f -> a4aa13c02f), guix-commits, 2022/05/22
- 05/08: platform: Add glibc-dynamic-linker field.,
guix-commits <=
- 07/08: scripts: build: Highlight the current system with --list-systems., guix-commits, 2022/05/22
- 01/08: platform: Introduce new platforms., guix-commits, 2022/05/22
- 02/08: platform: Add discovery support., guix-commits, 2022/05/22
- 06/08: linux: Remove system->linux-architecture procedure., guix-commits, 2022/05/22
- 03/08: ci: Do not rely on hardcoded cross-targets lists., guix-commits, 2022/05/22
- 04/08: scripts: Add --list-systems and --list-targets options., guix-commits, 2022/05/22
- 08/08: doc: Add a 'Foreign architectures' chapter., guix-commits, 2022/05/22