Message ID | 20200623103710.10370-1-tklauser@distanz.ch |
---|---|
State | Accepted |
Delegated to: | BPF Maintainers |
Headers | show |
Series | [bpf-next] tools, bpftool: Correctly evaluate $(BUILD_BPF_SKELS) in Makefile | expand |
2020-06-23 12:37 UTC+0200 ~ Tobias Klauser <tklauser@distanz.ch> > Currently, if the clang-bpf-co-re feature is not available, the build > fails with e.g. > > CC prog.o > prog.c:1462:10: fatal error: profiler.skel.h: No such file or directory > 1462 | #include "profiler.skel.h" > | ^~~~~~~~~~~~~~~~~ > > This is due to the fact that the BPFTOOL_WITHOUT_SKELETONS macro is not > defined, despite BUILD_BPF_SKELS not being set. Fix this by correctly > evaluating $(BUILD_BPF_SKELS) when deciding on whether to add > -DBPFTOOL_WITHOUT_SKELETONS to CFLAGS. > > Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h") > Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Reviewed-by: Quentin Monnet <quentin@isovalent.com> Thanks Tobias.
On Tue, Jun 23, 2020 at 3:37 AM Tobias Klauser <tklauser@distanz.ch> wrote: > > Currently, if the clang-bpf-co-re feature is not available, the build > fails with e.g. > > CC prog.o > prog.c:1462:10: fatal error: profiler.skel.h: No such file or directory > 1462 | #include "profiler.skel.h" > | ^~~~~~~~~~~~~~~~~ > > This is due to the fact that the BPFTOOL_WITHOUT_SKELETONS macro is not > defined, despite BUILD_BPF_SKELS not being set. Fix this by correctly > evaluating $(BUILD_BPF_SKELS) when deciding on whether to add > -DBPFTOOL_WITHOUT_SKELETONS to CFLAGS. > > Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h") > Signed-off-by: Tobias Klauser <tklauser@distanz.ch> > --- > tools/bpf/bpftool/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile > index 06f436e8191a..8c6563e56ffc 100644 > --- a/tools/bpf/bpftool/Makefile > +++ b/tools/bpf/bpftool/Makefile > @@ -155,7 +155,7 @@ $(OUTPUT)pids.o: $(OUTPUT)pid_iter.skel.h > endif > endif > > -CFLAGS += $(if BUILD_BPF_SKELS,,-DBPFTOOL_WITHOUT_SKELETONS) > +CFLAGS += $(if $(BUILD_BPF_SKELS),,-DBPFTOOL_WITHOUT_SKELETONS) Oh, what a rookie mistake :) Thanks for fixing! Acked-by: Andrii Nakryiko <andriin@fb.com> > > $(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c > $(QUIET_CC)$(CC) $(CFLAGS) -c -MMD -o $@ $< > -- > 2.27.0 >
On 6/23/20 12:37 PM, Tobias Klauser wrote: > Currently, if the clang-bpf-co-re feature is not available, the build > fails with e.g. > > CC prog.o > prog.c:1462:10: fatal error: profiler.skel.h: No such file or directory > 1462 | #include "profiler.skel.h" > | ^~~~~~~~~~~~~~~~~ > > This is due to the fact that the BPFTOOL_WITHOUT_SKELETONS macro is not > defined, despite BUILD_BPF_SKELS not being set. Fix this by correctly > evaluating $(BUILD_BPF_SKELS) when deciding on whether to add > -DBPFTOOL_WITHOUT_SKELETONS to CFLAGS. > > Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h") > Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Applied, thanks!
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 06f436e8191a..8c6563e56ffc 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -155,7 +155,7 @@ $(OUTPUT)pids.o: $(OUTPUT)pid_iter.skel.h endif endif -CFLAGS += $(if BUILD_BPF_SKELS,,-DBPFTOOL_WITHOUT_SKELETONS) +CFLAGS += $(if $(BUILD_BPF_SKELS),,-DBPFTOOL_WITHOUT_SKELETONS) $(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c $(QUIET_CC)$(CC) $(CFLAGS) -c -MMD -o $@ $<
Currently, if the clang-bpf-co-re feature is not available, the build fails with e.g. CC prog.o prog.c:1462:10: fatal error: profiler.skel.h: No such file or directory 1462 | #include "profiler.skel.h" | ^~~~~~~~~~~~~~~~~ This is due to the fact that the BPFTOOL_WITHOUT_SKELETONS macro is not defined, despite BUILD_BPF_SKELS not being set. Fix this by correctly evaluating $(BUILD_BPF_SKELS) when deciding on whether to add -DBPFTOOL_WITHOUT_SKELETONS to CFLAGS. Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h") Signed-off-by: Tobias Klauser <tklauser@distanz.ch> --- tools/bpf/bpftool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)