diff options
| author | Mathieu Othacehe <othacehe@gnu.org> | 2022-05-07 17:02:51 +0200 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2022-05-22 15:15:33 +0200 |
| commit | 4cf7d0f836d08fd41aab02e1f6793146ce3cad8d (patch) | |
| tree | 6f58878b47518666be8622545afd57b792f60bae /gnu | |
| parent | ec42d287b4558b4d1908e3e71dcf9358d5c6ae8c (diff) | |
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.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/bootstrap.scm | 47 | ||||
| -rw-r--r-- | gnu/platform.scm | 14 | ||||
| -rw-r--r-- | gnu/platforms/arm.scm | 6 | ||||
| -rw-r--r-- | gnu/platforms/hurd.scm | 29 | ||||
| -rw-r--r-- | gnu/platforms/mips.scm | 3 | ||||
| -rw-r--r-- | gnu/platforms/powerpc.scm | 6 | ||||
| -rw-r--r-- | gnu/platforms/riscv.scm | 3 | ||||
| -rw-r--r-- | gnu/platforms/s390.scm | 3 | ||||
| -rw-r--r-- | gnu/platforms/x86.scm | 15 |
9 files changed, 85 insertions, 41 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 8bd0c4eaf3a..5337617a533 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | (define-module (gnu packages bootstrap) | 26 | (define-module (gnu packages bootstrap) |
| 27 | #:use-module (guix licenses) | 27 | #:use-module (guix licenses) |
| 28 | #:use-module (gnu packages) | 28 | #:use-module (gnu packages) |
| 29 | #:use-module (gnu platform) | ||
| 29 | #:use-module (guix packages) | 30 | #:use-module (guix packages) |
| 30 | #:use-module (guix download) | 31 | #:use-module (guix download) |
| 31 | #:use-module (guix build-system) | 32 | #:use-module (guix build-system) |
| @@ -314,33 +315,29 @@ or false to signal an error." | |||
| 314 | (%current-system)))) | 315 | (%current-system)))) |
| 315 | "Return the name of Glibc's dynamic linker for SYSTEM." | 316 | "Return the name of Glibc's dynamic linker for SYSTEM." |
| 316 | ;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc. | 317 | ;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc. |
| 317 | (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") | 318 | (let ((platform (lookup-platform-by-system system))) |
| 318 | ((string=? system "i686-linux") "/lib/ld-linux.so.2") | 319 | (cond |
| 319 | ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3") | 320 | ((platform? platform) |
| 320 | ((string=? system "mips64el-linux") "/lib/ld.so.1") | 321 | (platform-glibc-dynamic-linker platform)) |
| 321 | ((string=? system "i586-gnu") "/lib/ld.so.1") | ||
| 322 | ((string=? system "i686-gnu") "/lib/ld.so.1") | ||
| 323 | ((string=? system "aarch64-linux") "/lib/ld-linux-aarch64.so.1") | ||
| 324 | ((string=? system "powerpc-linux") "/lib/ld.so.1") | ||
| 325 | ((string=? system "powerpc64-linux") "/lib/ld64.so.1") | ||
| 326 | ((string=? system "powerpc64le-linux") "/lib/ld64.so.2") | ||
| 327 | ((string=? system "alpha-linux") "/lib/ld-linux.so.2") | ||
| 328 | ((string=? system "s390x-linux") "/lib/ld64.so.1") | ||
| 329 | ((string=? system "riscv64-linux") "/lib/ld-linux-riscv64-lp64d.so.1") | ||
| 330 | 322 | ||
| 331 | ;; XXX: This one is used bare-bones, without a libc, so add a case | 323 | ;; TODO: Define those as platforms. |
| 332 | ;; here just so we can keep going. | 324 | ((string=? system "i686-gnu") "/lib/ld.so.1") |
| 333 | ((string=? system "arm-elf") "no-ld.so") | 325 | ((string=? system "powerpc64-linux") "/lib/ld64.so.1") |
| 334 | ((string=? system "arm-eabi") "no-ld.so") | 326 | ((string=? system "alpha-linux") "/lib/ld-linux.so.2") |
| 335 | ((string=? system "xtensa-elf") "no-ld.so") | ||
| 336 | ((string=? system "avr") "no-ld.so") | ||
| 337 | ((string=? system "propeller-elf") "no-ld.so") | ||
| 338 | ((string=? system "i686-mingw") "no-ld.so") | ||
| 339 | ((string=? system "x86_64-mingw") "no-ld.so") | ||
| 340 | ((string=? system "vc4-elf") "no-ld.so") | ||
| 341 | 327 | ||
| 342 | (else (error "dynamic linker name not known for this system" | 328 | ;; XXX: This one is used bare-bones, without a libc, so add a case |
| 343 | system)))) | 329 | ;; here just so we can keep going. |
| 330 | ((string=? system "arm-elf") "no-ld.so") | ||
| 331 | ((string=? system "arm-eabi") "no-ld.so") | ||
| 332 | ((string=? system "xtensa-elf") "no-ld.so") | ||
| 333 | ((string=? system "avr") "no-ld.so") | ||
| 334 | ((string=? system "propeller-elf") "no-ld.so") | ||
| 335 | ((string=? system "i686-mingw") "no-ld.so") | ||
| 336 | ((string=? system "x86_64-mingw") "no-ld.so") | ||
| 337 | ((string=? system "vc4-elf") "no-ld.so") | ||
| 338 | |||
| 339 | (else (error "dynamic linker name not known for this system" | ||
| 340 | system))))) | ||
| 344 | 341 | ||
| 345 | 342 | ||
| 346 | ;;; | 343 | ;;; |
diff --git a/gnu/platform.scm b/gnu/platform.scm index 4c5211e1074..fdc3685e7c4 100644 --- a/gnu/platform.scm +++ b/gnu/platform.scm | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | platform-target | 27 | platform-target |
| 28 | platform-system | 28 | platform-system |
| 29 | platform-linux-architecture | 29 | platform-linux-architecture |
| 30 | platform-glibc-dynamic-linker | ||
| 30 | 31 | ||
| 31 | platform-modules | 32 | platform-modules |
| 32 | platforms | 33 | platforms |
| @@ -58,12 +59,17 @@ | |||
| 58 | ;; | 59 | ;; |
| 59 | ;; The 'linux-architecture' is only relevant if the kernel is Linux. In that | 60 | ;; The 'linux-architecture' is only relevant if the kernel is Linux. In that |
| 60 | ;; case, it corresponds to the ARCH variable used when building Linux. | 61 | ;; case, it corresponds to the ARCH variable used when building Linux. |
| 62 | ;; | ||
| 63 | ;; The 'glibc-dynamic-linker' field is the name of Glibc's dynamic linker for | ||
| 64 | ;; the corresponding system. | ||
| 61 | (define-record-type* <platform> platform make-platform | 65 | (define-record-type* <platform> platform make-platform |
| 62 | platform? | 66 | platform? |
| 63 | (target platform-target) ;"x86_64-linux-gnu" | 67 | (target platform-target) |
| 64 | (system platform-system) ;"x86_64-linux" | 68 | (system platform-system) |
| 65 | (linux-architecture platform-linux-architecture ;"x86" | 69 | (linux-architecture platform-linux-architecture |
| 66 | (default #f))) | 70 | (default #f)) |
| 71 | (glibc-dynamic-linker platform-glibc-dynamic-linker)) | ||
| 72 | |||
| 67 | 73 | ||
| 68 | ;;; | 74 | ;;; |
| 69 | ;;; Platforms. | 75 | ;;; Platforms. |
diff --git a/gnu/platforms/arm.scm b/gnu/platforms/arm.scm index 1e61741a35e..bf68b2d00ff 100644 --- a/gnu/platforms/arm.scm +++ b/gnu/platforms/arm.scm | |||
| @@ -27,10 +27,12 @@ | |||
| 27 | (platform | 27 | (platform |
| 28 | (target "arm-linux-gnueabihf") | 28 | (target "arm-linux-gnueabihf") |
| 29 | (system "armhf-linux") | 29 | (system "armhf-linux") |
| 30 | (linux-architecture "arm"))) | 30 | (linux-architecture "arm") |
| 31 | (glibc-dynamic-linker "/lib/ld-linux-armhf.so.3"))) | ||
| 31 | 32 | ||
| 32 | (define aarch64-linux | 33 | (define aarch64-linux |
| 33 | (platform | 34 | (platform |
| 34 | (target "aarch64-linux-gnu") | 35 | (target "aarch64-linux-gnu") |
| 35 | (system "aarch64-linux") | 36 | (system "aarch64-linux") |
| 36 | (linux-architecture "arm64"))) | 37 | (linux-architecture "arm64") |
| 38 | (glibc-dynamic-linker "/lib/ld-linux-aarch64.so.1"))) | ||
diff --git a/gnu/platforms/hurd.scm b/gnu/platforms/hurd.scm new file mode 100644 index 00000000000..328e9818adc --- /dev/null +++ b/gnu/platforms/hurd.scm | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu platforms hurd) | ||
| 20 | #:use-module (gnu platform) | ||
| 21 | #:use-module (gnu packages linux) | ||
| 22 | #:use-module (guix records) | ||
| 23 | #:export (hurd)) | ||
| 24 | |||
| 25 | (define hurd | ||
| 26 | (platform | ||
| 27 | (target "i586-pc-gnu") | ||
| 28 | (system "i586-gnu") | ||
| 29 | (glibc-dynamic-linker "/lib/ld.so.1"))) | ||
diff --git a/gnu/platforms/mips.scm b/gnu/platforms/mips.scm index 84a492699d8..174657da13a 100644 --- a/gnu/platforms/mips.scm +++ b/gnu/platforms/mips.scm | |||
| @@ -26,4 +26,5 @@ | |||
| 26 | (platform | 26 | (platform |
| 27 | (target "mips64el-linux-gnu") | 27 | (target "mips64el-linux-gnu") |
| 28 | (system "mips64el-linux") | 28 | (system "mips64el-linux") |
| 29 | (linux-architecture "mips"))) | 29 | (linux-architecture "mips") |
| 30 | (glibc-dynamic-linker "/lib/ld.so.1"))) | ||
diff --git a/gnu/platforms/powerpc.scm b/gnu/platforms/powerpc.scm index 8fadfe88de6..1d0b5cb666d 100644 --- a/gnu/platforms/powerpc.scm +++ b/gnu/platforms/powerpc.scm | |||
| @@ -27,10 +27,12 @@ | |||
| 27 | (platform | 27 | (platform |
| 28 | (target "powerpc-linux-gnu") | 28 | (target "powerpc-linux-gnu") |
| 29 | (system "powerpc-linux") | 29 | (system "powerpc-linux") |
| 30 | (linux-architecture "powerpc"))) | 30 | (linux-architecture "powerpc") |
| 31 | (glibc-dynamic-linker "/lib/ld.so.1"))) | ||
| 31 | 32 | ||
| 32 | (define powerpc64le-linux | 33 | (define powerpc64le-linux |
| 33 | (platform | 34 | (platform |
| 34 | (target "powerpc64le-linux-gnu") | 35 | (target "powerpc64le-linux-gnu") |
| 35 | (system "powerpc64le-linux") | 36 | (system "powerpc64le-linux") |
| 36 | (linux-architecture "powerpc"))) | 37 | (linux-architecture "powerpc") |
| 38 | (glibc-dynamic-linker "/lib/ld64.so.2"))) | ||
diff --git a/gnu/platforms/riscv.scm b/gnu/platforms/riscv.scm index 29a34402a2d..c2b4850e55f 100644 --- a/gnu/platforms/riscv.scm +++ b/gnu/platforms/riscv.scm | |||
| @@ -26,4 +26,5 @@ | |||
| 26 | (platform | 26 | (platform |
| 27 | (target "riscv64-linux-gnu") | 27 | (target "riscv64-linux-gnu") |
| 28 | (system "riscv64-linux") | 28 | (system "riscv64-linux") |
| 29 | (linux-architecture "riscv"))) | 29 | (linux-architecture "riscv") |
| 30 | (glibc-dynamic-linker "/lib/ld-linux-riscv64-lp64d.so.1"))) | ||
diff --git a/gnu/platforms/s390.scm b/gnu/platforms/s390.scm index c8caafbe45a..d3b1133974c 100644 --- a/gnu/platforms/s390.scm +++ b/gnu/platforms/s390.scm | |||
| @@ -26,4 +26,5 @@ | |||
| 26 | (platform | 26 | (platform |
| 27 | (target "s390x-linux-gnu") | 27 | (target "s390x-linux-gnu") |
| 28 | (system "s390x-linux") | 28 | (system "s390x-linux") |
| 29 | (linux-architecture "s390"))) | 29 | (linux-architecture "s390") |
| 30 | (glibc-dynamic-linker "/lib/ld64.so.1"))) | ||
diff --git a/gnu/platforms/x86.scm b/gnu/platforms/x86.scm index 1a5d6a32845..927d359ae8d 100644 --- a/gnu/platforms/x86.scm +++ b/gnu/platforms/x86.scm | |||
| @@ -29,25 +29,30 @@ | |||
| 29 | (platform | 29 | (platform |
| 30 | (target "i686-linux-gnu") | 30 | (target "i686-linux-gnu") |
| 31 | (system "i686-linux") | 31 | (system "i686-linux") |
| 32 | (linux-architecture "i386"))) | 32 | (linux-architecture "i386") |
| 33 | (glibc-dynamic-linker "/lib/ld-linux.so.2"))) | ||
| 33 | 34 | ||
| 34 | (define x86_64-linux | 35 | (define x86_64-linux |
| 35 | (platform | 36 | (platform |
| 36 | (target "x86_64-linux-gnu") | 37 | (target "x86_64-linux-gnu") |
| 37 | (system "x86_64-linux") | 38 | (system "x86_64-linux") |
| 38 | (linux-architecture "x86_64"))) | 39 | (linux-architecture "x86_64") |
| 40 | (glibc-dynamic-linker "/lib/ld-linux-x86-64.so.2"))) | ||
| 39 | 41 | ||
| 40 | (define i686-mingw | 42 | (define i686-mingw |
| 41 | (platform | 43 | (platform |
| 42 | (target "i686-w64-mingw32") | 44 | (target "i686-w64-mingw32") |
| 43 | (system #f))) | 45 | (system #f) |
| 46 | (glibc-dynamic-linker #f))) | ||
| 44 | 47 | ||
| 45 | (define x86_64-mingw | 48 | (define x86_64-mingw |
| 46 | (platform | 49 | (platform |
| 47 | (target "x86_64-w64-mingw32") | 50 | (target "x86_64-w64-mingw32") |
| 48 | (system #f))) | 51 | (system #f) |
| 52 | (glibc-dynamic-linker #f))) | ||
| 49 | 53 | ||
| 50 | (define hurd | 54 | (define hurd |
| 51 | (platform | 55 | (platform |
| 52 | (target "i586-pc-gnu") | 56 | (target "i586-pc-gnu") |
| 53 | (system "i586-gnu"))) | 57 | (system "i586-gnu") |
| 58 | (glibc-dynamic-linker "/lib/ld.so.1"))) | ||
