]> code.ossystems Code Review - openembedded-core.git/commitdiff
valgrind: Fix build on musl after drd fixes
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 26 Oct 2020 12:50:09 +0000 (12:50 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 26 Oct 2020 13:45:45 +0000 (13:45 +0000)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/valgrind/valgrind/0001-drd-musl-fix.patch [new file with mode: 0644]
meta/recipes-devtools/valgrind/valgrind_3.16.1.bb

diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-drd-musl-fix.patch b/meta/recipes-devtools/valgrind/valgrind/0001-drd-musl-fix.patch
new file mode 100644 (file)
index 0000000..e96bf3c
--- /dev/null
@@ -0,0 +1,31 @@
+The changes in 0001-drd-Port-to-Fedora-33.patch break builds on musl. These
+need a __GLIBC__ guard to ensure musl builds continue to work.
+
+Upstream-Status: Pending
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: valgrind-3.16.1/drd/drd_pthread_intercepts.c
+===================================================================
+--- valgrind-3.16.1.orig/drd/drd_pthread_intercepts.c
++++ valgrind-3.16.1/drd/drd_pthread_intercepts.c
+@@ -180,6 +180,7 @@ static int never_true;
+  * functions in both libc and libpthread. Older glibc versions only have an
+  * implementation of the pthread functions in libpthread.
+  */
++#ifdef __GLIBC__
+ #define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl)                    \
+    ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl;           \
+    ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl            \
+@@ -187,6 +188,12 @@ static int never_true;
+    ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl;     \
+    ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl      \
+    { return implf argl; }
++#else
++#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl)                    \
++   ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl;     \
++   ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl      \
++   { return implf argl; }
++#endif
+ #endif
+ /**
index 7508098b55726e2c7bd91d8eb3792a380a6dc61b..bcba55f327b23a51c63979542d15dd9b422e63f6 100644 (file)
@@ -41,6 +41,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
            file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
            file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
            file://0001-drd-Port-to-Fedora-33.patch \
+           file://0001-drd-musl-fix.patch \
            "
 SRC_URI[md5sum] = "d1b153f1ab17cf1f311705e7a83ef589"
 SRC_URI[sha256sum] = "c91f3a2f7b02db0f3bc99479861656154d241d2fdb265614ba918cc6720a33ca"