valgrind: update to 3.21.0
[openwrt/staging/mans0n.git] / package / devel / valgrind / patches / 010-mips-Fix-new-syscall-numbers.patch
1 From 82e935c564699456a766044faa39367b47cce793 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 31 Oct 2021 23:11:11 +0100
4 Subject: [PATCH] mips: Fix new syscall numbers
5
6 The MIPS32 and MIPS64 O32 ABI are adding 4000 to all syscall numbers.
7 The MIPS64 N64 ABI adds 5000 to each syscall and the MIPS64 N32 ABI adds
8 6000 to each syscall number. We can not use the shared file for MIPS and
9 have to define this for each sycall separately.
10
11 Without this change valgrind is not able to detect new syscalls like
12 clock_gettime64 correctly.
13
14 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
15 ---
16 include/pub_tool_vkiscnums_asm.h | 3 --
17 include/vki/vki-scnums-mips32-linux.h | 40 +++++++++++++++++++++++++++
18 include/vki/vki-scnums-mips64-linux.h | 40 +++++++++++++++++++++++++++
19 3 files changed, 80 insertions(+), 3 deletions(-)
20
21 --- a/include/pub_tool_vkiscnums_asm.h
22 +++ b/include/pub_tool_vkiscnums_asm.h
23 @@ -63,15 +63,12 @@
24 # include "vki/vki-scnums-arm64-linux.h"
25
26 #elif defined(VGP_mips32_linux)
27 -# include "vki/vki-scnums-shared-linux.h"
28 -# include "vki/vki-scnums-32bit-linux.h"
29 # include "vki/vki-scnums-mips32-linux.h"
30
31 #elif defined(VGP_nanomips_linux)
32 # include "vki/vki-scnums-nanomips-linux.h"
33
34 #elif defined(VGP_mips64_linux)
35 -# include "vki/vki-scnums-shared-linux.h"
36 # include "vki/vki-scnums-mips64-linux.h"
37
38 #elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd)
39 --- a/include/vki/vki-scnums-mips32-linux.h
40 +++ b/include/vki/vki-scnums-mips32-linux.h
41 @@ -401,6 +401,46 @@
42 #define __NR_pkey_free (__NR_Linux + 365)
43 #define __NR_statx (__NR_Linux + 366)
44
45 +#define __NR_clock_gettime64 (__NR_Linux + 403)
46 +#define __NR_clock_settime64 (__NR_Linux + 404)
47 +#define __NR_clock_adjtime64 (__NR_Linux + 405)
48 +#define __NR_clock_getres_time64 (__NR_Linux + 406)
49 +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
50 +#define __NR_timer_gettime64 (__NR_Linux + 408)
51 +#define __NR_timer_settime64 (__NR_Linux + 409)
52 +#define __NR_timerfd_gettime64 (__NR_Linux + 410)
53 +#define __NR_timerfd_settime64 (__NR_Linux + 411)
54 +#define __NR_utimensat_time64 (__NR_Linux + 412)
55 +#define __NR_pselect6_time64 (__NR_Linux + 413)
56 +#define __NR_ppoll_time64 (__NR_Linux + 414)
57 +#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
58 +#define __NR_recvmmsg_time64 (__NR_Linux + 417)
59 +#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
60 +#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
61 +#define __NR_semtimedop_time64 (__NR_Linux + 420)
62 +#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
63 +#define __NR_futex_time64 (__NR_Linux + 422)
64 +#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
65 +#define __NR_pidfd_send_signal (__NR_Linux + 424)
66 +#define __NR_io_uring_setup (__NR_Linux + 425)
67 +#define __NR_io_uring_enter (__NR_Linux + 426)
68 +#define __NR_io_uring_register (__NR_Linux + 427)
69 +#define __NR_open_tree (__NR_Linux + 428)
70 +#define __NR_move_mount (__NR_Linux + 429)
71 +#define __NR_fsopen (__NR_Linux + 430)
72 +#define __NR_fsconfig (__NR_Linux + 431)
73 +#define __NR_fsmount (__NR_Linux + 432)
74 +#define __NR_fspick (__NR_Linux + 433)
75 +
76 +#define __NR_pidfd_open (__NR_Linux + 434)
77 +#define __NR_clone3 (__NR_Linux + 435)
78 +#define __NR_close_range (__NR_Linux + 436)
79 +#define __NR_openat2 (__NR_Linux + 437)
80 +
81 +#define __NR_faccessat2 (__NR_Linux + 439)
82 +
83 +#define __NR_epoll_pwait2 (__NR_Linux + 441)
84 +
85 /*
86 * Offset of the last Linux o32 flavoured syscall
87 */
88 --- a/include/vki/vki-scnums-mips64-linux.h
89 +++ b/include/vki/vki-scnums-mips64-linux.h
90 @@ -363,6 +363,26 @@
91 #define __NR_pkey_free (__NR_Linux + 325)
92 #define __NR_statx (__NR_Linux + 326)
93
94 +#define __NR_pidfd_send_signal (__NR_Linux + 424)
95 +#define __NR_io_uring_setup (__NR_Linux + 425)
96 +#define __NR_io_uring_enter (__NR_Linux + 426)
97 +#define __NR_io_uring_register (__NR_Linux + 427)
98 +#define __NR_open_tree (__NR_Linux + 428)
99 +#define __NR_move_mount (__NR_Linux + 429)
100 +#define __NR_fsopen (__NR_Linux + 430)
101 +#define __NR_fsconfig (__NR_Linux + 431)
102 +#define __NR_fsmount (__NR_Linux + 432)
103 +#define __NR_fspick (__NR_Linux + 433)
104 +
105 +#define __NR_pidfd_open (__NR_Linux + 434)
106 +#define __NR_clone3 (__NR_Linux + 435)
107 +#define __NR_close_range (__NR_Linux + 436)
108 +#define __NR_openat2 (__NR_Linux + 437)
109 +
110 +#define __NR_faccessat2 (__NR_Linux + 439)
111 +
112 +#define __NR_epoll_pwait2 (__NR_Linux + 441)
113 +
114 #elif defined(VGABI_N32)
115
116 /*
117 @@ -702,6 +722,26 @@
118 #define __NR_pkey_free (__NR_Linux + 329)
119 #define __NR_statx (__NR_Linux + 330)
120
121 +#define __NR_pidfd_send_signal (__NR_Linux + 424)
122 +#define __NR_io_uring_setup (__NR_Linux + 425)
123 +#define __NR_io_uring_enter (__NR_Linux + 426)
124 +#define __NR_io_uring_register (__NR_Linux + 427)
125 +#define __NR_open_tree (__NR_Linux + 428)
126 +#define __NR_move_mount (__NR_Linux + 429)
127 +#define __NR_fsopen (__NR_Linux + 430)
128 +#define __NR_fsconfig (__NR_Linux + 431)
129 +#define __NR_fsmount (__NR_Linux + 432)
130 +#define __NR_fspick (__NR_Linux + 433)
131 +
132 +#define __NR_pidfd_open (__NR_Linux + 434)
133 +#define __NR_clone3 (__NR_Linux + 435)
134 +#define __NR_close_range (__NR_Linux + 436)
135 +#define __NR_openat2 (__NR_Linux + 437)
136 +
137 +#define __NR_faccessat2 (__NR_Linux + 439)
138 +
139 +#define __NR_epoll_pwait2 (__NR_Linux + 441)
140 +
141 #else
142 #error unknown mips64 abi
143 #endif