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
This commit is contained in:
Stefan 2024-11-24 10:52:03 +02:00 committed by Efraim Flashner
parent 5af61ad937
commit 4966be66af
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -960,6 +960,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)