From 6ff5b8869da8dc104faee5ec6af9f9e58589a56b Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Jan 09 2019 22:31:45 +0000 Subject: Add valgrind-3.14.0-rsp-clobber.patch --- diff --git a/valgrind-3.14.0-rsp-clobber.patch b/valgrind-3.14.0-rsp-clobber.patch new file mode 100644 index 0000000..1400f0b --- /dev/null +++ b/valgrind-3.14.0-rsp-clobber.patch @@ -0,0 +1,35 @@ +commit 022f5af61bc3cbfa2b74ab355b0d2d30b3dab027 +Author: Khem Raj +Date: Sat Dec 22 15:28:40 2018 -0800 + + tests/amd64: Do not clobber %rsp register + + This is seen with gcc-9.0 compiler now which is fix that gcc community + did recently + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813 + + Signed-off-by: Khem Raj + +diff --git a/none/tests/amd64-linux/bug345887.c b/none/tests/amd64-linux/bug345887.c +index 0f9237d..269bd70 100644 +--- a/none/tests/amd64-linux/bug345887.c ++++ b/none/tests/amd64-linux/bug345887.c +@@ -20,13 +20,17 @@ static void inner(void) + "movq $0x10d, %%r14\n" + "movq $0x10e, %%r15\n" + // not %rbp as mdb is then not able to reconstruct stack trace ++ // Do change %rsp (to test a bogus stack pointer), ++ // but don't add %rsp to the clobber list since gcc ignores it ++ // and since gcc >= 9.0 errors about it ++ // see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813 + "movq $0x10f, %%rsp\n" + "movq $0x1234, (%%rax)\n" // should cause SEGV here + "ud2" // should never get here + : // no output registers + : // no input registers + : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi", +- "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "%rsp"); ++ "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"); + } + + __attribute__((noinline)) diff --git a/valgrind.spec b/valgrind.spec index ee02b21..b833a97 100644 --- a/valgrind.spec +++ b/valgrind.spec @@ -167,6 +167,9 @@ Patch32: valgrind-3.14.0-x86-Iop_Sar64.patch # KDE#402519 POWER 3.0 addex instruction incorrectly implemented Patch33: valgrind-3.14.0-power9-addex.patch +# KDE#402480 Do not use %rsp in clobber list +Patch34: valgrind-3.14.0-rsp-clobber.patch + %if %{build_multilib} # Ensure glibc{,-devel} is installed for both multilib arches @@ -333,6 +336,7 @@ Valgrind User Manual for details. %patch31 -p1 %patch32 -p1 %patch33 -p1 +%patch34 -p1 %build CC=gcc @@ -567,6 +571,9 @@ fi %endif %changelog +* Wed Jan 9 2019 Mark Wielaard +- Add valgrind-3.14.0-rsp-clobber.patch + * Mon Dec 31 2018 Mark Wielaard - 3.14.0-9 - Add valgrind-3.14.0-vbit-test-sec.patch - Add valgrind-3.14.0-x86-Iop_Sar64.patch