1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
From 5099057b7eaa08d53c8ab07be0f6d626496ec79d Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Thu, 3 Oct 2024 14:30:23 +0200
Subject: [PATCH] rts: Fix invocation of __ieee_set_fp_control() on alpha-linux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes the following error when building GHC on alpha-linux:
rts/posix/Signals.c: In function ‘initDefaultHandlers’:
rts/posix/Signals.c:709:5: error:
error: implicit declaration of function ‘ieee_set_fp_control’ [-Wimplicit-function-declaration]
709 | ieee_set_fp_control(0);
| ^~~~~~~~~~~~~~~~~~~
|
709 | ieee_set_fp_control(0);
|
---
rts/posix/Signals.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: b/rts/posix/Signals.c
===================================================================
--- a/rts/posix/Signals.c
+++ b/rts/posix/Signals.c
@@ -21,7 +21,7 @@
#if defined(alpha_HOST_ARCH)
# if defined(linux_HOST_OS)
-# include <asm/fpu.h>
+# include <fenv.h>
# else
# include <machine/fpu.h>
# endif
@@ -715,7 +715,11 @@ initDefaultHandlers(void)
#endif
#if defined(alpha_HOST_ARCH)
+# if defined(linux_HOST_OS)
+ __ieee_set_fp_control(0);
+# else
ieee_set_fp_control(0);
+# endif
#endif
// ignore SIGPIPE; see #1619
|