glibc/glibc-rh1945473.patch
2021-04-09 18:58:30 +02:00

29 lines
1.1 KiB
Diff

Add diagnostics for missing z14 support. Not yet upstream. Discussion
is here:
s390x: Diagnose missing VXE at run time if required at build time
<https://sourceware.org/pipermail/libc-alpha/2021-April/124834.html>
The approach implemented by upstream will likely be slightly different
(if upstream takes the patch at all). dl_platform_init does not work
for POWER because POWER9 instructions are used in __tunables_init,
which is called before DL_PLATFORM_INIT/dl_platform_init.
diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h
index 543361c83637c071..deaf37951206fb7c 100644
--- a/sysdeps/s390/s390-64/dl-machine.h
+++ b/sysdeps/s390/s390-64/dl-machine.h
@@ -235,6 +235,12 @@ _dl_start_user:\n\
static inline void __attribute__ ((unused))
dl_platform_init (void)
{
+#ifdef __LONG_DOUBLE_VX__
+ if (!(GLRO(dl_hwcap) & HWCAP_S390_VXE))
+ _dl_fatal_printf ("\
+Fatal glibc error: CPU lacks VXE support (z14 or later required)\n");
+#endif
+
if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
/* Avoid an empty string which would disturb us. */
GLRO(dl_platform) = NULL;