diff options
| author | Ryan Eatmon <reatmon@ti.com> | 2022-11-27 19:24:17 -0600 |
|---|---|---|
| committer | Ryan Eatmon <reatmon@ti.com> | 2022-11-27 19:24:17 -0600 |
| commit | d083ee992fe3c3762907c9f52d300dea85bd62ae (patch) | |
| tree | 25ebc6864de0f3ce8e1b74a2afab29ef2bf8bb0c /meta-ti-bsp | |
| parent | a072e9d0fb8941302d9bb0d6cec39f122e6233dd (diff) | |
| download | meta-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')
4 files changed, 328 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-5.10/init_disassemble_info-signature-changes-causes-compile-failures.patch b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-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-5.10/init_disassemble_info-signature-changes-causes-compile-failures.patch | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | |||
| 2 | Adaption of a patch [A] applied to meta-arm for the kernel. But since TI has it's own | ||
| 3 | kernel 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 | |||
| 7 | Signed-off-by: Ryan Eatmon <reatmon@ti.com> | ||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | From 1b2013986271de39360cf79e62ed9b7d2cc59f9b Mon Sep 17 00:00:00 2001 | ||
| 12 | From: Andres Freund <andres@anarazel.de> | ||
| 13 | Date: Wed, 22 Jun 2022 11:19:18 -0700 | ||
| 14 | Subject: [PATCH] init_disassemble_info() signature changes causes compile | ||
| 15 | failures | ||
| 16 | MIME-Version: 1.0 | ||
| 17 | Content-Type: text/plain; charset=UTF-8 | ||
| 18 | Content-Transfer-Encoding: 8bit | ||
| 19 | |||
| 20 | Hi, | ||
| 21 | |||
| 22 | binutils changed the signature of init_disassemble_info(), which now causes | ||
| 23 | perf and bpftool to fail to compile (e.g. on debian unstable). | ||
| 24 | |||
| 25 | Relevant binutils commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=60a3da00bd5407f07d64dff82a4dae98230dfaac | ||
| 26 | |||
| 27 | util/annotate.c: In function ?symbol__disassemble_bpf?: | ||
| 28 | util/annotate.c:1765:9: error: too few arguments to function ?init_disassemble_info? | ||
| 29 | 1765 | init_disassemble_info(&info, s, | ||
| 30 | | ^~~~~~~~~~~~~~~~~~~~~ | ||
| 31 | In 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 | |||
| 36 | with equivalent failures in | ||
| 37 | |||
| 38 | tools/bpf/bpf_jit_disasm.c | ||
| 39 | tools/bpf/bpftool/jit_disasm.c | ||
| 40 | |||
| 41 | The fix is easy enough, add a wrapper around fprintf() that conforms to the | ||
| 42 | new signature. | ||
| 43 | |||
| 44 | However I assume the necessary feature test and wrapper should only be added | ||
| 45 | once? I don't know the kernel stuff well enough to choose the right structure | ||
| 46 | here. | ||
| 47 | |||
| 48 | Attached is my local fix for perf. Obviously would need work to be a real | ||
| 49 | solution. | ||
| 50 | |||
| 51 | Greetings, | ||
| 52 | |||
| 53 | Andres Freund | ||
| 54 | --- | ||
| 55 | |||
| 56 | binutils 2.39 changed the signature of init_disassemble_info(), | ||
| 57 | which now causes perf and bpftool to fail to compile. | ||
| 58 | |||
| 59 | Relevant binutils commit: [1] | ||
| 60 | |||
| 61 | There is a proper fix in development upstream[2]. | ||
| 62 | This 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 | |||
| 67 | Upstream-Status: Pending | ||
| 68 | Signed-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 | |||
| 74 | diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c | ||
| 75 | index 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 | -- | ||
| 108 | 2.17.1 | ||
| 109 | |||
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-rt-5.10/init_disassemble_info-signature-changes-causes-compile-failures.patch b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-rt-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-rt-5.10/init_disassemble_info-signature-changes-causes-compile-failures.patch | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | |||
| 2 | Adaption of a patch [A] applied to meta-arm for the kernel. But since TI has it's own | ||
| 3 | kernel 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 | |||
| 7 | Signed-off-by: Ryan Eatmon <reatmon@ti.com> | ||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | From 1b2013986271de39360cf79e62ed9b7d2cc59f9b Mon Sep 17 00:00:00 2001 | ||
| 12 | From: Andres Freund <andres@anarazel.de> | ||
| 13 | Date: Wed, 22 Jun 2022 11:19:18 -0700 | ||
| 14 | Subject: [PATCH] init_disassemble_info() signature changes causes compile | ||
| 15 | failures | ||
| 16 | MIME-Version: 1.0 | ||
| 17 | Content-Type: text/plain; charset=UTF-8 | ||
| 18 | Content-Transfer-Encoding: 8bit | ||
| 19 | |||
| 20 | Hi, | ||
| 21 | |||
| 22 | binutils changed the signature of init_disassemble_info(), which now causes | ||
| 23 | perf and bpftool to fail to compile (e.g. on debian unstable). | ||
| 24 | |||
| 25 | Relevant binutils commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=60a3da00bd5407f07d64dff82a4dae98230dfaac | ||
| 26 | |||
| 27 | util/annotate.c: In function ?symbol__disassemble_bpf?: | ||
| 28 | util/annotate.c:1765:9: error: too few arguments to function ?init_disassemble_info? | ||
| 29 | 1765 | init_disassemble_info(&info, s, | ||
| 30 | | ^~~~~~~~~~~~~~~~~~~~~ | ||
| 31 | In 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 | |||
| 36 | with equivalent failures in | ||
| 37 | |||
| 38 | tools/bpf/bpf_jit_disasm.c | ||
| 39 | tools/bpf/bpftool/jit_disasm.c | ||
| 40 | |||
| 41 | The fix is easy enough, add a wrapper around fprintf() that conforms to the | ||
| 42 | new signature. | ||
| 43 | |||
| 44 | However I assume the necessary feature test and wrapper should only be added | ||
| 45 | once? I don't know the kernel stuff well enough to choose the right structure | ||
| 46 | here. | ||
| 47 | |||
| 48 | Attached is my local fix for perf. Obviously would need work to be a real | ||
| 49 | solution. | ||
| 50 | |||
| 51 | Greetings, | ||
| 52 | |||
| 53 | Andres Freund | ||
| 54 | --- | ||
| 55 | |||
| 56 | binutils 2.39 changed the signature of init_disassemble_info(), | ||
| 57 | which now causes perf and bpftool to fail to compile. | ||
| 58 | |||
| 59 | Relevant binutils commit: [1] | ||
| 60 | |||
| 61 | There is a proper fix in development upstream[2]. | ||
| 62 | This 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 | |||
| 67 | Upstream-Status: Pending | ||
| 68 | Signed-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 | |||
| 74 | diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c | ||
| 75 | index 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 | -- | ||
| 108 | 2.17.1 | ||
| 109 | |||
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 | |||
| 2 | Adaption of a patch [A] applied to meta-arm for the kernel. But since TI has it's own | ||
| 3 | kernel 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 | |||
| 7 | Signed-off-by: Ryan Eatmon <reatmon@ti.com> | ||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | From 1b2013986271de39360cf79e62ed9b7d2cc59f9b Mon Sep 17 00:00:00 2001 | ||
| 12 | From: Andres Freund <andres@anarazel.de> | ||
| 13 | Date: Wed, 22 Jun 2022 11:19:18 -0700 | ||
| 14 | Subject: [PATCH] init_disassemble_info() signature changes causes compile | ||
| 15 | failures | ||
| 16 | MIME-Version: 1.0 | ||
| 17 | Content-Type: text/plain; charset=UTF-8 | ||
| 18 | Content-Transfer-Encoding: 8bit | ||
| 19 | |||
| 20 | Hi, | ||
| 21 | |||
| 22 | binutils changed the signature of init_disassemble_info(), which now causes | ||
| 23 | perf and bpftool to fail to compile (e.g. on debian unstable). | ||
| 24 | |||
| 25 | Relevant binutils commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=60a3da00bd5407f07d64dff82a4dae98230dfaac | ||
| 26 | |||
| 27 | util/annotate.c: In function ?symbol__disassemble_bpf?: | ||
| 28 | util/annotate.c:1765:9: error: too few arguments to function ?init_disassemble_info? | ||
| 29 | 1765 | init_disassemble_info(&info, s, | ||
| 30 | | ^~~~~~~~~~~~~~~~~~~~~ | ||
| 31 | In 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 | |||
| 36 | with equivalent failures in | ||
| 37 | |||
| 38 | tools/bpf/bpf_jit_disasm.c | ||
| 39 | tools/bpf/bpftool/jit_disasm.c | ||
| 40 | |||
| 41 | The fix is easy enough, add a wrapper around fprintf() that conforms to the | ||
| 42 | new signature. | ||
| 43 | |||
| 44 | However I assume the necessary feature test and wrapper should only be added | ||
| 45 | once? I don't know the kernel stuff well enough to choose the right structure | ||
| 46 | here. | ||
| 47 | |||
| 48 | Attached is my local fix for perf. Obviously would need work to be a real | ||
| 49 | solution. | ||
| 50 | |||
| 51 | Greetings, | ||
| 52 | |||
| 53 | Andres Freund | ||
| 54 | --- | ||
| 55 | |||
| 56 | binutils 2.39 changed the signature of init_disassemble_info(), | ||
| 57 | which now causes perf and bpftool to fail to compile. | ||
| 58 | |||
| 59 | Relevant binutils commit: [1] | ||
| 60 | |||
| 61 | There is a proper fix in development upstream[2]. | ||
| 62 | This 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 | |||
| 67 | Upstream-Status: Pending | ||
| 68 | Signed-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 | |||
| 74 | diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c | ||
| 75 | index 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 | -- | ||
| 108 | 2.17.1 | ||
| 109 | |||
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_5.10.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_5.10.bb index bf230dbc..462d26f1 100644 --- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_5.10.bb +++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_5.10.bb | |||
| @@ -33,6 +33,7 @@ PR = "${MACHINE_KERNEL_PR}" | |||
| 33 | KERNEL_GIT_URI = "git://git.ti.com/git/ti-linux-kernel/ti-linux-kernel.git" | 33 | KERNEL_GIT_URI = "git://git.ti.com/git/ti-linux-kernel/ti-linux-kernel.git" |
| 34 | KERNEL_GIT_PROTOCOL = "https" | 34 | KERNEL_GIT_PROTOCOL = "https" |
| 35 | SRC_URI += "${KERNEL_GIT_URI};protocol=${KERNEL_GIT_PROTOCOL};branch=${BRANCH} \ | 35 | SRC_URI += "${KERNEL_GIT_URI};protocol=${KERNEL_GIT_PROTOCOL};branch=${BRANCH} \ |
| 36 | file://init_disassemble_info-signature-changes-causes-compile-failures.patch \ | ||
| 36 | file://defconfig" | 37 | file://defconfig" |
| 37 | 38 | ||
| 38 | FILES:${KERNEL_PACKAGE_NAME}-devicetree += "/${KERNEL_IMAGEDEST}/*.itb" | 39 | FILES:${KERNEL_PACKAGE_NAME}-devicetree += "/${KERNEL_IMAGEDEST}/*.itb" |
