Skip to content

Commit 1eb832a

Browse files
tohojoborkmann
authored andcommitted
tools/bpf: build: Make sure resolve_btfids cleans up after itself
The new resolve_btfids tool did not clean up the feature detection folder on 'make clean', and also was not called properly from the clean rule in tools/make/ folder on its 'make clean'. This lead to stale objects being left around, which could cause feature detection to fail on subsequent builds. Fixes: fbbb68d ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object") Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Jiri Olsa <jolsa@redhat.com> Link: https://lore.kernel.org/bpf/20200901144343.179552-1-toke@redhat.com
1 parent 3168c15 commit 1eb832a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎tools/bpf/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ FEATURE_TESTS = libbfd disassembler-four-args
3838
FEATURE_DISPLAY = libbfd disassembler-four-args
3939

4040
check_feat := 1
41-
NON_CHECK_FEAT_TARGETS := clean bpftool_clean runqslower_clean
41+
NON_CHECK_FEAT_TARGETS := clean bpftool_clean runqslower_clean resolve_btfids_clean
4242
ifdef MAKECMDGOALS
4343
ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
4444
check_feat := 0
@@ -89,7 +89,7 @@ $(OUTPUT)bpf_exp.lex.c: $(OUTPUT)bpf_exp.yacc.c
8989
$(OUTPUT)bpf_exp.yacc.o: $(OUTPUT)bpf_exp.yacc.c
9090
$(OUTPUT)bpf_exp.lex.o: $(OUTPUT)bpf_exp.lex.c
9191

92-
clean: bpftool_clean runqslower_clean
92+
clean: bpftool_clean runqslower_clean resolve_btfids_clean
9393
$(call QUIET_CLEAN, bpf-progs)
9494
$(Q)$(RM) -r -- $(OUTPUT)*.o $(OUTPUT)bpf_jit_disasm $(OUTPUT)bpf_dbg \
9595
$(OUTPUT)bpf_asm $(OUTPUT)bpf_exp.yacc.* $(OUTPUT)bpf_exp.lex.*

‎tools/bpf/resolve_btfids/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ libbpf-clean:
8080
clean: libsubcmd-clean libbpf-clean fixdep-clean
8181
$(call msg,CLEAN,$(BINARY))
8282
$(Q)$(RM) -f $(BINARY); \
83+
$(RM) -rf $(if $(OUTPUT),$(OUTPUT),.)/feature; \
8384
find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
8485

8586
tags:

0 commit comments

Comments
 (0)