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

commit 2a66704ff3de192a70955d25c63183bb5e18858c
Author: Stefan <stefan-g...@vodafonemail.de>
AuthorDate: Sun Nov 24 10:52:03 2024 +0200

    WIP: musl-boot0: Add fixes for i686 and x86_64.
    
    THIS PATCH ONLY IS RELEVANT IF MUSL-BOOT0 MOVES TO 1.2.5!
    
    * gnu/packages/commencement.scm (musl-boot0)[arguments]: Add phases to
    use the fallback C implementations of some code to ensure compatibility
    with tcc.
    
    Change-Id: I87fb6b58fe386f6677069d85a22b8fdb28b5183d
---
 gnu/packages/commencement.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index e1fa03993c..6377246709 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -935,6 +935,20 @@ MesCC-Tools), and finally M2-Planet.")
            (add-after 'configure 'remove-complex
              (lambda _
                (delete-file-recursively "src/complex")))
+           (add-after 'unpack 'remove-optimized-math
+             ;; TCC does not support the extended asm for float registers.
+             ;; All src/math/{i386,x86_64}/*.c files make use of it.  Luckily
+             ;; musl has an automatic fallback to generic C implementations
+             ;; in src/math.  Therefore we can simply delete these files.
+             (lambda _
+               (for-each (lambda (path)
+                           (for-each delete-file (find-files path "\\.c$")))
+                         '("src/math/i386" "src/math/x86_64"))))
+           (add-after 'unpack 'adjust-i386-setjmp
+             (lambda _
+               ;; TCC has a bug with forward referencing numeric labels.  We
+               ;; remove this file and fallback to the generic C 
implementation.
+               (delete-file "src/signal/i386/sigsetjmp.s")))
            ;; We can't use the install script since it doesn't play well with 
gash.
            (replace 'install
              (lambda* (#:key outputs #:allow-other-keys)

Reply via email to