diff options
| author | Khem Raj <raj.khem@gmail.com> | 2020-03-09 18:15:43 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-11 11:44:28 +0000 |
| commit | 11702842f98b454d20f32ae166eb8a27ebd288ce (patch) | |
| tree | e3f8a8edb181465aaa5f026937e04570f384a174 /meta | |
| parent | 9faf676068c80cf7d269b096ef9cb9d3da7e2a89 (diff) | |
| download | poky-11702842f98b454d20f32ae166eb8a27ebd288ce.tar.gz | |
valgrind: Fix timerfd syscall test to be 64bit time_t safe
This helps compile the testcase with musl on 32bit arches
(From OE-Core rev: ac5a65cb5fdb315df2cb016d0cc5c3389c7971f0)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch | 98 | ||||
| -rw-r--r-- | meta/recipes-devtools/valgrind/valgrind_3.15.0.bb | 1 |
2 files changed, 99 insertions, 0 deletions
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch new file mode 100644 index 0000000000..15fbbe954f --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | From 5d411fd147d652e9d7bb259f4048693c6e4742aa Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 9 Mar 2020 16:30:19 -0700 | ||
| 4 | Subject: [PATCH] memcheck/tests: Fix timerfd syscall test | ||
| 5 | |||
| 6 | modern libc provides these functions, moreover this also ensures that we | ||
| 7 | are 64bit time_t safe. Fallback to existing definitions if libc does not | ||
| 8 | have the implementation or syscall is not defined | ||
| 9 | |||
| 10 | Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36943897/] | ||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | --- | ||
| 13 | config.h.in | 9 +++++++++ | ||
| 14 | configure.ac | 3 +++ | ||
| 15 | memcheck/tests/linux/timerfd-syscall.c | 10 ++++++++-- | ||
| 16 | 5 files changed, 32 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | --- a/config.h.in | ||
| 19 | +++ b/config.h.in | ||
| 20 | @@ -301,6 +301,9 @@ | ||
| 21 | /* Define to 1 if you have the <sys/sysnvl.h> header file. */ | ||
| 22 | #undef HAVE_SYS_SYSNVL_H | ||
| 23 | |||
| 24 | +/* Define to 1 if you have the <sys/timerfd.h> header file. */ | ||
| 25 | +#undef HAVE_SYS_TIMERFD_H | ||
| 26 | + | ||
| 27 | /* Define to 1 if you have the <sys/time.h> header file. */ | ||
| 28 | #undef HAVE_SYS_TIME_H | ||
| 29 | |||
| 30 | --- a/configure.ac | ||
| 31 | +++ b/configure.ac | ||
| 32 | @@ -4098,6 +4098,7 @@ AC_CHECK_HEADERS([ \ | ||
| 33 | sys/syscall.h \ | ||
| 34 | sys/sysnvl.h \ | ||
| 35 | sys/time.h \ | ||
| 36 | + sys/timerfd.h \ | ||
| 37 | sys/types.h \ | ||
| 38 | ]) | ||
| 39 | |||
| 40 | --- a/memcheck/tests/linux/timerfd-syscall.c | ||
| 41 | +++ b/memcheck/tests/linux/timerfd-syscall.c | ||
| 42 | @@ -45,6 +45,9 @@ | ||
| 43 | #if defined(HAVE_SYS_TIME_H) | ||
| 44 | #include <sys/time.h> | ||
| 45 | #endif | ||
| 46 | +#if defined(HAVE_SYS_TIMERFD_H) | ||
| 47 | +#include <sys/timerfd.h> | ||
| 48 | +#endif | ||
| 49 | #if defined(HAVE_SYS_TYPES_H) | ||
| 50 | #include <sys/types.h> | ||
| 51 | #endif | ||
| 52 | @@ -54,7 +57,8 @@ | ||
| 53 | * timerfd_* system call numbers introduced in 2.6.23. These constants are | ||
| 54 | * not yet in the glibc 2.7 headers, that is why they are defined here. | ||
| 55 | */ | ||
| 56 | -#ifndef __NR_timerfd_create | ||
| 57 | +#if !defined(HAVE_SYS_TIMERFD_H) | ||
| 58 | +#if !defined(__NR_timerfd_create) | ||
| 59 | #if defined(__x86_64__) | ||
| 60 | #define __NR_timerfd_create 283 | ||
| 61 | #elif defined(__i386__) | ||
| 62 | @@ -67,8 +71,10 @@ | ||
| 63 | #error Cannot detect your architecture! | ||
| 64 | #endif | ||
| 65 | #endif | ||
| 66 | +#endif | ||
| 67 | |||
| 68 | -#ifndef __NR_timerfd_settime | ||
| 69 | +#if !defined(HAVE_SYS_TIMERFD_H) | ||
| 70 | +#if !defined(__NR_timerfd_settime) | ||
| 71 | #if defined(__x86_64__) | ||
| 72 | #define __NR_timerfd_settime 286 | ||
| 73 | #define __NR_timerfd_gettime 287 | ||
| 74 | @@ -85,7 +91,7 @@ | ||
| 75 | #error Cannot detect your architecture! | ||
| 76 | #endif | ||
| 77 | #endif | ||
| 78 | - | ||
| 79 | +#endif | ||
| 80 | |||
| 81 | |||
| 82 | /* Definitions from include/linux/timerfd.h */ | ||
| 83 | @@ -127,6 +133,7 @@ void set_timespec(struct timespec *tmr, | ||
| 84 | tmr->tv_nsec = (long) (1000ULL * (ustime % 1000000ULL)); | ||
| 85 | } | ||
| 86 | |||
| 87 | +#if !defined(HAVE_SYS_TIMERFD_H) | ||
| 88 | int timerfd_create(int clockid, int flags) | ||
| 89 | { | ||
| 90 | return syscall(__NR_timerfd_create, clockid, flags); | ||
| 91 | @@ -142,6 +149,7 @@ int timerfd_gettime(int ufc, struct itim | ||
| 92 | { | ||
| 93 | return syscall(__NR_timerfd_gettime, ufc, otmr); | ||
| 94 | } | ||
| 95 | +#endif | ||
| 96 | |||
| 97 | long waittmr(int tfd, int timeo) | ||
| 98 | { | ||
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb index 1475ff841e..7954437a1a 100644 --- a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb +++ b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb | |||
| @@ -41,6 +41,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \ | |||
| 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 | file://0001-tests-Make-pthread_detatch-call-portable-across-plat.patch \ |
| 44 | file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \ | ||
| 44 | " | 45 | " |
| 45 | SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975" | 46 | SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975" |
| 46 | SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1" | 47 | SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1" |
