]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add workaround for arm64 AT_HWCAP on newer kernels. Bug KDE#381556.
authorMark Wielaard <mark@klomp.org>
Mon, 18 Jun 2018 13:07:27 +0000 (15:07 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 18 Jun 2018 13:07:27 +0000 (15:07 +0200)
Starting with linux 4.11 the kernel started to populate the AT_HWCAPS
auxv entry. And glibc 2.26 now uses this to see whether it can use the
mrs instruction and certain feature registers on arm64. Since these
are not supported under valgrind this causes an unhandled instruction
error. Workaround this for now my just clearing the AT_HWCAPS on arm64.

This should be fixed properly by someone with knowledge of what each
of the arm64 HWCAPS bits mean and which bits correspond to instructions
and registers supported by VEX or not.
https://bugs.kde.org/show_bug.cgi?id=381556

coregrind/m_initimg/initimg-linux.c

index 30e1f850f04ab9dc329290986b606ca6ed30ae15..14b48dca85ac15e37c9dd7cb0b44ea504bbd7339 100644 (file)
@@ -703,6 +703,12 @@ Addr setup_client_stack( void*  init_sp,
                   (and anything above) are not supported by Valgrind. */
                auxv->u.a_val &= VKI_HWCAP_S390_TE - 1;
             }
+#           elif defined(VGP_arm64_linux)
+            {
+               /* Linux 4.11 started pupulating this for arm64, but we
+                  currently don't support any. Bug KDE#381556. */
+               auxv->u.a_val = 0;
+            }
 #           endif
             break;
 #        if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)