Skip to contentSkip to conversation

valgrind: allow version 3.12 to build under gcc7

PATCH In review Joe Slater 2 participants 2 messages Jul 14, 2017

lore
Share & tools
lore

Joe Slater

author
#0 lore raw

PATCH v2 1/1 valgrind: allow version 3.12 to build under gcc7

Building for powerpc64 fails because of erroneous assertions that register r2 is clobbered. This has been fixed in version 3.13.

---
 .../valgrind/valgrind/wait-for-3.13.patch          | 40 ++++++++++++++++++++++
 meta/recipes-devtools/valgrind/valgrind_3.12.0.bb  |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-devtools/valgrind/valgrind/wait-for-3.13.patch
meta/recipes-devtools/valgrind/valgrind/wait-for-3.13.patch new file +40 -0
new file mode 100644
index 0000000..355c336
@@ -0,0 +1,40 @@
+valgrind: allow compilation under gcc7 for powerpc64
+
+Remove a few admonitions that r2 is not preserved by function or system calls
+since they are not true.  -m32 ppc code does not care, but -m64 code does.
+
+Upstream-Status: Accepted [ version 3.13 has similar changes, but NOT this patch ]
+
+Signed-off-by: Joe Slater <[email protected]>
+
+--- a/coregrind/m_debuglog.c
++++ b/coregrind/m_debuglog.c
+@@ -215,7 +215,7 @@ static UInt local_sys_write_stderr ( con
+       :
+       : "b" (block)
+       : "cc","memory","cr0","ctr",
+-        "r0","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12"
++        "r0","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12"
+    );
+    if (block[0] < 0)
+       block[0] = -1;
+@@ -231,7 +231,7 @@ static UInt local_sys_getpid ( void )
+       : "=&r" (__res)
+       : "i" (__NR_getpid)
+       : "cc","memory","cr0","ctr",
+-        "r0","r2","r4","r5","r6","r7","r8","r9","r10","r11","r12"
++        "r0","r4","r5","r6","r7","r8","r9","r10","r11","r12"
+    );
+    return (UInt)__res;
+ }
+--- a/include/valgrind.h
++++ b/include/valgrind.h
+@@ -2708,7 +2708,7 @@ typedef
+ #define __CALLER_SAVED_REGS                                       \
+    "lr", "ctr", "xer",                                            \
+    "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
+-   "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
++   "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
+    "r11", "r12", "r13"
+ 
+ /* Macros to save and align the stack before making a function
meta/recipes-devtools/valgrind/valgrind_3.12.0.bb +1 -0
index b63d278..80b1781 100644
@@ -35,6 +35,7 @@ SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
            file://0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch \
            file://0002-memcheck-x86-Define-__THROW-if-not-defined.patch \
            file://0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch \
+           file://wait-for-3.13.patch \
            "
 SRC_URI_append_libc-musl = "\
            file://0001-fix-build-for-musl-targets.patch \
Signature · 1 line
2.7.4
#1 lore raw

There's an outstanding patch for 3.13 upgrade which was failing to ptest build. I gave up waiting for the submitter to fix it and backported the fix myself earlier, it's currently queued for master.

Ross

Quoted 87 lines · Joe Slater

Building for powerpc64 fails because of erroneous assertions that register r2 is clobbered. This has been fixed in version 3.13.

---
 .../valgrind/valgrind/wait-for-3.13.patch          | 40
++++++++++++++++++++++
 meta/recipes-devtools/valgrind/valgrind_3.12.0.bb  |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-devtools/valgrind/valgrind/wait-for-3.

13.patch

meta/recipes-devtools/valgrind/valgrind/wait-for-3.13.patch new file +3 -0
new file mode 100644
index 0000000..355c336
@@ -0,0 +1,40 @@
+valgrind: allow compilation under gcc7 for powerpc64
+
+Remove a few admonitions that r2 is not preserved by function or system

calls

meta/recipes-devtools/valgrind/valgrind/wait-for-3.13.patch new file +3 -0
+since they are not true.  -m32 ppc code does not care, but -m64 code does.
+
+Upstream-Status: Accepted [ version 3.13 has similar changes, but NOT

this patch ]

meta/recipes-devtools/valgrind/valgrind/wait-for-3.13.patch new file +34 -0
+
+Signed-off-by: Joe Slater <[email protected]>
+
+--- a/coregrind/m_debuglog.c
++++ b/coregrind/m_debuglog.c
+@@ -215,7 +215,7 @@ static UInt local_sys_write_stderr ( con
+       :
+       : "b" (block)
+       : "cc","memory","cr0","ctr",
+-        "r0","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12"
++        "r0","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12"
+    );
+    if (block[0] < 0)
+       block[0] = -1;
+@@ -231,7 +231,7 @@ static UInt local_sys_getpid ( void )
+       : "=&r" (__res)
+       : "i" (__NR_getpid)
+       : "cc","memory","cr0","ctr",
+-        "r0","r2","r4","r5","r6","r7","r8","r9","r10","r11","r12"
++        "r0","r4","r5","r6","r7","r8","r9","r10","r11","r12"
+    );
+    return (UInt)__res;
+ }
+--- a/include/valgrind.h
++++ b/include/valgrind.h
+@@ -2708,7 +2708,7 @@ typedef
+ #define __CALLER_SAVED_REGS                                       \
+    "lr", "ctr", "xer",                                            \
+    "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
+-   "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
++   "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
+    "r11", "r12", "r13"
+
+ /* Macros to save and align the stack before making a function
meta/recipes-devtools/valgrind/valgrind_3.12.0.bb +1 -0
index b63d278..80b1781 100644
@@ -35,6 +35,7 @@ SRC_URI = "http://www.valgrind.org/
 downloads/valgrind-${PV}.tar.bz2 \
            file://0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch
 \
            file://0002-memcheck-x86-Define-__THROW-if-not-defined.patch \
            file://0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch
 \
+           file://wait-for-3.13.patch \
            "
 SRC_URI_append_libc-musl = "\
            file://0001-fix-build-for-musl-targets.patch \

--
2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core