All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/foot: support soft-float architecture
@ 2025-02-04 11:27 Thomas Bonnefille via buildroot
  2025-02-04 11:31 ` Thomas Bonnefille via buildroot
  2025-02-04 13:08 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Bonnefille via buildroot @ 2025-02-04 11:27 UTC (permalink / raw)
  To: buildroot
  Cc: Thomas Petazzoni, Miquèl Raynal, Adam Duskett,
	Thomas Bonnefille

Architecture using soft float don't support the math FE_* exceptions.
This commit adds a patch to conditionnally build the FE_* exception
handling.

Fixes:
    https://autobuild.buildroot.org/results/88d/88d764dd12bdbdbe633ebc703c461ebe95b75693/

Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
---
 ...wings-handle-architecture-with-soft-float.patch | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/package/foot/0001-box-drawings-handle-architecture-with-soft-float.patch b/package/foot/0001-box-drawings-handle-architecture-with-soft-float.patch
new file mode 100644
index 0000000000000000000000000000000000000000..6599da1d80a6ed7a3f0f9944bbff82d083177d48
--- /dev/null
+++ b/package/foot/0001-box-drawings-handle-architecture-with-soft-float.patch
@@ -0,0 +1,41 @@
+From 1f66f85c203e48881f8ce5ed7be0316814dfc388 Mon Sep 17 00:00:00 2001
+From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
+Date: Tue, 4 Feb 2025 09:48:13 +0100
+Subject: [PATCH] box-drawings: handle architecture with soft-float
+
+Currently, architecture using soft-floats doesn't support instructions
+FE_INVALID, FE_DIVBYZERO, FE_OVERFLOW and FE_UNDERFLOW and so building
+on those architectures results with a build error.
+As the sqrt math function should set errno to EDOM if an error occurs,
+fetestexcept shouldn't be mandatory.
+
+This commit makes fetestexcept dependant on if the different
+exceptions exist on the target architecture.
+
+Upstream: https://codeberg.org/dnkl/foot/pulls/1944
+Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
+---
+ box-drawing.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/box-drawing.c b/box-drawing.c
+index 1c613051..e5f67ca7 100644
+--- a/box-drawing.c
++++ b/box-drawing.c
+@@ -1468,8 +1468,11 @@ draw_box_drawings_light_arc(struct buf *buf, char32_t wc)
+         double x = circle_hemisphere * sqrt(c_r2 - (y - c_y) * (y - c_y)) + c_x;
+ 
+         /* See math_error(7) */
+-        if (errno != 0 ||
+-            fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW))
++        if (errno != 0
++        #if defined (FE_INVALID) && defined (FE_DIVBYZERO) && defined (FE_OVERFLOW) && defined (FE_UNDERFLOW)
++            || fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW)
++        #endif
++        )
+         {
+             continue;
+         }
+-- 
+2.48.1
+

---
base-commit: d5b3795e92727c6565901cddf0c0f17c7854df56
change-id: 20250204-repair_foot-807b55790a7e

Best regards,
-- 
Thomas Bonnefille <thomas.bonnefille@bootlin.com>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-04 13:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04 11:27 [Buildroot] [PATCH] package/foot: support soft-float architecture Thomas Bonnefille via buildroot
2025-02-04 11:31 ` Thomas Bonnefille via buildroot
2025-02-04 13:08 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.