[oe-commits] [openembedded-core] 02/23: valgrind: Fix ptest builds on musl

git at git.openembedded.org git at git.openembedded.org
Wed Jan 29 17:42:00 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 4a201549192133ec28f8d0d2595370bbbea4eccb
Author: Khem Raj <raj.khem at gmail.com>
AuthorDate: Mon Jan 27 19:58:50 2020 -0800

    valgrind: Fix ptest builds on musl
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
    Cc: Alexander Kanavin <alex.kanavin at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...pthread_detatch-call-portable-across-plat.patch | 44 ++++++++++++++++++++++
 meta/recipes-devtools/valgrind/valgrind_3.15.0.bb  |  1 +
 2 files changed, 45 insertions(+)

diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch b/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
new file mode 100644
index 0000000..44d707a
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
@@ -0,0 +1,44 @@
+From 90fdb0ae0418f7907f09b763343a457bdf6855fa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at gmail.com>
+Date: Mon, 27 Jan 2020 17:17:19 -0800
+Subject: [PATCH] tests: Make pthread_detatch call portable across platforms
+
+pthread_t is opaque type therefore we can not apply simple arithmetic to variables of pthread_t type
+this test needs to pass a invalid pthread_t handle, typcasting to uintptr_t works too and is portable
+across glibc and musl
+
+Fixes
+| pth_detached3.c:24:25: error: invalid use of undefined type 'struct __pthread'
+|    24 |   pthread_detach(thread + 8);
+|       |                         ^
+
+Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36910506/]
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+---
+ drd/tests/pth_detached3.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drd/tests/pth_detached3.c b/drd/tests/pth_detached3.c
+index c02eef11a..efeb15b72 100644
+--- a/drd/tests/pth_detached3.c
++++ b/drd/tests/pth_detached3.c
+@@ -4,6 +4,7 @@
+ #include <errno.h>
+ #include <pthread.h>
+ #include <stdio.h>
++#include <stdint.h>
+ 
+ static void* thread_func(void* arg)
+ {
+@@ -21,7 +22,7 @@ int main(int argc, char** argv)
+   pthread_detach(thread);
+ 
+   /* Invoke pthread_detach() with an invalid thread ID. */
+-  pthread_detach(thread + 8);
++  pthread_detach((pthread_t)((uintptr_t)thread + 8));
+ 
+   fprintf(stderr, "Finished.\n");
+ 
+-- 
+2.25.0
+
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
index 0f86aa4..1475ff8 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
@@ -40,6 +40,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
            file://0001-adjust-path-filter-for-2-memcheck-tests.patch \
            file://s390x_vec_op_t.patch \
            file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
+           file://0001-tests-Make-pthread_detatch-call-portable-across-plat.patch \
            "
 SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975"
 SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list