summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/valgrind/valgrind
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-01-27 19:58:50 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-02 16:57:21 +0000
commit2fcd0cebe5932afcdb8e05c08232b4b3955b58d3 (patch)
tree796f9e033ac8a17686846bcbe8ae40b2ed7c8eb5 /meta/recipes-devtools/valgrind/valgrind
parent85a0d6102580da2fa90ae06ccff0716fe755a9d0 (diff)
downloadpoky-2fcd0cebe5932afcdb8e05c08232b4b3955b58d3.tar.gz
valgrind: Fix ptest builds on musl
(From OE-Core rev: 20e7d638322cf03f512d4f13c698f25211097f86) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/valgrind/valgrind')
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch44
1 files changed, 44 insertions, 0 deletions
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 0000000000..44d707a235
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
@@ -0,0 +1,44 @@
1From 90fdb0ae0418f7907f09b763343a457bdf6855fa Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 27 Jan 2020 17:17:19 -0800
4Subject: [PATCH] tests: Make pthread_detatch call portable across platforms
5
6pthread_t is opaque type therefore we can not apply simple arithmetic to variables of pthread_t type
7this test needs to pass a invalid pthread_t handle, typcasting to uintptr_t works too and is portable
8across glibc and musl
9
10Fixes
11| pth_detached3.c:24:25: error: invalid use of undefined type 'struct __pthread'
12| 24 | pthread_detach(thread + 8);
13| | ^
14
15Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36910506/]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 drd/tests/pth_detached3.c | 3 ++-
19 1 file changed, 2 insertions(+), 1 deletion(-)
20
21diff --git a/drd/tests/pth_detached3.c b/drd/tests/pth_detached3.c
22index c02eef11a..efeb15b72 100644
23--- a/drd/tests/pth_detached3.c
24+++ b/drd/tests/pth_detached3.c
25@@ -4,6 +4,7 @@
26 #include <errno.h>
27 #include <pthread.h>
28 #include <stdio.h>
29+#include <stdint.h>
30
31 static void* thread_func(void* arg)
32 {
33@@ -21,7 +22,7 @@ int main(int argc, char** argv)
34 pthread_detach(thread);
35
36 /* Invoke pthread_detach() with an invalid thread ID. */
37- pthread_detach(thread + 8);
38+ pthread_detach((pthread_t)((uintptr_t)thread + 8));
39
40 fprintf(stderr, "Finished.\n");
41
42--
432.25.0
44