From 4966be66afe92d37f5eeaedf81d7cf4b9e9b4dd8 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 24 Nov 2024 10:52:03 +0200 Subject: [PATCH] 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 199c5d56214..cd4f9b49f4e 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -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)