bpftool: fix broken compile on s390 for linux-next repository
Subsystems (3)
PATCH 1/1 bpftool: fix broken compile on s390 for linux-next repository
Commit 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program") breaks the build of the perf tool on s390 in the linux-next repository.
Here is the make output:
make -C tools/perf
....btf_dumper.c: In function 'dotlabel_puts':
DEBUG: btf_dumper.c:838:25: error: '__fallthrough' undeclared \
(first use in this function); did you mean 'fallthrough'?
DEBUG: 838 | __fallthrough;
DEBUG: | ^~~~~~~~~~~~~
DEBUG: | fallthrough
DEBUG: btf_dumper.c:838:25: note: each undeclared identifier is reported \
only once for each function it appears in
DEBUG: btf_dumper.c:837:25: warning: this statement may fall through \
[-Wimplicit-fallthrough=]
DEBUG: 837 | putchar('\\');
DEBUG: | ^~~~~~~~~~~~~
DEBUG: btf_dumper.c:839:17: note: here
DEBUG: 839 | default:
DEBUG: | ^~~~~~~
DEBUG: make[3]: *** [Makefile:247: /builddir/build/BUILD/kernel-6.2.fc37/\
linux-6.2/tools/perf/util/bpf_skel/ \
.tmp/bootstrap/btf_dumper.o] Error 1The compile fails because symbol __fallthrough unknown, but symbol fallthrough is known and works fine.
Fix this and replace __fallthrough by fallthrough.
With this change, the compile works.
Output after:
# make -C tools/perf .... CC util/bpf-filter.o CC util/bpf-filter-flex.o LD util/perf-in.o LD perf-in.o LINK perf make: Leaving directory '/root/mirror-linux-next/tools/perf' #
--- tools/bpf/bpftool/btf_dumper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/btf_dumper.c +1 -1
@@ -835,7 +835,7 @@ static void dotlabel_puts(const char *s)case '|' :case ' ' :putchar ('\\' ); - __fallthrough; + fallthrough;default :putchar (*s); }
Signature · 1 line
2.39.2
2023-04-18 10:55 UTC+0200 ~ Thomas Richter <[email protected]>
Quoted 44 lines
Commit
9fd496848b1c("bpftool: Support inline annotations when dumping the CFG of a program") breaks the build of the perf tool on s390 in the linux-next repository.
Here is the make output:make -C
tools/perf
....btf_dumper.c: In function 'dotlabel_puts':
DEBUG: btf_dumper.c:838:25: error: '__fallthrough' undeclared \
(first use in this function); did you mean 'fallthrough'?DEBUG: 838 | __fallthrough; DEBUG: | ^~~~~~~~~~~~~ DEBUG: | fallthrough DEBUG: btf_dumper.c:838:25: note: each undeclared identifier is reported \ only once for each function it appears in DEBUG: btf_dumper.c:837:25: warning: this statement may fall through \ [-Wimplicit-fallthrough=] DEBUG: 837 | putchar('\\'); DEBUG: | ^~~~~~~~~~~~~ DEBUG: btf_dumper.c:839:17: note: here DEBUG: 839 | default: DEBUG: | ^~~~~~~ DEBUG: make[3]: *** [Makefile:247: /builddir/build/BUILD/kernel-6.2.fc37/\ linux-6.2/tools/perf/util/bpf_skel/ \ .tmp/bootstrap/btf_dumper.o] Error 1The compile fails because symbol
__fallthroughunknown, but symbol fallthrough is known and works fine.Fix this and replace
__fallthroughby fallthrough.With this change, the compile works.
Output after:
# make -C tools/perf .... CC util/bpf-filter.o CC util/bpf-filter-flex.o LD util/perf-in.o LD perf-in.o LINK perf make: Leaving directory '/root/mirror-linux-next/tools/perf' #
Quoted 2 lines
Fixes 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program")Signed-off-by Thomas Richter <[email protected]>
(Repost from
https://lore.kernel.org/all/[email protected])
Daniel Borkmann
maintainerQuoted 55 lines · Thomas Richter
Commit
9fd496848b1c("bpftool: Support inline annotations when dumping the CFG of a program") breaks the build of the perf tool on s390 in the linux-next repository.
Here is the make output:make -C
tools/perf
....btf_dumper.c: In function 'dotlabel_puts':
DEBUG: btf_dumper.c:838:25: error: '__fallthrough' undeclared \
(first use in this function); did you mean 'fallthrough'?DEBUG: 838 | __fallthrough; DEBUG: | ^~~~~~~~~~~~~ DEBUG: | fallthrough DEBUG: btf_dumper.c:838:25: note: each undeclared identifier is reported \ only once for each function it appears in DEBUG: btf_dumper.c:837:25: warning: this statement may fall through \ [-Wimplicit-fallthrough=] DEBUG: 837 | putchar('\\'); DEBUG: | ^~~~~~~~~~~~~ DEBUG: btf_dumper.c:839:17: note: here DEBUG: 839 | default: DEBUG: | ^~~~~~~ DEBUG: make[3]: *** [Makefile:247: /builddir/build/BUILD/kernel-6.2.fc37/\ linux-6.2/tools/perf/util/bpf_skel/ \ .tmp/bootstrap/btf_dumper.o] Error 1The compile fails because symbol
__fallthroughunknown, but symbol fallthrough is known and works fine.Fix this and replace
__fallthroughby fallthrough.With this change, the compile works.
Output after:
# make -C tools/perf .... CC util/bpf-filter.o CC util/bpf-filter-flex.o LD util/perf-in.o LD perf-in.o LINK perf make: Leaving directory '/root/mirror-linux-next/tools/perf' #Fixes 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program")Signed-off-by Thomas Richter <[email protected]>--- tools/bpf/bpftool/btf_dumper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/bpf/bpftool/btf_dumper.c +0
-0
tools/bpf/bpftool/btf_dumper.c static void dotlabel_puts(const char *s) · line 838
Quoted 5 lines
tools/bpf/bpftool/btf_dumper.c +1
-1@@ -835,7 +835,7 @@ static void dotlabel_puts(const char *s)case '|' :case ' ' :putchar ('\\' ); - __fallthrough; + fallthrough;
The problem is however for current bpf-next, where this change breaks CI:
https://github.com/kernel-patches/bpf/actions/runs/4737651765/jobs/8410684531
[...]
CC /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/bpftool/feature.o
CC /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/bpftool/disasm.o
btf_dumper.c:838:4: error: use of undeclared identifier 'fallthrough'
fallthrough;
^ 1 error generated.
[...]
I would suggest as a clean path that'll work for both to just change from fallthrough; into /* fallthrough */ as done in objtool, then we can also work around BPF CI issue and merge this change in time.
Quoted 4 lines
tools/bpf/bpftool/btf_dumper.c +0
-0default :putchar (*s); }
Quoted 19 lines · Daniel Borkmann
tools/bpf/bpftool/btf_dumper.c static void dotlabel_puts(const char *s) · line 838
Quoted 2 lines · Thomas Richter
tools/bpf/bpftool/btf_dumper.c +1
-1- __fallthrough; + fallthrough;The problem is however for current bpf-next, where this change breaks CI:
https://github.com/kernel-patches/bpf/actions/runs/4737651765/jobs/8410684531
[...] CC /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/bpftool/feature.o CC /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/bpftool/disasm.o btf_dumper.c:838:4: error: use of undeclared identifier 'fallthrough' fallthrough; ^ 1 error generated. [...]
Quoted 9 lines
I would suggest as a clean path that'll work for both to just change from fallthrough; into /* fallthrough */ as done in objtool, then we can also work around BPF CI issue and merge this change in time.
Quoted 4 lines
default: putchar(*s); }
Thanks Daniel for pointing this out. I just submitted the patch you suggested:
https://lore.kernel.org/bpf/[email protected]/
Quentin