1 From 598ada195606eb0e577db0487dd59a2536f206ce Mon Sep 17 00:00:00 2001
2 From: Andres Freund <andres@anarazel.de>
3 Date: Sun, 31 Jul 2022 18:38:27 -0700
4 Subject: [PATCH 1/5] tools build: Add feature test for init_disassemble_info
7 binutils changed the signature of init_disassemble_info(), which now causes
8 compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
10 Relevant binutils commit:
12 https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
14 This commit adds a feature test to detect the new signature. Subsequent
15 commits will use it to fix the build failures.
17 Signed-off-by: Andres Freund <andres@anarazel.de>
18 Acked-by: Quentin Monnet <quentin@isovalent.com>
19 Cc: Alexei Starovoitov <ast@kernel.org>
20 Cc: Ben Hutchings <benh@debian.org>
21 Cc: Jiri Olsa <jolsa@kernel.org>
22 Cc: Quentin Monnet <quentin@isovalent.com>
23 Cc: Sedat Dilek <sedat.dilek@gmail.com>
24 Cc: bpf@vger.kernel.org
25 Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
26 Link: https://lore.kernel.org/r/20220801013834.156015-2-andres@anarazel.de
27 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
28 (cherry picked from commit cfd59ca91467056bb2c36907b2fa67b8e1af9952)
30 tools/build/Makefile.feature | 1 +
31 tools/build/feature/Makefile | 4 ++++
32 tools/build/feature/test-all.c | 4 ++++
33 tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
34 4 files changed, 22 insertions(+)
35 create mode 100644 tools/build/feature/test-disassembler-init-styled.c
37 --- a/tools/build/Makefile.feature
38 +++ b/tools/build/Makefile.feature
39 @@ -69,6 +69,7 @@ FEATURE_TESTS_BASIC :=
42 disassembler-four-args \
43 + disassembler-init-styled \
46 # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
47 --- a/tools/build/feature/Makefile
48 +++ b/tools/build/feature/Makefile
49 @@ -18,6 +18,7 @@ FILES=
51 test-libbfd-buildid.bin \
52 test-disassembler-four-args.bin \
53 + test-disassembler-init-styled.bin \
54 test-reallocarray.bin \
55 test-libbfd-liberty.bin \
56 test-libbfd-liberty-z.bin \
57 @@ -239,6 +240,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
58 $(OUTPUT)test-disassembler-four-args.bin:
59 $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
61 +$(OUTPUT)test-disassembler-init-styled.bin:
62 + $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
64 $(OUTPUT)test-reallocarray.bin:
67 --- a/tools/build/feature/test-all.c
68 +++ b/tools/build/feature/test-all.c
70 # include "test-disassembler-four-args.c"
73 +#define main main_test_disassembler_init_styled
74 +# include "test-disassembler-init-styled.c"
77 #define main main_test_libzstd
78 # include "test-libzstd.c"
81 +++ b/tools/build/feature/test-disassembler-init-styled.c
83 +// SPDX-License-Identifier: GPL-2.0
89 + struct disassemble_info info;
91 + init_disassemble_info(&info, stdout,