[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
24/85: gnu: Add musl-boot0.
From: |
guix-commits |
Subject: |
24/85: gnu: Add musl-boot0. |
Date: |
Tue, 17 Dec 2024 04:08:04 -0500 (EST) |
efraim pushed a commit to branch wip-riscv-bootstrap
in repository guix.
commit 8b643695455da4db4ca1b19753fbf547fd391a0b
Author: Ekaitz Zarraga <ekaitz@elenq.tech>
AuthorDate: Wed Oct 2 16:00:32 2024 +0300
gnu: Add musl-boot0.
* gnu/packages/commencement.scm (musl-boot0): New variable.
Co-authored-by: Efraim Flashner <efraim@flashner.co.il>
Change-Id: Ifceb687164435c6a2d9a630a2923a3ef71df007a
---
gnu/packages/commencement.scm | 96 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index d09d161e9b..cad0cde575 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -48,6 +48,7 @@
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages compression)
#:use-module (gnu packages mes)
+ #:use-module (gnu packages musl)
#:use-module (gnu packages perl)
#:use-module (gnu packages python)
#:use-module (gnu packages linux)
@@ -883,6 +884,101 @@ MesCC-Tools), and finally M2-Planet.")
("tcc" ,tcc-boot)
,@(alist-delete "tcc" (%boot-tcc0-inputs))))
+;; The last musl in the 1.1.x series.
+;; For now this starts the riscv64 specific portion of the bootstrap.
+(define musl-boot0
+ (package
+ (inherit musl)
+ (name "musl-boot0")
+ (version "1.1.24")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://www.musl-libc.org/releases/"
+ "musl-" version ".tar.gz"))
+ (sha256
+ (base64 "E3DJqBKyzyp9koAlEMygBYzDfmanvt1wBR8KNAFQIqM="))))
+ (native-inputs (%boot-tcc-inputs))
+ (inputs '())
+ (arguments
+ (list
+ #:tests? #f ; musl has no tests
+ #:guile %bootstrap-guile
+ #:implicit-inputs? #f
+ #:strip-binaries? #f
+ #:parallel-build? #f ; Race conditions otherwise
+ #:make-flags
+ #~(list
+ (string-append "SHELL=" #$(this-package-native-input "bash")
+ "/bin/bash")
+ "CC=tcc"
+ "AR=tcc -ar"
+ "RANLIB=true"
+ "CFLAGS=-DSYSCALL_NO_TLS -D__riscv_float_abi_soft -U__riscv_flen")
+ #:configure-flags
+ #~(let ((bash #$(this-package-native-input "bash")))
+ (list "CC=tcc"
+ (string-append "CONFIG_SHELL=" bash "/bin/sh")
+ "--disable-shared"
+ "--disable-gcc-wrapper"))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'add-libg
+ (lambda _
+ (substitute* "Makefile"
+ (("(EMPTY_LIB_NAMES = )(.*)" all var content)
+ (string-append var "g " content)))))
+ (add-before 'build 'patch-shebang-in-makefile
+ (lambda _
+ (let ((bash #$(this-package-native-input "bash")))
+ (substitute* "Makefile"
+ (("#!/bin/sh") (string-append "#!" bash "/bin/bash"))))))
+ (add-after 'configure 'remove-complex
+ (lambda _
+ (delete-file-recursively "src/complex")))
+ ;; We can't use the install script since it doesn't play well with
gash.
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (lib (string-append out "/lib"))
+ (incl (string-append out "/include")))
+ (for-each (lambda (file)
+ (when (file-exists? file)
+ (install-file file bin)))
+ '("obj/ld.musl-clang"
+ "obj/musl-clang"
+ "obj/musl-gcc"))
+ (for-each (lambda (file)
+ (install-file file lib))
+ (find-files "lib" "\\.(a|o|so)$"))
+ (when (file-exists? "lib/musl-gcc.specs")
+ (install-file "lib/musl-gcc.specs" lib))
+ (copy-recursively "include" incl)
+ (for-each (lambda (file)
+ (install-file file (string-append incl "/bits")))
+ (append
+ (find-files
+ (string-append "arch/"
+ #$(cond
+ ((target-x86-32?) "x86")
+ ((target-x86-64?) "x86_64")
+ ((target-aarch64?) "aarch64")
+ ((target-riscv64?) "riscv64")
+ (#t ""))
+ "/bits"))
+ (find-files "arch/generic/bits")
+ (find-files "obj/include/bits")))
+ (when (file-exists? (string-append lib "/libc.so"))
+ (symlink "libc.so"
+ (string-append lib "/ld-musl-"
+ #$(cond
+ ((target-x86-32?) "x86")
+ ((target-x86-64?) "x86_64")
+ ((target-aarch64?) "aarch64")
+ ((target-riscv64?) "riscv64")
+ (#t ""))
+ ".so.1")))))))))))
+
(define binutils-mesboot0
;; The initial Binutils
(package
- 03/85: gnu: mes-boot: Update to 0.27., (continued)
- 03/85: gnu: mes-boot: Update to 0.27., guix-commits, 2024/12/17
- 09/85: gnu: gnu-make-mesboot0: Update to 3.82., guix-commits, 2024/12/17
- 01/85: gnu: mes-boot: Update to 0.26.1., guix-commits, 2024/12/17
- 07/85: gnu: mes-boot: Use commencement-build-target., guix-commits, 2024/12/17
- 11/85: gnu: binutils-mesboot0: Use commencement-build-target., guix-commits, 2024/12/17
- 13/85: gnu: glibc-mesboot0: Use commencement-build-target., guix-commits, 2024/12/17
- 14/85: gnu: gcc-mesboot0: Use commencement-build-target., guix-commits, 2024/12/17
- 18/85: gnu: gcc-mesboot: Use commencement-build-target., guix-commits, 2024/12/17
- 19/85: gnu: mes-boot: Enable support for armhf-linux and aarch64-linux., guix-commits, 2024/12/17
- 21/85: gnu: tcc-boot0: Specify the build target., guix-commits, 2024/12/17
- 24/85: gnu: Add musl-boot0.,
guix-commits <=
- 25/85: gnu: Add tcc-boot-musl., guix-commits, 2024/12/17
- 08/85: gnu: gzip-mesboot: Allow building on all systems., guix-commits, 2024/12/17
- 12/85: gnu: gcc-core-mesboot0: Use commencement-build-target., guix-commits, 2024/12/17
- 17/85: gnu: glibc-headers-mesboot: Use commencement-build-target., guix-commits, 2024/12/17
- 77/85: gnu: gcc-mesboot1: Use full gcc sources., guix-commits, 2024/12/17
- 84/85: gnu: bison-boot0: Update flags for riscv64-linux., guix-commits, 2024/12/17
- 27/85: gnu: Add oksh-muslboot0., guix-commits, 2024/12/17
- 34/85: gnu: gcc-core-mesboot1: Adjust for dependency changes., guix-commits, 2024/12/17
- 36/85: gnu: gcc-mesboot1: Adjust setting include paths., guix-commits, 2024/12/17
- 48/85: gnu: mesboot-package: Adjust for riscv64-linux builds., guix-commits, 2024/12/17