From: Mark Wielaard Date: Mon, 18 Jun 2018 13:07:27 +0000 (+0200) Subject: Add workaround for arm64 AT_HWCAP on newer kernels. Bug KDE#381556. X-Git-Tag: VALGRIND_3_14_0~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad4481d23aa54ad947f7dcd194f1233e0b99c70f;p=thirdparty%2Fvalgrind.git Add workaround for arm64 AT_HWCAP on newer kernels. Bug KDE#381556. 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 --- diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c index 30e1f850f0..14b48dca85 100644 --- a/coregrind/m_initimg/initimg-linux.c +++ b/coregrind/m_initimg/initimg-linux.c @@ -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)