Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf build: Add special fixdep cleaning rule

Ingo reported following build failure:

On Sat, Feb 11, 2017 at 12:12:34PM +0100, Ingo Molnar wrote:
>
> So I had this oldish 32-bit 15.10 Ubuntu installation around (fully updated), and
> trying to build perf gave me:
>
> deimos:~/tip/tools/perf> make
> BUILD: Doing 'make -j4' parallel build
> make[3]: *** No rule to make target '/usr/include/x86_64-linux-gnu/sys/types.h', needed by 'fixdep.o'. Stop.
> Makefile:42: recipe for target 'fixdep-in.o' failed
> make[2]: *** [fixdep-in.o] Error 2
> /home/mingo/tip/tools/build/Makefile.include:4: recipe for target 'fixdep' failed
> make[1]: *** [fixdep] Error 2
> Makefile:68: recipe for target 'all' failed
> make: *** [all] Error 2
>
> Now this got a bit better after I did a 'make mrproper' in the kernel tree:
>
> deimos:~/tip/tools/perf> make
> BUILD: Doing 'make -j4' parallel build
> HOSTCC fixdep.o
> /home/mingo/tip/tools/build/fixdep: 1: /home/mingo/tip/tools/build/fixdep: Syntax error: "(" unexpected
> /home/mingo/tip/tools/build/Makefile.build:101: recipe for target 'fixdep.o' failed
> make[3]: *** [fixdep.o] Error 2
> Makefile:42: recipe for target 'fixdep-in.o' failed
> make[2]: *** [fixdep-in.o] Error 2
> /home/mingo/tip/tools/build/Makefile.include:4: recipe for target 'fixdep' failed
> make[1]: *** [fixdep] Error 2
> Makefile:68: recipe for target 'all' failed
> make: *** [all] Error 2
>
> After some digging it turns out that my 'fixdep' binary was 64-bit:
>
> deimos:~/tip/tools/perf> file /home/mingo/tip/tools/build/fixdep
> /home/mingo/tip/tools/build/fixdep: ELF 64-bit LSB executable, x86-64, version 1
> (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux
> 2.6.32, BuildID[sha1]=d527f736b57b5ba47210fbcb562a3b52867d21c1, not stripped
>
> But it did not get cleaned out by 'make clean'.
>
> Only after I did a 'make clean' in tools/ itself, did it get built properly.

It shows we don't clean up properly the fixdep objects, so adding
special rule for that.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1487340058-10496-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
85e0d509 da8a58b5

+7 -4
+2 -2
tools/build/Makefile
··· 35 35 36 36 clean: 37 37 $(call QUIET_CLEAN, fixdep) 38 - $(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 39 - $(Q)rm -f fixdep 38 + $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 39 + $(Q)rm -f $(OUTPUT)fixdep 40 40 41 41 $(OUTPUT)fixdep-in.o: FORCE 42 42 $(Q)$(MAKE) $(build)=fixdep
+3
tools/build/Makefile.include
··· 3 3 fixdep: 4 4 $(Q)$(MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= $(OUTPUT)fixdep 5 5 6 + fixdep-clean: 7 + $(Q)$(MAKE) -C $(srctree)/tools/build clean 8 + 6 9 .PHONY: fixdep
+2 -2
tools/perf/Makefile.perf
··· 726 726 $(call QUIET_CLEAN, config) 727 727 $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ $(if $(OUTPUT),OUTPUT=$(OUTPUT)feature/,) clean >/dev/null 728 728 729 - clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean 729 + clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean 730 730 $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) 731 731 $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 732 732 $(Q)$(RM) $(OUTPUT).config-detected 733 733 $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so 734 734 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \ 735 - $(OUTPUT)util/intel-pt-decoder/inat-tables.c $(OUTPUT)fixdep \ 735 + $(OUTPUT)util/intel-pt-decoder/inat-tables.c \ 736 736 $(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \ 737 737 $(OUTPUT)pmu-events/pmu-events.c 738 738 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean