|
|
a2cf7d |
commit b5232c9f9e6048b8f780d3cbfadbc8e59bb90ce4
|
|
|
a2cf7d |
Author: Paul A. Clarke <pc@us.ibm.com>
|
|
|
a2cf7d |
Date: Mon Jul 8 17:06:19 2019 -0500
|
|
|
a2cf7d |
|
|
|
a2cf7d |
[powerpc] fenv_libc.h: protect use of __builtin_cpu_supports
|
|
|
a2cf7d |
|
|
|
a2cf7d |
Using __builtin_cpu_supports() requires support in GCC and Glibc.
|
|
|
a2cf7d |
My recent patch to fenv_libc.h added an unprotected use of
|
|
|
a2cf7d |
__builtin_cpu_supports(). Compilation of Glibc itself will fail
|
|
|
a2cf7d |
with a sufficiently new GCC and sufficiently old Glibc:
|
|
|
a2cf7d |
|
|
|
a2cf7d |
../sysdeps/powerpc/fpu/fegetexcept.c: In function ‘__fegetexcept’:
|
|
|
a2cf7d |
../sysdeps/powerpc/fpu/fenv_libc.h:52:20: error: builtin ‘__builtin_cpu_supports’ needs GLIBC (2.23 and newer) that exports hardware capability bits [-Werror]
|
|
|
a2cf7d |
|
|
|
a2cf7d |
Reviewed-by: Florian Weimer <fweimer@redhat.com>
|
|
|
a2cf7d |
Fixes 3db85a9814784a74536a1f0e7b7ddbfef7dc84bb.
|
|
|
a2cf7d |
|
|
|
a2cf7d |
diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
|
|
|
a2cf7d |
index cc00df033da47c1a..9dca6e760cc51946 100644
|
|
|
a2cf7d |
--- a/sysdeps/powerpc/fpu/fenv_libc.h
|
|
|
a2cf7d |
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
|
|
|
a2cf7d |
@@ -48,12 +48,14 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden;
|
|
|
a2cf7d |
|
|
|
a2cf7d |
#ifdef _ARCH_PWR9
|
|
|
a2cf7d |
# define fegetenv_status() fegetenv_status_ISA300()
|
|
|
a2cf7d |
-#else
|
|
|
a2cf7d |
+#elif defined __BUILTIN_CPU_SUPPORTS__
|
|
|
a2cf7d |
# define fegetenv_status() \
|
|
|
a2cf7d |
(__glibc_likely (__builtin_cpu_supports ("arch_3_00")) \
|
|
|
a2cf7d |
? fegetenv_status_ISA300() \
|
|
|
a2cf7d |
: fegetenv_register() \
|
|
|
a2cf7d |
)
|
|
|
a2cf7d |
+#else
|
|
|
a2cf7d |
+# define fegetenv_status() fegetenv_register ()
|
|
|
a2cf7d |
#endif
|
|
|
a2cf7d |
|
|
|
a2cf7d |
/* Equivalent to fesetenv, but takes a fenv_t instead of a pointer. */
|