summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-Use-hardcodes-values-for-ABI-syscall-bases.patch50
-rw-r--r--meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch30
-rw-r--r--meta-oe/recipes-devtools/ltrace/ltrace_git.bb2
3 files changed, 51 insertions, 31 deletions
diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-Use-hardcodes-values-for-ABI-syscall-bases.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-Use-hardcodes-values-for-ABI-syscall-bases.patch
new file mode 100644
index 0000000000..f83e0a2738
--- /dev/null
+++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-Use-hardcodes-values-for-ABI-syscall-bases.patch
@@ -0,0 +1,50 @@
1From ed8dbe1c793f2f770fef61adc4390277f903cceb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 9 Jul 2021 01:32:42 -0700
4Subject: [PATCH] mips: Use hardcodes values for ABI syscall bases
5
6mips kernels 5.13+ have stopped exposing the UAPIs which provided these
7defines, the values are more or less static so just use the hardcoded
8values for now. Use __NR_syscalls to get number of syscalls supported
9and include asm-generic/unistd.h to get this definition
10
11Upstream-Status: Pending
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 sysdeps/linux-gnu/mips/trace.c | 13 +++++++------
15 1 file changed, 7 insertions(+), 6 deletions(-)
16
17diff --git a/sysdeps/linux-gnu/mips/trace.c b/sysdeps/linux-gnu/mips/trace.c
18index d54818e..e72184d 100644
19--- a/sysdeps/linux-gnu/mips/trace.c
20+++ b/sysdeps/linux-gnu/mips/trace.c
21@@ -33,6 +33,7 @@
22 #include <asm/unistd.h>
23 #include <assert.h>
24 #include <asm/unistd.h>
25+#include <asm-generic/unistd.h>
26
27 #include "backend.h"
28 #include "common.h"
29@@ -135,12 +136,12 @@ syscall_p(struct process *proc, int status, int *sysnum)
30 int min_syscall, max_syscall, sigreturn, rt_sigreturn;
31 struct callstack_element *top = NULL;
32 int depth = proc->callstack_depth;
33- const int syscallbase[] = {__NR_O32_Linux, __NR_N32_Linux,
34- __NR_64_Linux, __NR_O32_Linux};
35- const int syscallnum[] = {__NR_O32_Linux_syscalls,
36- __NR_N32_Linux_syscalls,
37- __NR_64_Linux_syscalls,
38- __NR_O32_Linux_syscalls};
39+ const int syscallbase[] = {4000, 6000,
40+ 5000, 4000};
41+ const int syscallnum[] = {__NR_syscalls,
42+ __NR_syscalls,
43+ __NR_syscalls,
44+ __NR_syscalls};
45 const int rt_sigreturn_list[] = {193, 211, 211, 193};
46 const int sigreturn_list[] = {119, -1, -1, 119};
47
48--
492.32.0
50
diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch b/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch
deleted file mode 100644
index e4490bbb9e..0000000000
--- a/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1kernel headers have restructured mips syscall generation in kernel
2in recent versions, however, ltrace still has logic to define the
3syscall numbers based on old logic, this patch includes the legacy
4UAPI headers to get these defines
5
6Fixes errors e.g.
7../../../../git/sysdeps/linux-gnu/mips/trace.c:138:29: error: '__NR_O32_Linux' undeclared (first use in this function)
8 const int syscallbase[] = {__NR_O32_Linux, __NR_N32_Linux,
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12--- a/sysdeps/linux-gnu/mips/trace.c
13+++ b/sysdeps/linux-gnu/mips/trace.c
14@@ -34,6 +34,16 @@
15 #include <assert.h>
16 #include <asm/unistd.h>
17
18+#ifndef __NR_O32_Linux
19+#include <asm/unistd_nr_o32.h>
20+#endif
21+#ifndef __NR_N32_Linux
22+#include <asm/unistd_nr_n64.h>
23+#endif
24+#ifndef __NR_N64_Linux
25+#include <asm/unistd_nr_n32.h>
26+#endif
27+
28 #include "backend.h"
29 #include "common.h"
30 #include "debug.h"
diff --git a/meta-oe/recipes-devtools/ltrace/ltrace_git.bb b/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
index b81093aa24..69dce851fa 100644
--- a/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
+++ b/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
@@ -26,10 +26,10 @@ SRC_URI = "git://github.com/sparkleholic/ltrace.git;branch=master;protocol=http
26 file://0001-mips-plt.c-Delete-include-error.h.patch \ 26 file://0001-mips-plt.c-Delete-include-error.h.patch \
27 file://0001-move-fprintf-into-same-block-where-modname-and-symna.patch \ 27 file://0001-move-fprintf-into-same-block-where-modname-and-symna.patch \
28 file://0001-hook-Do-not-append-int-to-std-string.patch \ 28 file://0001-hook-Do-not-append-int-to-std-string.patch \
29 file://include_unistd_nr.patch \
30 file://0001-Bug-fix-for-data-type-length-judgment.patch \ 29 file://0001-Bug-fix-for-data-type-length-judgment.patch \
31 file://0001-ensure-the-struct-pointers-are-null-initilized.patch \ 30 file://0001-ensure-the-struct-pointers-are-null-initilized.patch \
32 file://0001-ppc-Remove-unused-host_powerpc64-function.patch \ 31 file://0001-ppc-Remove-unused-host_powerpc64-function.patch \
32 file://0001-mips-Use-hardcodes-values-for-ABI-syscall-bases.patch \
33 " 33 "
34SRC_URI_append_libc-musl = " file://add_ppc64le.patch" 34SRC_URI_append_libc-musl = " file://add_ppc64le.patch"
35 35