diff options
| -rw-r--r-- | meta/recipes-devtools/valgrind/valgrind/0001-tests-Make-pthread_detatch-call-portable-across-plat.patch | 44 | ||||
| -rw-r--r-- | meta/recipes-devtools/valgrind/valgrind_3.15.0.bb | 1 |
2 files changed, 45 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 @@ | |||
| 1 | From 90fdb0ae0418f7907f09b763343a457bdf6855fa Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 27 Jan 2020 17:17:19 -0800 | ||
| 4 | Subject: [PATCH] tests: Make pthread_detatch call portable across platforms | ||
| 5 | |||
| 6 | pthread_t is opaque type therefore we can not apply simple arithmetic to variables of pthread_t type | ||
| 7 | this test needs to pass a invalid pthread_t handle, typcasting to uintptr_t works too and is portable | ||
| 8 | across glibc and musl | ||
| 9 | |||
| 10 | Fixes | ||
| 11 | | pth_detached3.c:24:25: error: invalid use of undefined type 'struct __pthread' | ||
| 12 | | 24 | pthread_detach(thread + 8); | ||
| 13 | | | ^ | ||
| 14 | |||
| 15 | Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36910506/] | ||
| 16 | Signed-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 | |||
| 21 | diff --git a/drd/tests/pth_detached3.c b/drd/tests/pth_detached3.c | ||
| 22 | index 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 | -- | ||
| 43 | 2.25.0 | ||
| 44 | |||
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb index 0f86aa44ca..1475ff841e 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 \ | |||
| 40 | file://0001-adjust-path-filter-for-2-memcheck-tests.patch \ | 40 | file://0001-adjust-path-filter-for-2-memcheck-tests.patch \ |
| 41 | file://s390x_vec_op_t.patch \ | 41 | file://s390x_vec_op_t.patch \ |
| 42 | file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ | 42 | file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ |
| 43 | file://0001-tests-Make-pthread_detatch-call-portable-across-plat.patch \ | ||
| 43 | " | 44 | " |
| 44 | SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975" | 45 | SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975" |
| 45 | SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1" | 46 | SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1" |
