summaryrefslogtreecommitdiffstats
path: root/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-systest-5.10
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2022-11-27 19:24:17 -0600
committerRyan Eatmon <reatmon@ti.com>2022-11-27 19:24:17 -0600
commitd083ee992fe3c3762907c9f52d300dea85bd62ae (patch)
tree25ebc6864de0f3ce8e1b74a2afab29ef2bf8bb0c /meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-systest-5.10
parenta072e9d0fb8941302d9bb0d6cec39f122e6233dd (diff)
downloadmeta-ti-d083ee992fe3c3762907c9f52d300dea85bd62ae.tar.gz
linux-ti-staging: work around for too few arguments to function init_disassemble_info() error
binutils 2.39 changed the signature of init_disassemble_info(), which now causes perf and bpftool to fail to compile. Relevant binutils commit: [1] There is a proper fix in development upstream[2]. This is a work-around for older kernels. Inspired by a patch by Anton Antonov to fix this issue on meta-arm kernels. [3] [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=60a3da00bd5407f07d64dff82a4dae98230dfaac [2] https://patchwork.kernel.org/project/netdevbpf/cover/20220801013834.156015-1-andres@anarazel.de/ [3] https://patchwork.yoctoproject.org/project/arm/patch/20220824025819.4888-1-jon.mason@arm.com/#5104 Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-systest-5.10')
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-systest-5.10/init_disassemble_info-signature-changes-causes-compile-failures.patch109
1 files changed, 109 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-systest-5.10/init_disassemble_info-signature-changes-causes-compile-failures.patch b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-systest-5.10/init_disassemble_info-signature-changes-causes-compile-failures.patch
new file mode 100644
index 00000000..a8054125
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-systest-5.10/init_disassemble_info-signature-changes-causes-compile-failures.patch
@@ -0,0 +1,109 @@
1
2Adaption of a patch [A] applied to meta-arm for the kernel. But since TI has it's own
3kernel we have to "adjust" the patch to match our files.
4
5[A] https://patchwork.yoctoproject.org/project/arm/patch/20220824025819.4888-1-jon.mason@arm.com/#5104
6
7Signed-off-by: Ryan Eatmon <reatmon@ti.com>
8
9
10
11From 1b2013986271de39360cf79e62ed9b7d2cc59f9b Mon Sep 17 00:00:00 2001
12From: Andres Freund <andres@anarazel.de>
13Date: Wed, 22 Jun 2022 11:19:18 -0700
14Subject: [PATCH] init_disassemble_info() signature changes causes compile
15 failures
16MIME-Version: 1.0
17Content-Type: text/plain; charset=UTF-8
18Content-Transfer-Encoding: 8bit
19
20Hi,
21
22binutils changed the signature of init_disassemble_info(), which now causes
23perf and bpftool to fail to compile (e.g. on debian unstable).
24
25Relevant binutils commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=60a3da00bd5407f07d64dff82a4dae98230dfaac
26
27util/annotate.c: In function ?symbol__disassemble_bpf?:
28util/annotate.c:1765:9: error: too few arguments to function ?init_disassemble_info?
29 1765 | init_disassemble_info(&info, s,
30 | ^~~~~~~~~~~~~~~~~~~~~
31In file included from util/annotate.c:1718:
32/usr/include/dis-asm.h:472:13: note: declared here
33 472 | extern void init_disassemble_info (struct disassemble_info *dinfo, void *stream,
34 | ^~~~~~~~~~~~~~~~~~~~~
35
36with equivalent failures in
37
38tools/bpf/bpf_jit_disasm.c
39tools/bpf/bpftool/jit_disasm.c
40
41The fix is easy enough, add a wrapper around fprintf() that conforms to the
42new signature.
43
44However I assume the necessary feature test and wrapper should only be added
45once? I don't know the kernel stuff well enough to choose the right structure
46here.
47
48Attached is my local fix for perf. Obviously would need work to be a real
49solution.
50
51Greetings,
52
53Andres Freund
54---
55
56binutils 2.39 changed the signature of init_disassemble_info(),
57which now causes perf and bpftool to fail to compile.
58
59Relevant binutils commit: [1]
60
61There is a proper fix in development upstream[2].
62This is a work-around for older kernels.
63
64[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=60a3da00bd5407f07d64dff82a4dae98230dfaac
65[2] https://patchwork.kernel.org/project/netdevbpf/cover/20220801013834.156015-1-andres@anarazel.de/
66
67Upstream-Status: Pending
68Signed-off-by: Anton Antonov <Anton.Antonov@arm.com>
69
70
71 tools/perf/util/annotate.c | 15 ++++++++++++++-
72 1 file changed, 14 insertions(+), 1 deletion(-)
73
74diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
75index 308189454788..6573d2b07548 100644
76--- a/tools/perf/util/annotate.c
77+++ b/tools/perf/util/annotate.c
78@@ -1685,6 +1685,18 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
79 #include <bfd.h>
80 #include <dis-asm.h>
81
82+static int fprintf_styled(void *, enum disassembler_style, const char* fmt, ...)
83+{
84+ va_list args;
85+ int r;
86+
87+ va_start(args, fmt);
88+ r = vprintf(fmt, args);
89+ va_end(args);
90+
91+ return r;
92+}
93+
94 static int symbol__disassemble_bpf(struct symbol *sym,
95 struct annotate_args *args)
96 {
97@@ -1727,7 +1739,8 @@ static int symbol__disassemble_bpf(struct symbol *sym,
98 goto out;
99 }
100 init_disassemble_info(&info, s,
101- (fprintf_ftype) fprintf);
102+ (fprintf_ftype) fprintf,
103+ fprintf_styled);
104
105 info.arch = bfd_get_arch(bfdf);
106 info.mach = bfd_get_mach(bfdf);
107--
1082.17.1
109