guix_mirror_bot pushed a commit to branch wip-riscv-bootstrap in repository guix.
commit e71f668954a5095208c2d914cfe8d9aef52a9d47 Author: Ekaitz Zarraga <eka...@elenq.tech> AuthorDate: Wed Oct 9 19:56:03 2024 +0300 gnu: Add musl-boot. * gnu/packages/commencement.scm (musl-boot): New variable. Co-authored-by: Efraim Flashner <efr...@flashner.co.il> Change-Id: I2310f164276192099694c0ceb2ebe60938386f59 --- gnu/packages/commencement.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index e3c4127765..ff7a347051 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -1956,6 +1956,42 @@ ac_cv_c_float_format='IEEE (little-endian)' (variable "LIBRARY_PATH") (files '("lib"))))))) +(define musl-boot + (package + (inherit musl) + (name "musl-boot") + (native-inputs + (modify-inputs (%boot-tcc-musl-inputs) + (replace "gcc" gcc-muslboot0))) + (inputs '()) + (arguments + (substitute-keyword-arguments + (package-arguments musl-boot0) + ((#:guile _) %bootstrap-guile) + ((#:implicit-inputs? _ #f) #f) + ((#:make-flags _) + #~(list (string-append "SHELL=" #$(this-package-native-input "bash") + "/bin/bash"))) + ((#:configure-flags _ #~'()) + #~(list (string-append "CONFIG_SHELL=" + #$(this-package-native-input "bash") + "/bin/sh") + (string-append "--syslibdir=" #$output "/lib") + "CC=gcc" + "--enable-gcc-wrapper")) + ((#:phases phases #~'%standard-phases) + #~(modify-phases #$phases + (add-after 'install 'symlink-dynamic-linker + ;; This is a hack to work around not being able to hardcode + ;; the location of the dynamic linker for musl in gcc without + ;; adding musl as an input for gcc. + ;; Because honestly it's easier to add support to musl for + ;; (glibc-dynamic-linker) support than to adjust other software + ;; to use musl's dynamic-linker location. + (lambda _ + (symlink "libc.so" + (string-append #$output #$(glibc-dynamic-linker))))))))))) + (define (%boot-mesboot2-inputs) `(("gcc" ,gcc-mesboot1) ,@(alist-delete "gcc" (%boot-mesboot1-inputs))))