glibc/glibc-2.27-clang-_Float.patch
Andrey Bondrov 2bb20c2d90 New version 2.28
Sync patches with OpenMandriva
2019-04-12 16:38:20 +10:00

81 lines
3.3 KiB
Diff

--- glibc-2.27/bits/floatn-common.h.0134~ 2018-02-01 17:17:18.000000000 +0100
+++ glibc-2.27/bits/floatn-common.h 2018-03-03 02:32:16.924822310 +0100
@@ -28,6 +28,7 @@
where the same definitions, or definitions based only on the macros
in bits/floatn.h, are appropriate for all glibc configurations. */
+#ifndef __clang__ /* FIXME reinvestigate with clang 7 */
/* Defined to 1 if the current compiler invocation provides a
floating-point type with the right format for this type, and this
glibc includes corresponding *fN or *fNx interfaces for it. */
@@ -36,6 +37,7 @@
#define __HAVE_FLOAT64 1
#define __HAVE_FLOAT32X 1
#define __HAVE_FLOAT128X 0
+#endif
/* Defined to 1 if the corresponding __HAVE_<type> macro is 1 and the
type is the first with its format in the sequence of (the default
--- glibc-2.27/sysdeps/ieee754/ldbl-128/bits/floatn.h.0134~ 2018-02-01 17:17:18.000000000 +0100
+++ glibc-2.27/sysdeps/ieee754/ldbl-128/bits/floatn.h 2018-03-03 02:32:16.924822310 +0100
@@ -26,7 +26,11 @@
floating-point type with the IEEE 754 binary128 format, and this
glibc includes corresponding *f128 interfaces for it. */
#ifndef __NO_LONG_DOUBLE_MATH
-# define __HAVE_FLOAT128 1
+# if defined(__clang__)
+# define __HAVE_FLOAT128 0
+# else
+# define __HAVE_FLOAT128 1
+# endif
#else
/* glibc does not support _Float128 for platforms where long double is
normally binary128 when building with long double as binary64.
--- glibc-2.27/sysdeps/x86/bits/floatn.h.0134~ 2018-02-01 17:17:18.000000000 +0100
+++ glibc-2.27/sysdeps/x86/bits/floatn.h 2018-03-03 02:34:50.472771373 +0100
@@ -26,9 +26,9 @@
glibc includes corresponding *f128 interfaces for it. The required
libgcc support was added some time after the basic compiler
support, for x86_64 and x86. */
-#if (defined __x86_64__ \
+#if (!defined(__clang__) && (defined __x86_64__ \
? __GNUC_PREREQ (4, 3) \
- : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4)))
+ : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))))
# define __HAVE_FLOAT128 1
#else
# define __HAVE_FLOAT128 0
@@ -42,6 +42,7 @@
# define __HAVE_DISTINCT_FLOAT128 0
#endif
+#ifndef __clang__ /* FIXME reinvestigate with clang 7 */
/* Defined to 1 if the current compiler invocation provides a
floating-point type with the right format for _Float64x, and this
glibc includes corresponding *f64x interfaces for it. */
@@ -52,6 +53,7 @@
the format of _Float128, which must be different from that of long
double. */
#define __HAVE_FLOAT64X_LONG_DOUBLE 1
+#endif
#ifndef __ASSEMBLER__
@@ -68,7 +70,7 @@
/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
# if __HAVE_FLOAT128
-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus || defined __clang__
/* Add a typedef for older GCC compilers which don't natively support
_Complex _Float128. */
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
@@ -82,7 +84,7 @@ typedef _Complex float __cfloat128 __att
# if __HAVE_FLOAT128
/* The type _Float128 exists only since GCC 7.0. */
-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus || defined __clang__
typedef __float128 _Float128;
# endif