summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch')
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch87
1 files changed, 0 insertions, 87 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
deleted file mode 100644
index f407d8191b..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch
+++ /dev/null
@@ -1,87 +0,0 @@
1From 92fcf75d6d3903e45492b041bf4ad07787d2e58a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 27 Jan 2020 19:50:04 -0800
4Subject: [PATCH] drd/tests/pth_detached3: Make pthread_detach() call portable
5 across platforms
6
7pthread_t is opaque type therefore we can not apply simple arithmetic to
8variables of pthread_t type this test needs to pass a invalid pthread_t
9handle, typcasting to uintptr_t works too and is portable across glibc and
10musl
11
12Fixes
13| pth_detached3.c:24:25: error: invalid use of undefined type 'struct __pthread'
14| 24 | pthread_detach(thread + 8);
15| | ^
16
17[ bvanassche: reformatted patch description and fixed up line numbers ]
18
19Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=92fcf75d6d3903e45492b041bf4ad07787d2e58a]
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21---
22 drd/tests/pth_detached3.c | 3 ++-
23 drd/tests/pth_detached3.stderr.exp1 | 4 ++--
24 drd/tests/pth_detached3.stderr.exp2 | 4 ++--
25 3 files changed, 6 insertions(+), 5 deletions(-)
26
27diff --git a/drd/tests/pth_detached3.c b/drd/tests/pth_detached3.c
28index c02eef1..efeb15b 100644
29--- a/drd/tests/pth_detached3.c
30+++ b/drd/tests/pth_detached3.c
31@@ -4,6 +4,7 @@
32 #include <errno.h>
33 #include <pthread.h>
34 #include <stdio.h>
35+#include <stdint.h>
36
37 static void* thread_func(void* arg)
38 {
39@@ -21,7 +22,7 @@ int main(int argc, char** argv)
40 pthread_detach(thread);
41
42 /* Invoke pthread_detach() with an invalid thread ID. */
43- pthread_detach(thread + 8);
44+ pthread_detach((pthread_t)((uintptr_t)thread + 8));
45
46 fprintf(stderr, "Finished.\n");
47
48diff --git a/drd/tests/pth_detached3.stderr.exp1 b/drd/tests/pth_detached3.stderr.exp1
49index 58412ec..8dd58ba 100644
50--- a/drd/tests/pth_detached3.stderr.exp1
51+++ b/drd/tests/pth_detached3.stderr.exp1
52@@ -1,11 +1,11 @@
53
54 pthread_detach(): invalid thread ID 0x........
55 at 0x........: pthread_detach (drd_pthread_intercepts.c:?)
56- by 0x........: main (pth_detached3.c:21)
57+ by 0x........: main (pth_detached3.c:22)
58
59 pthread_detach(): invalid thread ID 0x........
60 at 0x........: pthread_detach (drd_pthread_intercepts.c:?)
61- by 0x........: main (pth_detached3.c:24)
62+ by 0x........: main (pth_detached3.c:25)
63
64 Finished.
65
66diff --git a/drd/tests/pth_detached3.stderr.exp2 b/drd/tests/pth_detached3.stderr.exp2
67index bdc5cf8..e82dee1 100644
68--- a/drd/tests/pth_detached3.stderr.exp2
69+++ b/drd/tests/pth_detached3.stderr.exp2
70@@ -2,12 +2,12 @@
71 pthread_detach(): invalid thread ID 0x........
72 at 0x........: vgDrd_set_joinable (drd_pthread_intercepts.c:?)
73 by 0x........: pthread_detach (drd_pthread_intercepts.c:?)
74- by 0x........: main (pth_detached3.c:21)
75+ by 0x........: main (pth_detached3.c:22)
76
77 pthread_detach(): invalid thread ID 0x........
78 at 0x........: vgDrd_set_joinable (drd_pthread_intercepts.c:?)
79 by 0x........: pthread_detach (drd_pthread_intercepts.c:?)
80- by 0x........: main (pth_detached3.c:24)
81+ by 0x........: main (pth_detached3.c:25)
82
83 Finished.
84
85--
862.9.3
87