-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuclibc-0070-libm-honor-NO_LONG_DOUBLE-in-ldouble_wrappers.patch
89 lines (83 loc) · 2.83 KB
/
uclibc-0070-libm-honor-NO_LONG_DOUBLE-in-ldouble_wrappers.patch
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
From 730db44f0824f505a31822e250b9f04b9f8e7a1b Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <[email protected]>
Date: Tue, 24 Mar 2015 00:11:47 +0100
Subject: [PATCH] libm: honor NO_LONG_DOUBLE in ldouble_wrappers
Fixes SH build breakage due to attempts to define hidden defs for
unavailable long double functions.
Signed-off-by: Bernhard Reutner-Fischer <[email protected]>
[Gustavo: adapt to 0.9.33.2]
Signed-off-by: Gustavo Zacarias <[email protected]>
---
extra/Configs/Config.in.arch | 2 +-
ldso/ldso/sh/dl-syscalls.h | 2 +-
libm/ldouble_wrappers.c | 15 +++++++++------
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/extra/Configs/Config.in.arch b/extra/Configs/Config.in.arch
index 68e03bf..0dae84b 100644
--- a/extra/Configs/Config.in.arch
+++ b/extra/Configs/Config.in.arch
@@ -191,7 +191,7 @@ config UCLIBC_HAS_FENV
config UCLIBC_HAS_LONG_DOUBLE_MATH
bool "Enable long double support"
depends on DO_C99_MATH
- depends on TARGET_i386 || TARGET_m68k || TARGET_sparc || TARGET_x86_64 || TARGET_powerpc || TARGET_sh || TARGET_microblaze
+ depends on TARGET_aarch64 || TARGET_alpha || TARGET_i386 || TARGET_ia64 || TARGET_m68k || TARGET_powerpc || TARGET_s390 || TARGET_sparc || TARGET_tile || TARGET_x86_64
default y
help
If you want the uClibc math library to contain the full set of C99
diff --git a/ldso/ldso/sh/dl-syscalls.h b/ldso/ldso/sh/dl-syscalls.h
index f9f13c7..b99a9b5 100644
--- a/ldso/ldso/sh/dl-syscalls.h
+++ b/ldso/ldso/sh/dl-syscalls.h
@@ -1,4 +1,4 @@
-#if __GNUC_PREREQ (4, 1)
+#if __GNUC_PREREQ (4, 1) && !__GNUC_PREREQ (4, 9)
#warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline
# ifdef __always_inline
# undef __always_inline
diff --git a/libm/ldouble_wrappers.c b/libm/ldouble_wrappers.c
index b4215cb..840293f 100644
--- a/libm/ldouble_wrappers.c
+++ b/libm/ldouble_wrappers.c
@@ -16,27 +16,28 @@
#include "math.h"
#include <complex.h>
-#define WRAPPER1(func) \
+#if !defined __NO_LONG_DOUBLE_MATH
+# define WRAPPER1(func) \
long double func##l(long double x) \
{ \
return (long double) func((double) x); \
}
-#define WRAPPER2(func) \
+# define WRAPPER2(func) \
long double func##l(long double x, long double y) \
{ \
return (long double) func((double) x, (double) y); \
}
-#define int_WRAPPER1(func) \
+# define int_WRAPPER1(func) \
int func##l(long double x) \
{ \
return func((double) x); \
}
-#define long_WRAPPER1(func) \
+# define long_WRAPPER1(func) \
long func##l(long double x) \
{ \
return func((double) x); \
}
-#define long_long_WRAPPER1(func) \
+# define long_long_WRAPPER1(func) \
long long func##l(long double x) \
{ \
return func((double) x); \
@@ -447,4 +448,6 @@ int_WRAPPER1(__isinf)
libm_hidden_def(__isinfl)
# endif
-#endif
+#endif /* __DO_C99_MATH__ */
+
+#endif /* __NO_LONG_DOUBLE_MATH */
--
2.0.5