From d88d5c978d5b0d293dd879ee59a17524c68f5966 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 27 Apr 2022 10:40:04 +0200 Subject: valgrind: update 3.18.1 -> 3.19.0 Dropped patches are either backports, were merged upstream, or upstream fixed the issue differently. (From OE-Core rev: 4c9b619eb7cd91e7ffc8db0f5571a4dbe6966ccc) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- ...0001-Fix-drd-tests-shared_timed_mutex.cpp.patch | 26 +++ ...uard-against-__GLIBC_PREREQ-for-musl-libc.patch | 36 --- ...01-Implement-linux-rseq-syscall-as-ENOSYS.patch | 198 ---------------- ...tr_tester.c-Limit-rawmemchr-test-to-glibc.patch | 35 --- .../valgrind/0004-Fix-out-of-tree-builds.patch | 176 -------------- ...erifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch | 28 --- meta/recipes-devtools/valgrind/valgrind_3.18.1.bb | 255 --------------------- meta/recipes-devtools/valgrind/valgrind_3.19.0.bb | 255 +++++++++++++++++++++ 8 files changed, 281 insertions(+), 728 deletions(-) create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-Fix-drd-tests-shared_timed_mutex.cpp.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-Implement-linux-rseq-syscall-as-ENOSYS.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind_3.18.1.bb create mode 100644 meta/recipes-devtools/valgrind/valgrind_3.19.0.bb diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Fix-drd-tests-shared_timed_mutex.cpp.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Fix-drd-tests-shared_timed_mutex.cpp.patch new file mode 100644 index 0000000000..738bf87c92 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0001-Fix-drd-tests-shared_timed_mutex.cpp.patch @@ -0,0 +1,26 @@ +From 900b3f9b0765488f0e1f457ff5d5d1e3efe897de Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Wed, 27 Apr 2022 10:01:22 +0200 +Subject: [PATCH] Fix drd/tests/shared_timed_mutex.cpp + +Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=453055] +Signed-off-by: Alexander Kanavin +--- + drd/tests/shared_timed_mutex.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drd/tests/shared_timed_mutex.cpp b/drd/tests/shared_timed_mutex.cpp +index 9741169..dfd97a4 100644 +--- a/drd/tests/shared_timed_mutex.cpp ++++ b/drd/tests/shared_timed_mutex.cpp +@@ -43,6 +43,7 @@ void g() + if (test_mutex.try_lock_shared_until(then)) + { + test_mutex.unlock_shared(); ++ break; + } + } + if (i == 3) +-- +2.30.2 + diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch deleted file mode 100644 index 81ab29f3be..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 1b5b6f827ac1153a41fc93e78bf34ccdf5720b9b Mon Sep 17 00:00:00 2001 -From: Randy MacLeod -Date: Fri, 19 Oct 2018 10:31:12 -0400 -Subject: [PATCH] Guard against __GLIBC_PREREQ for musl libc - -Upstream-Status: Submitted https://bugs.kde.org/show_bug.cgi?id=400162 - -Signed-off-by: Randy MacLeod ---- - memcheck/tests/linux/sys-statx.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/memcheck/tests/linux/sys-statx.c b/memcheck/tests/linux/sys-statx.c -index fe9f9ba45..473c2cd7f 100644 ---- a/memcheck/tests/linux/sys-statx.c -+++ b/memcheck/tests/linux/sys-statx.c -@@ -7,11 +7,16 @@ - #include - #include - #include -+ -+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2,28) - /* struct statx provided in sys/stat.h */ - #else - #include - #endif -+#else -+#include -+#endif - #include - - int check_stat2; --- -2.17.0 - diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Implement-linux-rseq-syscall-as-ENOSYS.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Implement-linux-rseq-syscall-as-ENOSYS.patch deleted file mode 100644 index be1536980c..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-Implement-linux-rseq-syscall-as-ENOSYS.patch +++ /dev/null @@ -1,198 +0,0 @@ -From 1024237358f01009fe233cb1294f3b8211304eaa Mon Sep 17 00:00:00 2001 -From: Mark Wielaard -Date: Fri, 10 Dec 2021 17:41:59 +0100 -Subject: [PATCH] Implement linux rseq syscall as ENOSYS - -This implements rseq for amd64, arm, arm64, ppc32, ppc64, -s390x and x86 linux as ENOSYS (without warning). - -glibc will start using rseq to accelerate sched_getcpu, if -available. This would cause a warning from valgrind every -time a new thread is started. - -Real rseq (restartable sequences) support is pretty hard, so -for now just explicitly return ENOSYS (just like we do for clone3). - -Upstream-Status: Backport [ 1024237358f01009fe233cb1294f3b8211304eaa ] - -https://sourceware.org/pipermail/libc-alpha/2021-December/133656.html ---- - coregrind/m_syswrap/syswrap-amd64-linux.c | 2 ++ - coregrind/m_syswrap/syswrap-arm-linux.c | 1 + - coregrind/m_syswrap/syswrap-arm64-linux.c | 3 ++- - coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 ++ - coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 ++ - coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++ - coregrind/m_syswrap/syswrap-x86-linux.c | 2 ++ - include/vki/vki-scnums-arm-linux.h | 1 + - include/vki/vki-scnums-arm64-linux.h | 4 +++- - include/vki/vki-scnums-ppc32-linux.h | 1 + - include/vki/vki-scnums-ppc64-linux.h | 1 + - include/vki/vki-scnums-s390x-linux.h | 5 ++++- - 12 files changed, 23 insertions(+), 3 deletions(-) - -diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c -index 5062324a1..18b25f80a 100644 ---- a/coregrind/m_syswrap/syswrap-amd64-linux.c -+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c -@@ -862,6 +862,8 @@ static SyscallTableEntry syscall_table[] = { - - LINXY(__NR_statx, sys_statx), // 332 - -+ GENX_(__NR_rseq, sys_ni_syscall), // 334 -+ - LINX_(__NR_membarrier, sys_membarrier), // 324 - - LINX_(__NR_copy_file_range, sys_copy_file_range), // 326 -diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c -index 556dd844b..d583cef0c 100644 ---- a/coregrind/m_syswrap/syswrap-arm-linux.c -+++ b/coregrind/m_syswrap/syswrap-arm-linux.c -@@ -1024,6 +1024,7 @@ static SyscallTableEntry syscall_main_table[] = { - LINX_(__NR_pwritev2, sys_pwritev2), // 393 - - LINXY(__NR_statx, sys_statx), // 397 -+ GENX_(__NR_rseq, sys_ni_syscall), // 398 - - LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403 - LINX_(__NR_clock_settime64, sys_clock_settime64), // 404 -diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c -index b87107727..2066a38ea 100644 ---- a/coregrind/m_syswrap/syswrap-arm64-linux.c -+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c -@@ -823,8 +823,9 @@ static SyscallTableEntry syscall_main_table[] = { - // (__NR_pkey_mprotect, sys_ni_syscall), // 288 - // (__NR_pkey_alloc, sys_ni_syscall), // 289 - // (__NR_pkey_free, sys_ni_syscall), // 290 -+ LINXY(__NR_statx, sys_statx), // 291 - -- LINXY(__NR_statx, sys_statx), // 397 -+ GENX_(__NR_rseq, sys_ni_syscall), // 293 - - LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 - LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 -diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c -index 6263ab845..637b2504e 100644 ---- a/coregrind/m_syswrap/syswrap-ppc32-linux.c -+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c -@@ -1028,6 +1028,8 @@ static SyscallTableEntry syscall_table[] = { - - LINXY(__NR_statx, sys_statx), // 383 - -+ GENX_(__NR_rseq, sys_ni_syscall), // 387 -+ - LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403 - LINX_(__NR_clock_settime64, sys_clock_settime64), // 404 - -diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c -index a26b41c32..93956d3cc 100644 ---- a/coregrind/m_syswrap/syswrap-ppc64-linux.c -+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c -@@ -1019,6 +1019,8 @@ static SyscallTableEntry syscall_table[] = { - - LINXY(__NR_statx, sys_statx), // 383 - -+ GENX_(__NR_rseq, sys_ni_syscall), // 387 -+ - LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 - LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 - LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 -diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c -index 5c9209859..73f9684c4 100644 ---- a/coregrind/m_syswrap/syswrap-s390x-linux.c -+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c -@@ -860,6 +860,8 @@ static SyscallTableEntry syscall_table[] = { - - LINXY(__NR_statx, sys_statx), // 379 - -+ GENX_(__NR_rseq, sys_ni_syscall), // 381 -+ - LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 - LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 - LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 -diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c -index 1d8f45d33..8662ff501 100644 ---- a/coregrind/m_syswrap/syswrap-x86-linux.c -+++ b/coregrind/m_syswrap/syswrap-x86-linux.c -@@ -1619,6 +1619,8 @@ static SyscallTableEntry syscall_table[] = { - /* Explicitly not supported on i386 yet. */ - GENX_(__NR_arch_prctl, sys_ni_syscall), // 384 - -+ GENX_(__NR_rseq, sys_ni_syscall), // 386 -+ - LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403 - LINX_(__NR_clock_settime64, sys_clock_settime64), // 404 - -diff --git a/include/vki/vki-scnums-arm-linux.h b/include/vki/vki-scnums-arm-linux.h -index ff560e19d..485db8b26 100644 ---- a/include/vki/vki-scnums-arm-linux.h -+++ b/include/vki/vki-scnums-arm-linux.h -@@ -432,6 +432,7 @@ - #define __NR_pkey_alloc 395 - #define __NR_pkey_free 396 - #define __NR_statx 397 -+#define __NR_rseq 398 - - - -diff --git a/include/vki/vki-scnums-arm64-linux.h b/include/vki/vki-scnums-arm64-linux.h -index 9aa3b2b5f..acdfb39c6 100644 ---- a/include/vki/vki-scnums-arm64-linux.h -+++ b/include/vki/vki-scnums-arm64-linux.h -@@ -323,9 +323,11 @@ - #define __NR_pkey_alloc 289 - #define __NR_pkey_free 290 - #define __NR_statx 291 -+#define __NR_io_pgetevents 291 -+#define __NR_rseq 293 - - #undef __NR_syscalls --#define __NR_syscalls 292 -+#define __NR_syscalls 294 - - ///* - // * All syscalls below here should go away really, -diff --git a/include/vki/vki-scnums-ppc32-linux.h b/include/vki/vki-scnums-ppc32-linux.h -index 6987ad941..08fa77df0 100644 ---- a/include/vki/vki-scnums-ppc32-linux.h -+++ b/include/vki/vki-scnums-ppc32-linux.h -@@ -415,6 +415,7 @@ - #define __NR_pkey_alloc 384 - #define __NR_pkey_free 385 - #define __NR_pkey_mprotect 386 -+#define __NR_rseq 387 - - #endif /* __VKI_SCNUMS_PPC32_LINUX_H */ - -diff --git a/include/vki/vki-scnums-ppc64-linux.h b/include/vki/vki-scnums-ppc64-linux.h -index 6827964fd..a76fa6d32 100644 ---- a/include/vki/vki-scnums-ppc64-linux.h -+++ b/include/vki/vki-scnums-ppc64-linux.h -@@ -407,6 +407,7 @@ - #define __NR_pkey_alloc 384 - #define __NR_pkey_free 385 - #define __NR_pkey_mprotect 386 -+#define __NR_rseq 387 - - #endif /* __VKI_SCNUMS_PPC64_LINUX_H */ - -diff --git a/include/vki/vki-scnums-s390x-linux.h b/include/vki/vki-scnums-s390x-linux.h -index 6487e20c9..869c04584 100644 ---- a/include/vki/vki-scnums-s390x-linux.h -+++ b/include/vki/vki-scnums-s390x-linux.h -@@ -342,8 +342,11 @@ - #define __NR_s390_guarded_storage 378 - #define __NR_statx 379 - #define __NR_s390_sthyi 380 -+#define __NR_kexec_file_load 381 -+#define __NR_io_pgetevents 382 -+#define __NR_rseq 383 - --#define NR_syscalls 381 -+#define NR_syscalls 384 - - /* - * There are some system calls that are not present on 64 bit, some --- -2.30.2 - diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch b/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch deleted file mode 100644 index 8f771ed0bd..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 568224da7e647d00abf14a7160997689d9745c89 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 10 Jun 2017 00:39:07 -0700 -Subject: [PATCH] str_tester.c: Limit rawmemchr() test to glibc - -rawmemchr() is a GNU extention therefore mark it so - -Signed-off-by: Khem Raj -Upstream-Status: Pending ---- - memcheck/tests/str_tester.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/memcheck/tests/str_tester.c b/memcheck/tests/str_tester.c -index 7c2ff1e..8b82ced 100644 ---- a/memcheck/tests/str_tester.c -+++ b/memcheck/tests/str_tester.c -@@ -504,7 +504,7 @@ test_strchrnul (void) - #endif - - // DDD: better done by testing for the function. --#if !defined(__APPLE__) && !defined(__sun) && !defined(__FreeBSD__) -+#if !defined(__APPLE__) && !defined(__sun) && !defined(__FreeBSD__) && defined(__GLIBC__) - static void - test_rawmemchr (void) - { -@@ -1451,7 +1451,7 @@ main (void) - test_strchrnul (); - # endif - --# if !defined(__APPLE__) && !defined(__sun) && !defined(__FreeBSD__) -+# if !defined(__APPLE__) && !defined(__sun) && !defined(__FreeBSD__) && defined(__GLIBC__) - /* rawmemchr. */ - test_rawmemchr (); - # endif diff --git a/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch b/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch deleted file mode 100644 index 9a25b67961..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 59e3190e9121c5439d54298b083b44c5c3794a7f Mon Sep 17 00:00:00 2001 -From: Randy MacLeod -Date: Tue, 16 Oct 2018 21:01:04 -0400 -Subject: [PATCH] Fix out of tree builds. - -The paths to these files need to be fully specified in -the out of tree build case. glibc-2.X.supp is a generated file so the -full path -is deliberately not specified in that case. - -RP 2013/03/23 - -Patch refreshed for valgrind-3.14.0. - -Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=445211] - -Signed-off-by: Alexander Kanavin -Signed-off-by: Randy MacLeod - ---- - configure.ac | 62 ++++++++++++++++++++++++++-------------------------- - 1 file changed, 31 insertions(+), 31 deletions(-) - -diff --git a/configure.ac b/configure.ac -index b851798..d360896 100755 ---- a/configure.ac -+++ b/configure.ac -@@ -447,50 +447,50 @@ case "${host_os}" in - 9.*) - AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version]) -- DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}" - ;; - 10.*) - AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version]) -- DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" - ;; - 11.*) - AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version]) -- DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" - ;; - 12.*) - AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version]) -- DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" - ;; - 13.*) - AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version]) -- DEFAULT_SUPP="darwin13.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" - ;; - 14.*) - AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version]) -- DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" - ;; - 15.*) - AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version]) -- DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" - ;; - 16.*) - AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version]) -- DEFAULT_SUPP="darwin16.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin16.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" - ;; - 17.*) - AC_MSG_RESULT([Darwin 17.x (${kernel}) / macOS 10.13 High Sierra]) -@@ -515,7 +515,7 @@ case "${host_os}" in - DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}" - ;; - *) -- DEFAULT_SUPP="solaris11.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/solaris11.supp ${DEFAULT_SUPP}" - ;; - esac - ;; -@@ -523,7 +523,7 @@ case "${host_os}" in - solaris2.12*) - AC_MSG_RESULT([ok (${host_os})]) - VGCONF_OS="solaris" -- DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}" - ;; - - *) -@@ -1237,15 +1237,15 @@ AC_MSG_CHECKING([the glibc version]) - case "${GLIBC_VERSION}" in - 2.2) - AC_MSG_RESULT(${GLIBC_VERSION} family) -- DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; - 2.[[3-6]]) - AC_MSG_RESULT(${GLIBC_VERSION} family) -- DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.X-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; - 2.[[7-9]]) - AC_MSG_RESULT(${GLIBC_VERSION} family) -@@ -1258,8 +1258,8 @@ case "${GLIBC_VERSION}" in - AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1, - [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)]) - DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.X-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; - 2.*) - AC_MSG_RESULT(${GLIBC_VERSION} family) -@@ -1268,8 +1268,8 @@ case "${GLIBC_VERSION}" in - AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1, - [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)]) - DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.X-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; - darwin) - AC_MSG_RESULT(Darwin) -@@ -1284,7 +1284,7 @@ case "${GLIBC_VERSION}" in - bionic) - AC_MSG_RESULT(Bionic) - AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic]) -- DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}" - ;; - solaris) - AC_MSG_RESULT(Solaris) -@@ -1313,8 +1313,8 @@ if test "$VGCONF_OS" != "solaris"; then - # attempt to detect whether such libraries are installed on the - # build machine (or even if any X facilities are present); just - # add the suppressions antidisirregardless. -- DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}" -- DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}" - fi - - diff --git a/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch b/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch deleted file mode 100644 index 02241781d9..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch +++ /dev/null @@ -1,28 +0,0 @@ -From ace5fe19b3f13039d5d6bd5d99d54c20ea79e09c Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 10 Jun 2017 01:07:59 -0700 -Subject: [PATCH] tc20_verifywrap.c: Fake __GLIBC_PREREQ with musl - -similar to sun - -Upstream-Status: Pending - -Signed-off-by: Khem Raj - ---- - helgrind/tests/tc20_verifywrap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/helgrind/tests/tc20_verifywrap.c b/helgrind/tests/tc20_verifywrap.c -index ae97bde..db2eb70 100644 ---- a/helgrind/tests/tc20_verifywrap.c -+++ b/helgrind/tests/tc20_verifywrap.c -@@ -20,7 +20,7 @@ - - #if !defined(__APPLE__) && !defined(__FreeBSD__) - --#if defined(__sun__) -+#if defined(__sun__) || (defined(__linux__) && !defined(__GLIBC__)) - /* Fake __GLIBC_PREREQ on Solaris. Pretend glibc >= 2.4. */ - # define __GLIBC_PREREQ - #else diff --git a/meta/recipes-devtools/valgrind/valgrind_3.18.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.18.1.bb deleted file mode 100644 index 0c297ad6b9..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind_3.18.1.bb +++ /dev/null @@ -1,255 +0,0 @@ -SUMMARY = "Valgrind memory debugger and instrumentation framework" -HOMEPAGE = "http://valgrind.org/" -DESCRIPTION = "Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail." -BUGTRACKER = "http://valgrind.org/support/bug_reports.html" -LICENSE = "GPL-2.0-only & GPL-2.0-or-later & BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://include/pub_tool_basics.h;beginline=6;endline=29;md5=41c410e8d3f305aee7aaa666b2e4f366 \ - file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \ - file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56" - -DEPENDS = " \ - ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} \ - " - -SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \ - file://fixed-perl-path.patch \ - file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \ - file://run-ptest \ - file://remove-for-aarch64 \ - file://remove-for-all \ - file://taskset_nondeterministic_tests \ - file://0004-Fix-out-of-tree-builds.patch \ - file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \ - file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \ - file://avoid-neon-for-targets-which-don-t-support-it.patch \ - file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \ - file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \ - file://0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch \ - file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \ - file://0002-context-APIs-are-not-available-on-musl.patch \ - file://0003-correct-include-directive-path-for-config.h.patch \ - file://0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch \ - file://0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch \ - file://0002-memcheck-x86-Define-__THROW-if-not-defined.patch \ - file://0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch \ - file://0001-fix-opcode-not-supported-on-mips32-linux.patch \ - file://0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch \ - file://0001-Make-local-functions-static-to-avoid-assembler-error.patch \ - file://0001-Return-a-valid-exit_code-from-vg_regtest.patch \ - file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \ - file://0001-memcheck-vgtests-remove-fullpath-after-flags.patch \ - file://s390x_vec_op_t.patch \ - file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ - file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \ - file://0001-Implement-linux-rseq-syscall-as-ENOSYS.patch \ - file://0001-docs-Disable-manual-validation.patch \ - " -SRC_URI[sha256sum] = "00859aa13a772eddf7822225f4b46ee0d39afbe071d32778da4d99984081f7f5" -UPSTREAM_CHECK_REGEX = "valgrind-(?P\d+(\.\d+)+)\.tar" - -COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux' - -# patch 0001-memcheck-vgtests-remove-fullpath-after-flags.patch removes relative path -# argument. Change expected stderr files accordingly. -do_patch:append() { - bb.build.exec_func('do_sed_paths', d) -} - -do_sed_paths() { - sed -i -e 's|tests/||' ${S}/memcheck/tests/badfree3.stderr.exp - sed -i -e 's|tests/||' ${S}/memcheck/tests/varinfo5.stderr.exp -} - -# valgrind supports armv7 and above -COMPATIBLE_HOST:armv4 = 'null' -COMPATIBLE_HOST:armv5 = 'null' -COMPATIBLE_HOST:armv6 = 'null' - -# valgrind fails with powerpc soft-float -COMPATIBLE_HOST:powerpc = "${@bb.utils.contains('TARGET_FPU', 'soft', 'null', '.*-linux', d)}" - -# X32 isn't supported by valgrind at this time -COMPATIBLE_HOST:linux-gnux32 = 'null' -COMPATIBLE_HOST:linux-muslx32 = 'null' - -# Disable for some MIPS variants -COMPATIBLE_HOST:mipsarchr6 = 'null' -COMPATIBLE_HOST:linux-gnun32 = 'null' - -# Disable for powerpc64 with musl -COMPATIBLE_HOST:libc-musl:powerpc64 = 'null' - -# brokenseip is unfortunately required by ptests to pass -inherit autotools-brokensep ptest multilib_header - -EXTRA_OECONF = "--enable-tls --without-mpicc" -EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}" - -# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option -EXTRA_OECONF:append:arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}" - -EXTRA_OEMAKE = "-w" - -CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" - -# valgrind likes to control its own optimisation flags. It generally defaults -# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags -# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it -# which fixes build path issue in DWARF. -SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}" - -do_configure:prepend () { - rm -rf ${S}/config.h - sed -i -e 's:$(abs_top_builddir):$(pkglibdir)/ptest:g' ${S}/none/tests/Makefile.am - sed -i -e 's:$(top_builddir):$(pkglibdir)/ptest:g' ${S}/memcheck/tests/Makefile.am -} - -do_install:append () { - install -m 644 ${B}/default.supp ${D}/${libexecdir}/valgrind/ - oe_multilib_header valgrind/config.h -} - -VALGRINDARCH ?= "${TARGET_ARCH}" -VALGRINDARCH:aarch64 = "arm64" -VALGRINDARCH:x86-64 = "amd64" -VALGRINDARCH:x86 = "x86" -VALGRINDARCH:mips = "mips32" -VALGRINDARCH:mipsel = "mips32" -VALGRINDARCH:mips64el = "mips64" -VALGRINDARCH:powerpc = "ppc" -VALGRINDARCH:powerpc64 = "ppc64" -VALGRINDARCH:powerpc64le = "ppc64le" - -INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libexecdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so" - -RDEPENDS:${PN} += "perl" - -# valgrind needs debug information for ld.so at runtime in order to -# redirect functions like strlen. -RRECOMMENDS:${PN} += "${TCLIBC}-dbg" - -RDEPENDS:${PN}-ptest += " bash coreutils curl file \ - gdb libgomp \ - perl \ - perl-module-file-basename perl-module-file-glob perl-module-getopt-long \ - perl-module-overloading perl-module-cwd perl-module-ipc-open3 \ - perl-module-carp perl-module-symbol \ - procps sed ${PN}-dbg ${PN}-src ${TCLIBC}-src gcc-runtime-dbg \ - util-linux-taskset" -RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" - -# One of the tests contains a bogus interpreter path on purpose. -# Skip file dependency check -SKIP_FILEDEPS:${PN}-ptest = '1' -INSANE_SKIP:${PN}-ptest = "debug-deps" - -do_compile_ptest() { - oe_runmake check -} - -do_install_ptest() { - chmod +x ${B}/tests/vg_regtest - - # The test application binaries are not automatically installed. - # Grab them from the build directory. - # - # The regression tests require scripts and data files that are not - # copied to the build directory. They must be copied from the - # source directory. - saved_dir=$PWD - for parent_dir in ${S} ${B} ; do - cd $parent_dir - - subdirs=" \ - .in_place \ - cachegrind/tests \ - callgrind/tests \ - dhat/tests \ - drd/tests \ - gdbserver_tests \ - helgrind/tests \ - lackey/tests \ - massif/tests \ - memcheck/tests \ - none/tests \ - tests \ - exp-bbv/tests \ - " - # Get the vg test scripts, filters, and expected files - for dir in $subdirs ; do - find $dir | cpio -pvdu ${D}${PTEST_PATH} - done - cd $saved_dir - done - - # The scripts reference config.h so add it to the top ptest dir. - cp ${B}/config.h ${D}${PTEST_PATH} - install -D ${WORKDIR}/remove-for-aarch64 ${D}${PTEST_PATH} - install -D ${WORKDIR}/remove-for-all ${D}${PTEST_PATH} - install -D ${WORKDIR}/taskset_nondeterministic_tests ${D}${PTEST_PATH} - - # Add an executable need by none/tests/bigcode - mkdir ${D}${PTEST_PATH}/perf - cp ${B}/perf/bigcode ${D}${PTEST_PATH}/perf - - # Add an executable needed by memcheck/tests/vcpu_bz2 - cp ${B}/perf/bz2 ${D}${PTEST_PATH}/perf - - # Make the ptest dir look like the top level valgrind src dir - # This is checked by the gdbserver_tests/make_local_links script - mkdir ${D}${PTEST_PATH}/coregrind - cp ${B}/coregrind/vgdb ${D}${PTEST_PATH}/coregrind - - # Add an executable needed by massif tests - cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print - - find ${D}${PTEST_PATH} \ - \( \ - -name "Makefile*" \ - -o -name "*.o" \ - \) \ - -exec rm {} \; - - # These files need to be newer so touch them. - touch ${D}${PTEST_PATH}/cachegrind/tests/a.c -r ${D}${PTEST_PATH}/cachegrind/tests/cgout-test - - # find *_annotate in ${bindir} for yocto build - sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann1.vgtest - sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann2.vgtest - - sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest - sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest - - # point the expanded @abs_top_builddir@ of the host to PTEST_PATH - sed -i s:${S}:${PTEST_PATH}:g \ - ${D}${PTEST_PATH}/memcheck/tests/linux/debuginfod-check.vgtest - - # handle multilib - sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest - sed -i s:@libexecdir@:${libexecdir}:g ${D}${PTEST_PATH}/run-ptest - sed -i s:@bindir@:${bindir}:g ${D}${PTEST_PATH}/run-ptest - - # This test fails on the host as well, using both 3.15 and git master (as of Jan 24 2020) - # https://bugs.kde.org/show_bug.cgi?id=402833 - rm ${D}${PTEST_PATH}/memcheck/tests/overlap.vgtest - - # This is known failure see https://bugs.kde.org/show_bug.cgi?id=435732 - rm ${D}${PTEST_PATH}/memcheck/tests/leak_cpp_interior.vgtest - - # As the binary isn't stripped or debug-splitted, the source file isn't fetched - # via dwarfsrcfiles either, so it needs to be installed manually. - mkdir -p ${D}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/${BP}/none/tests/ - install ${S}/none/tests/tls.c ${D}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/${BP}/none/tests/ -} - -# avoid stripping some generated binaries otherwise some of the tests will fail -# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail -INHIBIT_PACKAGE_STRIP_FILES += "\ - ${PKGD}${PTEST_PATH}/none/tests/tls \ - ${PKGD}${PTEST_PATH}/none/tests/tls.so \ - ${PKGD}${PTEST_PATH}/none/tests/tls2.so \ - ${PKGD}${PTEST_PATH}/helgrind/tests/tc09_bad_unlock \ - ${PKGD}${PTEST_PATH}/memcheck/tests/manuel1 \ - ${PKGD}${PTEST_PATH}/drd/tests/pth_detached3 \ -" diff --git a/meta/recipes-devtools/valgrind/valgrind_3.19.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.19.0.bb new file mode 100644 index 0000000000..6e3234be6b --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind_3.19.0.bb @@ -0,0 +1,255 @@ +SUMMARY = "Valgrind memory debugger and instrumentation framework" +HOMEPAGE = "http://valgrind.org/" +DESCRIPTION = "Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail." +BUGTRACKER = "http://valgrind.org/support/bug_reports.html" +LICENSE = "GPL-2.0-only & GPL-2.0-or-later & BSD-3-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://include/pub_tool_basics.h;beginline=6;endline=29;md5=41c410e8d3f305aee7aaa666b2e4f366 \ + file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \ + file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56" + +DEPENDS = " \ + ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} \ + " + +SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \ + file://fixed-perl-path.patch \ + file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \ + file://run-ptest \ + file://remove-for-aarch64 \ + file://remove-for-all \ + file://taskset_nondeterministic_tests \ + file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \ + file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \ + file://avoid-neon-for-targets-which-don-t-support-it.patch \ + file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \ + file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \ + file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \ + file://0002-context-APIs-are-not-available-on-musl.patch \ + file://0003-correct-include-directive-path-for-config.h.patch \ + file://0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch \ + file://0002-memcheck-x86-Define-__THROW-if-not-defined.patch \ + file://0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch \ + file://0001-fix-opcode-not-supported-on-mips32-linux.patch \ + file://0001-Make-local-functions-static-to-avoid-assembler-error.patch \ + file://0001-Return-a-valid-exit_code-from-vg_regtest.patch \ + file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \ + file://0001-memcheck-vgtests-remove-fullpath-after-flags.patch \ + file://s390x_vec_op_t.patch \ + file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ + file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \ + file://0001-docs-Disable-manual-validation.patch \ + file://0001-Fix-drd-tests-shared_timed_mutex.cpp.patch \ + " +SRC_URI[sha256sum] = "dd5e34486f1a483ff7be7300cc16b4d6b24690987877c3278d797534d6738f02" +UPSTREAM_CHECK_REGEX = "valgrind-(?P\d+(\.\d+)+)\.tar" + +COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux' + +# patch 0001-memcheck-vgtests-remove-fullpath-after-flags.patch removes relative path +# argument. Change expected stderr files accordingly. +do_patch:append() { + bb.build.exec_func('do_sed_paths', d) +} + +do_sed_paths() { + sed -i -e 's|tests/||' ${S}/memcheck/tests/badfree3.stderr.exp + sed -i -e 's|tests/||' ${S}/memcheck/tests/varinfo5.stderr.exp +} + +# valgrind supports armv7 and above +COMPATIBLE_HOST:armv4 = 'null' +COMPATIBLE_HOST:armv5 = 'null' +COMPATIBLE_HOST:armv6 = 'null' + +# valgrind fails with powerpc soft-float +COMPATIBLE_HOST:powerpc = "${@bb.utils.contains('TARGET_FPU', 'soft', 'null', '.*-linux', d)}" + +# X32 isn't supported by valgrind at this time +COMPATIBLE_HOST:linux-gnux32 = 'null' +COMPATIBLE_HOST:linux-muslx32 = 'null' + +# Disable for some MIPS variants +COMPATIBLE_HOST:mipsarchr6 = 'null' +COMPATIBLE_HOST:linux-gnun32 = 'null' + +# Disable for powerpc64 with musl +COMPATIBLE_HOST:libc-musl:powerpc64 = 'null' + +# brokenseip is unfortunately required by ptests to pass +inherit autotools-brokensep ptest multilib_header + +EXTRA_OECONF = "--enable-tls --without-mpicc" +EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}" + +# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option +EXTRA_OECONF:append:arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}" + +EXTRA_OEMAKE = "-w" + +CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" + +# valgrind likes to control its own optimisation flags. It generally defaults +# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags +# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it +# which fixes build path issue in DWARF. +SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}" + +do_configure:prepend () { + rm -rf ${S}/config.h + sed -i -e 's:$(abs_top_builddir):$(pkglibdir)/ptest:g' ${S}/none/tests/Makefile.am + sed -i -e 's:$(top_builddir):$(pkglibdir)/ptest:g' ${S}/memcheck/tests/Makefile.am +} + +do_install:append () { + install -m 644 ${B}/default.supp ${D}/${libexecdir}/valgrind/ + oe_multilib_header valgrind/config.h +} + +VALGRINDARCH ?= "${TARGET_ARCH}" +VALGRINDARCH:aarch64 = "arm64" +VALGRINDARCH:x86-64 = "amd64" +VALGRINDARCH:x86 = "x86" +VALGRINDARCH:mips = "mips32" +VALGRINDARCH:mipsel = "mips32" +VALGRINDARCH:mips64el = "mips64" +VALGRINDARCH:powerpc = "ppc" +VALGRINDARCH:powerpc64 = "ppc64" +VALGRINDARCH:powerpc64le = "ppc64le" + +INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libexecdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so" + +RDEPENDS:${PN} += "perl" + +# valgrind needs debug information for ld.so at runtime in order to +# redirect functions like strlen. +RRECOMMENDS:${PN} += "${TCLIBC}-dbg" + +RDEPENDS:${PN}-ptest += " bash coreutils curl file \ + gdb libgomp \ + perl \ + perl-module-file-basename perl-module-file-glob perl-module-getopt-long \ + perl-module-overloading perl-module-cwd perl-module-ipc-open3 \ + perl-module-carp perl-module-symbol \ + procps sed ${PN}-dbg ${PN}-src ${TCLIBC}-src gcc-runtime-dbg \ + util-linux-taskset" +RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" + +# One of the tests contains a bogus interpreter path on purpose. +# Skip file dependency check +SKIP_FILEDEPS:${PN}-ptest = '1' +INSANE_SKIP:${PN}-ptest = "debug-deps" + +do_compile_ptest() { + oe_runmake ${PARALLEL_MAKE} check +} + + +do_install_ptest() { + chmod +x ${B}/tests/vg_regtest + + # The test application binaries are not automatically installed. + # Grab them from the build directory. + # + # The regression tests require scripts and data files that are not + # copied to the build directory. They must be copied from the + # source directory. + saved_dir=$PWD + for parent_dir in ${S} ${B} ; do + cd $parent_dir + + subdirs=" \ + .in_place \ + cachegrind/tests \ + callgrind/tests \ + dhat/tests \ + drd/tests \ + gdbserver_tests \ + helgrind/tests \ + lackey/tests \ + massif/tests \ + memcheck/tests \ + none/tests \ + tests \ + exp-bbv/tests \ + " + # Get the vg test scripts, filters, and expected files + for dir in $subdirs ; do + find $dir | cpio -pvdu ${D}${PTEST_PATH} + done + cd $saved_dir + done + + # The scripts reference config.h so add it to the top ptest dir. + cp ${B}/config.h ${D}${PTEST_PATH} + install -D ${WORKDIR}/remove-for-aarch64 ${D}${PTEST_PATH} + install -D ${WORKDIR}/remove-for-all ${D}${PTEST_PATH} + install -D ${WORKDIR}/taskset_nondeterministic_tests ${D}${PTEST_PATH} + + # Add an executable need by none/tests/bigcode + mkdir ${D}${PTEST_PATH}/perf + cp ${B}/perf/bigcode ${D}${PTEST_PATH}/perf + + # Add an executable needed by memcheck/tests/vcpu_bz2 + cp ${B}/perf/bz2 ${D}${PTEST_PATH}/perf + + # Make the ptest dir look like the top level valgrind src dir + # This is checked by the gdbserver_tests/make_local_links script + mkdir ${D}${PTEST_PATH}/coregrind + cp ${B}/coregrind/vgdb ${D}${PTEST_PATH}/coregrind + + # Add an executable needed by massif tests + cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print + + find ${D}${PTEST_PATH} \ + \( \ + -name "Makefile*" \ + -o -name "*.o" \ + \) \ + -exec rm {} \; + + # These files need to be newer so touch them. + touch ${D}${PTEST_PATH}/cachegrind/tests/a.c -r ${D}${PTEST_PATH}/cachegrind/tests/cgout-test + + # find *_annotate in ${bindir} for yocto build + sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann1.vgtest + sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann2.vgtest + + sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest + sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest + + # point the expanded @abs_top_builddir@ of the host to PTEST_PATH + sed -i s:${S}:${PTEST_PATH}:g \ + ${D}${PTEST_PATH}/memcheck/tests/linux/debuginfod-check.vgtest + + # handle multilib + sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest + sed -i s:@libexecdir@:${libexecdir}:g ${D}${PTEST_PATH}/run-ptest + sed -i s:@bindir@:${bindir}:g ${D}${PTEST_PATH}/run-ptest + + # This test fails on the host as well, using both 3.15 and git master (as of Jan 24 2020) + # https://bugs.kde.org/show_bug.cgi?id=402833 + rm ${D}${PTEST_PATH}/memcheck/tests/overlap.vgtest + + # This is known failure see https://bugs.kde.org/show_bug.cgi?id=435732 + rm ${D}${PTEST_PATH}/memcheck/tests/leak_cpp_interior.vgtest + + # https://bugs.kde.org/show_bug.cgi?id=445743 + rm ${D}${PTEST_PATH}/drd/tests/pth_mutex_signal + + # As the binary isn't stripped or debug-splitted, the source file isn't fetched + # via dwarfsrcfiles either, so it needs to be installed manually. + mkdir -p ${D}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/${BP}/none/tests/ + install ${S}/none/tests/tls.c ${D}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/${BP}/none/tests/ +} + +# avoid stripping some generated binaries otherwise some of the tests will fail +# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail +INHIBIT_PACKAGE_STRIP_FILES += "\ + ${PKGD}${PTEST_PATH}/none/tests/tls \ + ${PKGD}${PTEST_PATH}/none/tests/tls.so \ + ${PKGD}${PTEST_PATH}/none/tests/tls2.so \ + ${PKGD}${PTEST_PATH}/helgrind/tests/tc09_bad_unlock \ + ${PKGD}${PTEST_PATH}/memcheck/tests/manuel1 \ + ${PKGD}${PTEST_PATH}/drd/tests/pth_detached3 \ +" -- cgit v1.2.3-54-g00ecf