s390x: Implement preliminary check for z14 support (#1945473)

Resolves: #1945473
This commit is contained in:
Florian Weimer 2021-04-09 18:58:30 +02:00
parent 15874e7864
commit 0d152695fc
2 changed files with 33 additions and 1 deletions

28
glibc-rh1945473.patch Normal file
View File

@ -0,0 +1,28 @@
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;

View File

@ -89,7 +89,7 @@
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 7%{?dist}
Release: 8%{?dist}
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
@ -167,6 +167,7 @@ Patch47: glibc-upstream-2.33-16.patch
Patch48: glibc-upstream-2.33-17.patch
Patch49: glibc-upstream-2.33-18.patch
Patch50: glibc-upstream-2.33-19.patch
Patch51: glibc-rh1945473.patch
##############################################################################
# Continued list of core "glibc" package information:
@ -2288,6 +2289,9 @@ fi
%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared
%changelog
* Fri Apr 9 2021 Florian Weimer <fweimer@redhat.com> - 2.33-8
- s390x: Implement preliminary check for z14 support (#1945473)
* Fri Apr 9 2021 Florian Weimer <fweimer@redhat.com> - 2.33-7
- Inherit additional build flags from redhat-rpm-config (#1947895)