guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

39/60: gnu: Add musl-boot.


From: guix-commits
Subject: 39/60: gnu: Add musl-boot.
Date: Sun, 24 Nov 2024 02:50:15 -0500 (EST)

efraim pushed a commit to branch wip-riscv-bootstrap
in repository guix.

commit 83aa03db92f2cb45e610039866b10bd4eb829bbd
Author: Ekaitz Zarraga <ekaitz@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 <efraim@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 57647252d2..cb154485f9 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1931,6 +1931,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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]