On Sun, Jul 03, 2022 at 02:25:46PM -0700, Andres Freund wrote: > binutils changed the signature of init_disassemble_info(), which now causes > compilation failures for tools/{perf,bpf} on e.g. debian unstable. Relevant > binutils commit: > https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07 > > I first fixed this without introducing the compat header, as suggested by > Quentin, but I thought the amount of repeated boilerplate was a bit too > much. So instead I introduced a compat header to wrap the API changes. Even > tools/bpf/bpftool/jit_disasm.c, which needs its own callbacks for json, imo > looks nicer this way. > > I'm not regular contributor, so it very well might be my procedures are a > bit off... > > I am not sure I added the right [number of] people to CC? > > WRT the feature test: Not sure what the point of the -DPACKAGE='"perf"' is, > nor why tools/perf/Makefile.config sets some LDFLAGS/CFLAGS that are also > in feature/Makefile and why -ldl isn't needed in the other places. But... > > V2: > - split patches further, so that tools/bpf and tools/perf part are entirely > separate > - included a bit more information about tests I did in commit messages > - add a maybe_unused to fprintf_json_styled's style argument > > Cc: Alexei Starovoitov <ast@xxxxxxxxxx> > Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> > Cc: Jiri Olsa <jolsa@xxxxxxxxxx> > Cc: Sedat Dilek <sedat.dilek@xxxxxxxxx> > Cc: Quentin Monnet <quentin@xxxxxxxxxxxxx> > To: bpf@xxxxxxxxxxxxxxx > To: linux-kernel@xxxxxxxxxxxxxxx > Link: https://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@xxxxxxxxxxxxxxxxx > Link: https://lore.kernel.org/lkml/CA+icZUVpr8ZeOKCj4zMMqbFT013KJz2T1csvXg+VSkdvJH1Ubw@xxxxxxxxxxxxxx > > Andres Freund (5): > tools build: add feature test for init_disassemble_info API changes > tools include: add dis-asm-compat.h to handle version differences > tools perf: Fix compilation error with new binutils > tools bpf_jit_disasm: Fix compilation error with new binutils > tools bpftool: Fix compilation error with new binutils I think the disassembler checks should not be displayed by default, with your change I can see all the time: ... disassembler-four-args: [ on ] ... disassembler-init-styled: [ OFF ] could you please squash something like below in? moving disassembler checks out of sight and do manual detection thanks, jirka --- diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 339686b99a6e..bce9a9b52b2c 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -69,8 +69,6 @@ FEATURE_TESTS_BASIC := \ setns \ libaio \ libzstd \ - disassembler-four-args \ - disassembler-init-styled \ file-handle # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list @@ -106,7 +104,9 @@ FEATURE_TESTS_EXTRA := \ libbpf-bpf_create_map \ libpfm4 \ libdebuginfod \ - clang-bpf-co-re + clang-bpf-co-re \ + disassembler-four-args \ + disassembler-init-styled FEATURE_TESTS ?= $(FEATURE_TESTS_BASIC) @@ -135,9 +135,7 @@ FEATURE_DISPLAY ?= \ get_cpuid \ bpf \ libaio \ - libzstd \ - disassembler-four-args \ - disassembler-init-styled + libzstd # Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features. # If in the future we need per-feature checks/flags for features not diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index ee417c321adb..2aa0bad11f05 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -914,8 +914,6 @@ ifndef NO_LIBBFD FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl endif endif - $(call feature_check,disassembler-four-args) - $(call feature_check,disassembler-init-styled) endif ifeq ($(feature-libbfd-buildid), 1) @@ -1025,6 +1023,9 @@ ifdef HAVE_KVM_STAT_SUPPORT CFLAGS += -DHAVE_KVM_STAT_SUPPORT endif +$(call feature_check,disassembler-four-args) +$(call feature_check,disassembler-init-styled) + ifeq ($(feature-disassembler-four-args), 1) CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE endif