Fix objtool with clang
PATCH 1/1 Fix objtool with clang
Clang doesn't support multiple arguments being passed to -Wp, so split them.
Fixes this error:
HOSTCC tools/objtool/fixdep.o
cat: tools/objtool/.fixdep.o.d: No such file or directory
--- tools/build/Build.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/build/Build.include +3 -3
@@ -89,10 +89,10 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - per target C flags # - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) -cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) +c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) ### ## HOSTCC C flags -host_c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) +host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))
Signature · 1 line
2.11.0.rc2
Quoted 17 lines · Peter Foley
Clang doesn't support multiple arguments being passed to -Wp, so split them.
Fixes this error:
HOSTCCtools/objtool/fixdep.o
cat:tools/objtool/.fixdep.o.d: No such file or directorySigned-off-by Peter Foley <[email protected]>--- tools/build/Build.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tools/build/Build.include +0
-0
tools/build/Build.include if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ · line 93
Quoted 7 lines
tools/build/Build.include +2
-2@@ -89,10 +89,10 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - per target C flags # - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) -cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) +c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj))
could you please rebase this on Arnaldo's latest perf/core branch?
(git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git)
thanks,
jirka
PATCH v2 1/1 Fix objtool with clang
Clang doesn't support multiple arguments being passed to -Wp, so split them.
Fixes this error:
HOSTCC tools/objtool/fixdep.o
cat: tools/objtool/.fixdep.o.d: No such file or directory
v2:
rebased onto perf/core branch.
--- tools/build/Build.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/build/Build.include +3 -3
@@ -89,12 +89,12 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - per target C flags # - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +c_flags_1 = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1)) c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2)) -cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) +cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) ### ## HOSTCC C flags -host_c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) +host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))
Signature · 1 line
2.11.0.rc2
Quoted 11 lines · Peter Foley
Clang doesn't support multiple arguments being passed to -Wp, so split them.
Fixes this error:
HOSTCCtools/objtool/fixdep.o
cat:tools/objtool/.fixdep.o.d: No such file or directoryv2:
rebased onto perf/core branch.Signed-off-by Peter Foley <[email protected]>
thanks,
jirka
Em Mon, Nov 28, 2016 at 12:39:28PM +0100, Jiri Olsa escreveu:
Quoted 8 lines · Peter Foley
Quoted 7 lines
Clang doesn't support multiple arguments being passed to -Wp, so split them.
Fixes this error:
HOSTCCtools/objtool/fixdep.o
cat:tools/objtool/.fixdep.o.d: No such file or directory
Quoted 6 lines
Quoted 4 lines
v2:
rebased onto perf/core branch.Signed-off-by Peter Foley <[email protected]>Acked-by Jiri Olsa <[email protected]>
After I applied this I started getting this:
CC /tmp/build/perf/tests/sw-clock.o/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
CC /tmp/build/perf/tests/mmap-thread-lookup.o
If I remove the O= build dir and restart, I get it again:
[acme@jouet linux]$ rm -rf /tmp/build/perf/ ; mkdir -p /tmp/build/perf ; make -k O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
Auto-detecting system features:
... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ]
GEN /tmp/build/perf/common-cmds.h
HOSTCC /tmp/build/perf/fixdep.o
<SNIP>
CC /tmp/build/perf/util/pmu-bison.o/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
CC /tmp/build/perf/util/parse-events.o
CC /tmp/build/perf/util/parse-events-flex.o
Trying to nuke my ccache dir:
Doesn't help:
[acme@jouet linux]$ rm -rf ~/.ccache/
[acme@jouet linux]$ m
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build/tmp/build/perf/jvmti/.jvmti_agent.o.cmd:3: *** empty variable name. Stop. Makefile.perf:566: recipe for target '/tmp/build/perf/jvmti/jvmti-in.o' failed make[1]: *** [/tmp/build/perf/jvmti/jvmti-in.o] Error 2
make[1]: *** Waiting for unfinished jobs.... /tmp/build/perf/pmu-events/.jevents.o.cmd:3: *** empty variable name. Stop. Makefile.perf:469: recipe for target '/tmp/build/perf/pmu-events/jevents-in.o' failed make[1]: *** [/tmp/build/perf/pmu-events/jevents-in.o] Error 2 Makefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf'
Performance counter stats for 'make -k O=/tmp/build/perf -C tools/perf install-bin':
5,406,254,581 cycles:u
8,259,935,345 instructions:u # 1.53 insn per cycle
2.150027964 seconds time elapsed[acme@jouet linux]$
Quoted 10 lines · Arnaldo Carvalho de Melo
After I applied this I started getting this:
CC
/tmp/build/perf/tests/sw-clock.o/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
CC/tmp/build/perf/tests/mmap-thread-lookup.o
Odd, I can't reproduce that...
Mind sending your gcc version + the output of make V=1 + the contents of the .cmd file causing the error?
Thanks,
Peter
Quoted 13 lines · Peter Foley
Quoted 10 lines · Arnaldo Carvalho de Melo
After I applied this I started getting this:
CC
/tmp/build/perf/tests/sw-clock.o/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
CC/tmp/build/perf/tests/mmap-thread-lookup.o
Quoted 3 lines
Odd, I can't reproduce that...
Mind sending your gcc version + the output of make V=1 + the contents of the .cmd file causing the error?
same here, can't reproduce.. might be some race issue we experienced before
jirka
Em Mon, Nov 28, 2016 at 05:58:59PM +0100, Jiri Olsa escreveu:
Quoted 14 lines · Peter Foley
Quoted 13 lines
Quoted 10 lines · Arnaldo Carvalho de Melo
After I applied this I started getting this:
CC
/tmp/build/perf/tests/sw-clock.o/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
CC/tmp/build/perf/tests/mmap-thread-lookup.o
Quoted 5 lines
Quoted 3 lines
Odd, I can't reproduce that...
Mind sending your gcc version + the output of make V=1 + the contents of the .cmd file causing the error?same here, can't reproduce.. might be some race issue we experienced before
Ok, fails in f25 as well, will try again later taking ccache out of the way, etc.
[acme@jouet linux]$ ccache -V
ccache version 3.3.3
Copyright (C) 2002-2007 Andrew Tridgell
Copyright (C) 2009-2016 Joel Rosdahl
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
[acme@jouet linux]$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix
gcc version 6.2.1 20160916 (Red Hat 6.2.1-2) (GCC)
[acme@jouet linux]$ make -v
GNU Make 4.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[acme@jouet linux]$
[acme@jouet linux]$ rm -rf /tmp/build/perf/ ; mkdir -p /tmp/build/perf ; make -k O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
Auto-detecting system features:
... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ]
GEN /tmp/build/perf/common-cmds.h HOSTCC /tmp/build/perf/fixdep.o MKDIR /tmp/build/perf/pmu-events/ HOSTCC /tmp/build/perf/pmu-events/json.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep MKDIR /tmp/build/perf/pmu-events/ HOSTCC /tmp/build/perf/pmu-events/jsmn.o CC /tmp/build/perf/perf-read-vdso32 HOSTCC /tmp/build/perf/pmu-events/jevents.o MKDIR /tmp/build/perf/jvmti/ CC /tmp/build/perf/jvmti/libjvmti.o PERF_VERSION = 4.9.rc6.g47bcdb MKDIR /tmp/build/perf/ui/gtk/ <SNIP> CC /tmp/build/perf/builtin-buildid-list.o LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
MKDIR /tmp/build/perf/arch/x86/tests/
CC /tmp/build/perf/arch/x86/tests/arch-tests.o
<SNIP>
CC /tmp/build/perf/util/pmu.o CC /tmp/build/perf/util/pmu-flex.o LD /tmp/build/perf/util/libperf-in.o LD /tmp/build/perf/libperf-in.o
Makefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf' [acme@jouet linux]$
On Mon, Nov 28, 2016 at 05:40:46PM -0200, Arnaldo Carvalho de Melo wrote:
SNIP
Quoted 6 lines
Quoted 1 line
same here, can't reproduce.. might be some race issue we experienced before
Ok, fails in f25 as well, will try again later taking ccache out of the way, etc.
[acme@jouet linux]$ ccache -V
ccache version 3.3.3
is there some extra config needed for ccache?
Quoted 8 lines
Copyright (C) 2002-2007 Andrew Tridgell
Copyright (C) 2009-2016 Joel RosdahlThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
[acme@jouet linux]$ gcc -v
I'm on F25 with same gcc version
Quoted 17 lines
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix
gcc version 6.2.1 20160916 (Red Hat 6.2.1-2) (GCC)
[acme@jouet linux]$ make -v
GNU Make 4.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[acme@jouet linux]$
Quoted 3 lines
[acme@jouet linux]$ rm -rf
/tmp/build/perf/; mkdir -p/tmp/build/perf; make -k O=/tmp/build/perf -Ctools/perfinstall-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
I'm building on 8 CPUs.. so not the race issue I guess
SNIP
Quoted 10 lines
CC /tmp/build/perf/builtin-buildid-list.o LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed
could you please post /tmp/build/perf/.plugin_jbd2.o.cmd file?
and 'make ... V=1' output?
thanks,
jirka
Quoted 6 lines
make[2]: *** [
/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
MKDIR/tmp/build/perf/arch/x86/tests/
CC/tmp/build/perf/arch/x86/tests/arch-tests.o
SNIP
On Mon, Nov 28, 2016 at 05:40:46PM -0200, Arnaldo Carvalho de Melo wrote:
SNIP
Quoted 7 lines
LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
Quoted 6 lines
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
ok, reproduced..
the commit changes the output of the depfile for some reason, and our fixdep does not handle it correctly and produce wrong cmd file that failed to parse.. checking for fix
depfile changes ('+' is after the change):
-plugin_jbd2.o: plugin_jbd2.c /usr/include/stdc-predef.h \
+plugin_jbd2.o plugin_jbd2.o: plugin_jbd2.c /usr/include/stdc-predef.h \
jirka
Quoted 29 lines · Jiri Olsa
On Mon, Nov 28, 2016 at 05:40:46PM -0200, Arnaldo Carvalho de Melo wrote:
SNIP
Quoted 7 lines
LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.oQuoted 6 lines
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....ok, reproduced..
the commit changes the output of the depfile for some reason, and our fixdep does not handle it correctly and produce wrong cmd file that failed to parse.. checking for fix
depfile changes ('+' is after the change):
(quoted diff) +1
-1-plugin_jbd2.o: plugin_jbd2.c /usr/include/stdc-predef.h \ +plugin_jbd2.o plugin_jbd2.o: plugin_jbd2.c /usr/include/stdc-predef.h \
Quoted 1 line
jirka
so Fedora 25 puts old target name in the generated dependencies in case you split the -Wp options.. while Fedora 24 the old way
and both F24 and F25 shows me same gcc version 6.2.1
(note that just the first command output with 2 targets is wrong for us)
Fedora 25:
[root@intel-denlow-r-02 ~]# gcc -o ex.o -c -Wp,-MD,krava -Wp,-MT,krava -g ex.c [root@intel-denlow-r-02 ~]# cat krava
ex.o krava: ex.c /usr/include/stdc-predef.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
[root@intel-denlow-r-02 ~]# gcc -o ex.o -c -Wp,-MD,krava,-MT,krava -g ex.c [root@intel-denlow-r-02 ~]# cat krava
krava: ex.c /usr/include/stdc-predef.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
Fedora 24:
[jolsa@krava trash]$ gcc -o ex.o -c -Wp,-MD,krava -Wp,-MT,krava -g ex.c [jolsa@krava trash]$ cat krava
krava: ex.c /usr/include/stdc-predef.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
[jolsa@krava trash]$ gcc -o ex.o -c -Wp,-MD,krava-Wp,-MT,krava -g ex.c [jolsa@krava trash]$ cat krava
krava: ex.c /usr/include/stdc-predef.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h
I'll make fixdep to deal with that and try to have someone from gcc to clarify on this
jirka
On Mon, Nov 28, 2016 at 05:40:46PM -0200, Arnaldo Carvalho de Melo wrote:
SNIP
Quoted 17 lines
CC /tmp/build/perf/builtin-buildid-list.o LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
MKDIR/tmp/build/perf/arch/x86/tests/
CC/tmp/build/perf/arch/x86/tests/arch-tests.o
<SNIP>
Quoted 8 lines
CC /tmp/build/perf/util/pmu.o CC /tmp/build/perf/util/pmu-flex.o LD /tmp/build/perf/util/libperf-in.o LD /tmp/build/perf/libperf-in.oMakefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf' [acme@jouet linux]$
how about following fix.. it gets rid of the -Wp,MT option completely so it should address Peter's issue.. it also makes fixdep more robust and makes it wait for first target before spitting out dependencies
I have some difficulties now with getting Fedora 25.. I'll test and send this out within this week
jirka
---
tools/build/Build.include +3 -3
@@ -89,12 +89,12 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - per target C flags # - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +c_flags_1 = -Wp,-MD,$(depfile) $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1)) c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2)) -cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) +cxx_flags = -Wp,-MD,$(depfile) $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) ### ## HOSTCC C flags -host_c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) +host_c_flags = -Wp,-MD,$(depfile) $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))
tools/build/fixdep.c +3 -2
@@ -49,7 +49,7 @@ static void parse_dep_file(void *map, size_t len)char *end = m + len;char *p;char s[PATH_MAX ]; -int is_target; +int is_target, has_target =0 ;int saw_any_target =0 ;int is_first_dep =0 ;
@@ -67,7 +67,8 @@ static void parse_dep_file(void *map, size_t len)if (is_target) {/* The /next/ file is the first dependency */ is_first_dep =1 ; - }else { + has_target =1 ; + }else if (has_target) {/* Save this token/filename */ memcpy (s, m, p-m); s[p - m] =0 ;
Em Tue, Nov 29, 2016 at 03:28:08PM +0100, Jiri Olsa escreveu:
Quoted 30 lines · Arnaldo Carvalho de Melo
SNIP
Quoted 17 lines
CC /tmp/build/perf/builtin-buildid-list.o LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
MKDIR/tmp/build/perf/arch/x86/tests/
CC/tmp/build/perf/arch/x86/tests/arch-tests.o
<SNIP>Quoted 8 lines
CC /tmp/build/perf/util/pmu.o CC /tmp/build/perf/util/pmu-flex.o LD /tmp/build/perf/util/libperf-in.o LD /tmp/build/perf/libperf-in.oMakefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf' [acme@jouet linux]$
Quoted 3 lines
how about following fix.. it gets rid of the -Wp,MT option completely so it should address Peter's issue.. it also makes fixdep more robust and makes it wait for first target before spitting out dependencies
So this should replace Peter's patch? On top? I'm checking that now...
Quoted 50 lines
I have some difficulties now with getting Fedora 25.. I'll test and send this out within this week
jirka
---
tools/build/Build.include +3
-3@@ -89,12 +89,12 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - per target C flags # - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +c_flags_1 = -Wp,-MD,$(depfile) $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1)) c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2)) -cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) +cxx_flags = -Wp,-MD,$(depfile) $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) ### ## HOSTCC C flags -host_c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) +host_c_flags = -Wp,-MD,$(depfile) $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))tools/build/fixdep.c +3
-2@@ -49,7 +49,7 @@ static void parse_dep_file(void *map, size_t len)char *end = m + len;char *p;char s[PATH_MAX ]; -int is_target; +int is_target, has_target =0 ;int saw_any_target =0 ;int is_first_dep =0 ;@@ -67,7 +67,8 @@ static void parse_dep_file(void *map, size_t len)if (is_target) {/* The /next/ file is the first dependency */ is_first_dep =1 ; - }else { + has_target =1 ; + }else if (has_target) {/* Save this token/filename */ memcpy (s, m, p-m); s[p - m] =0 ;
Quoted 31 lines · Arnaldo Carvalho de Melo
Em Tue, Nov 29, 2016 at 03:28:08PM +0100, Jiri Olsa escreveu:
Quoted 30 lines · Arnaldo Carvalho de Melo
SNIP
Quoted 25 lines
CC /tmp/build/perf/builtin-buildid-list.o LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
MKDIR/tmp/build/perf/arch/x86/tests/
CC/tmp/build/perf/arch/x86/tests/arch-tests.o
<SNIP>CC /tmp/build/perf/util/pmu.o CC /tmp/build/perf/util/pmu-flex.o LD /tmp/build/perf/util/libperf-in.o LD /tmp/build/perf/libperf-in.oMakefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf' [acme@jouet linux]$
Quoted 5 lines
Quoted 3 lines
how about following fix.. it gets rid of the -Wp,MT option completely so it should address Peter's issue.. it also makes fixdep more robust and makes it wait for first target before spitting out dependencies
So this should replace Peter's patch? On top? I'm checking that now...
it's replacement.. also I'll put it into 2 patches
jirka
Em Tue, Nov 29, 2016 at 03:39:35PM +0100, Jiri Olsa escreveu:
Quoted 32 lines · Arnaldo Carvalho de Melo
Quoted 31 lines
Em Tue, Nov 29, 2016 at 03:28:08PM +0100, Jiri Olsa escreveu:
Quoted 30 lines · Arnaldo Carvalho de Melo
SNIP
Quoted 25 lines
CC /tmp/build/perf/builtin-buildid-list.o LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
MKDIR/tmp/build/perf/arch/x86/tests/
CC/tmp/build/perf/arch/x86/tests/arch-tests.o
<SNIP>CC /tmp/build/perf/util/pmu.o CC /tmp/build/perf/util/pmu-flex.o LD /tmp/build/perf/util/libperf-in.o LD /tmp/build/perf/libperf-in.oMakefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf' [acme@jouet linux]$
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
how about following fix.. it gets rid of the -Wp,MT option completely so it should address Peter's issue.. it also makes fixdep more robust and makes it wait for first target before spitting out dependencies
So this should replace Peter's patch? On top? I'm checking that now...
it's replacement.. also I'll put it into 2 patches
Ok, just tested, Peter's patch works if I remove ccache, with your patch replacing it, everything works, with and without ccache, on f25, and it builds on f24 without ccache, in one of the containers I have.
- Arnaldo
Quoted 37 lines · Arnaldo Carvalho de Melo
Em Tue, Nov 29, 2016 at 03:39:35PM +0100, Jiri Olsa escreveu:
Quoted 36 lines · Arnaldo Carvalho de Melo
Quoted 35 lines
Em Tue, Nov 29, 2016 at 03:28:08PM +0100, Jiri Olsa escreveu:
Quoted 33 lines · Arnaldo Carvalho de Melo
SNIP
Quoted 17 lines
CC /tmp/build/perf/builtin-buildid-list.o LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
MKDIR/tmp/build/perf/arch/x86/tests/
CC/tmp/build/perf/arch/x86/tests/arch-tests.o
<SNIP>Quoted 8 lines
CC /tmp/build/perf/util/pmu.o CC /tmp/build/perf/util/pmu-flex.o LD /tmp/build/perf/util/libperf-in.o LD /tmp/build/perf/libperf-in.oMakefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf' [acme@jouet linux]$how about following fix.. it gets rid of the -Wp,MT option completely so it should address Peter's issue.. it also makes fixdep more robust and makes it wait for first target before spitting out dependencies
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
So this should replace Peter's patch? On top? I'm checking that now...
it's replacement.. also I'll put it into 2 patches
Ok, just tested, Peter's patch works if I remove ccache, with your patch replacing it, everything works, with and without ccache, on f25, and it builds on f24 without ccache, in one of the containers I have.
ok, I'll run my tests once I have the server and send it out
thanks,
jirka
PATCH v3 1/1 tools build: Make fixdep parsing wait for last target
In reply to Arnaldo Carvalho de MeloQuoted 37 lines · Arnaldo Carvalho de Melo
Em Tue, Nov 29, 2016 at 03:39:35PM +0100, Jiri Olsa escreveu:
Quoted 36 lines · Arnaldo Carvalho de Melo
Quoted 35 lines
Em Tue, Nov 29, 2016 at 03:28:08PM +0100, Jiri Olsa escreveu:
Quoted 33 lines · Arnaldo Carvalho de Melo
SNIP
Quoted 17 lines
CC /tmp/build/perf/builtin-buildid-list.o LD /tmp/build/perf/pmu-events/pmu-events-in.o CC /tmp/build/perf/arch/x86/util/intel-bts.o CC /tmp/build/perf/builtin-buildid-cache.o CC /tmp/build/perf/builtin-list.o LD /tmp/build/perf/arch/x86/util/libperf-in.o MKDIR /tmp/build/perf/arch/x86/tests/ CC /tmp/build/perf/arch/x86/tests/regs_load.o
/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
MKDIR/tmp/build/perf/arch/x86/tests/
CC/tmp/build/perf/arch/x86/tests/arch-tests.o
<SNIP>Quoted 8 lines
CC /tmp/build/perf/util/pmu.o CC /tmp/build/perf/util/pmu-flex.o LD /tmp/build/perf/util/libperf-in.o LD /tmp/build/perf/libperf-in.oMakefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf' [acme@jouet linux]$how about following fix.. it gets rid of the -Wp,MT option completely so it should address Peter's issue.. it also makes fixdep more robust and makes it wait for first target before spitting out dependencies
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
So this should replace Peter's patch? On top? I'm checking that now...
it's replacement.. also I'll put it into 2 patches
Ok, just tested, Peter's patch works if I remove ccache, with your patch replacing it, everything works, with and without ccache, on f25, and it builds on f24 without ccache, in one of the containers I have.
ok, so v3 actually ;-)
the v2 was tricky for the case when fixdep is not available, so I decided to go with Peter's fix and fixing 'fixdep' tool to properly parse out the target in case we hit the ccache error.. we need to be able to do it anyway
please apply this patch before Peter's so we keep clean bisect
thanks,
jirka
---
The fixdep tool among other things replaces the target of the object in the gcc generated dependency output file.
The parsing code assumes there's only single target in the rule but this is not always the case as described in here:
https://gcc.gnu.org/ml/gcc-help/2016-11/msg00099.html
Making the fixdep code smart enough to skip all the possible targets.
--- tools/build/fixdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/build/fixdep.c +3 -2
@@ -49,7 +49,7 @@ static void parse_dep_file(void *map, size_t len)char *end = m + len;char *p;char s[PATH_MAX ]; -int is_target; +int is_target, has_target =0 ;int saw_any_target =0 ;int is_first_dep =0 ;
@@ -67,7 +67,8 @@ static void parse_dep_file(void *map, size_t len)if (is_target) {/* The /next/ file is the first dependency */ is_first_dep =1 ; - }else { + has_target =1 ; + }else if (has_target) {/* Save this token/filename */ memcpy (s, m, p-m); s[p - m] =0 ;
Signature · 1 line
2.7.4
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target
Quoted 54 lines · Jiri Olsa
ok, so v3 actually ;-)
the v2 was tricky for the case when fixdep is not available, so I decided to go with Peter's fix and fixing 'fixdep' tool to properly parse out the target in case we hit the ccache error.. we need to be able to do it anyway
please apply this patch before Peter's so we keep clean bisect
thanks,
jirka---
The fixdep tool among other things replaces the target of the object in the gcc generated dependency output file.The parsing code assumes there's only single target in the rule but this is not always the case as described in here:
https://gcc.gnu.org/ml/gcc-help/2016-11/msg00099.htmlMaking the fixdep code smart enough to skip all the possible targets.
Signed-off-by Jiri Olsa <[email protected]>--- tools/build/fixdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tools/build/fixdep.c +3
-3@@ -49,7 +49,7 @@ static void parse_dep_file(void *map, size_t len)char *end = m + len;char *p;char s[PATH_MAX ]; -int is_target; +int is_target, has_target =0 ;int saw_any_target =0 ;int is_first_dep =0 ;@@ -67,7 +67,8 @@ static void parse_dep_file(void *map, size_t len)if (is_target) {/* The /next/ file is the first dependency */ is_first_dep =1 ; - }else { + has_target =1 ; + }else if (has_target) {/* Save this token/filename */ memcpy (s, m, p-m); s[p - m] =0 ; --
Quoted 2 lines
2.7.4
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target
Em Thu, Dec 01, 2016 at 09:48:40AM -0800, Peter Foley escreveu:
Quoted 8 lines · Jiri Olsa
Quoted 7 lines
ok, so v3 actually ;-)
the v2 was tricky for the case when fixdep is not available, so I decided to go with Peter's fix and fixing 'fixdep' tool to properly parse out the target in case we hit the ccache error.. we need to be able to do it anyway
Quoted 4 lines
Quoted 4 lines
please apply this patch before Peter's so we keep clean bisect
thanks,
jirka
Doesn't work with ccache installed, but then after reinstalling ccache to check its version, I can't reproduce it anymore, go figure :-\
Can you guys please take a look at tmp.perf/fixdep in my tree and check that the last two patches are the ones that should go upstream and that you are able to build it _with_ ccache installed?
Thanks,
- Arnaldo
Checking ccache version _after_ reinstalling it.
[acme@jouet linux]$ rpm -q ccache
ccache-3.3.3-1.fc25.x86_64
Before removing ccache:
[acme@jouet linux]$ git log --oneline -253c0b5e56b0e Fix objtool with clangb73bc98b88db tools build: Make fixdep parsing wait for last target [acme@jouet linux]$
[acme@jouet linux]$ m
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build CC /tmp/build/perf/jvmti/libjvmti.o CC /tmp/build/perf/jvmti/jvmti_agent.o HOSTCC /tmp/build/perf/pmu-events/json.o HOSTCC /tmp/build/perf/fixdep.o HOSTCC /tmp/build/perf/pmu-events/jsmn.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep
/bin/sh: /tmp/build/perf//fixdep: Permission denied /home/acme/git/linux/tools/build/Makefile.build:91: recipe for target '/tmp/build/perf/pmu-events/jsmn.o' failed make[2]: *** [/tmp/build/perf/pmu-events/jsmn.o] Error 1
Makefile.perf:469: recipe for target '/tmp/build/perf/pmu-events/jevents-in.o' failed
make[1]: *** [/tmp/build/perf/pmu-events/jevents-in.o] Error 2
make[1]: *** Waiting for unfinished jobs....
LD /tmp/build/perf/jvmti/jvmti-in.o
Makefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf'
Performance counter stats for 'make -k O=/tmp/build/perf -C tools/perf install-bin':
7,842,062,842 cycles:u
10,358,806,498 instructions:u # 1.32 insn per cycle
2.698261783 seconds time elapsed[acme@jouet linux]$
Even if I try removing the build directory it fails:
[acme@jouet linux]$ rm -rf /tmp/build/perf/ ; mkdir -p /tmp/build/perf ; make -k O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
Auto-detecting system features:
... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ]
GEN /tmp/build/perf/common-cmds.h HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep MKDIR /tmp/build/perf/pmu-events/ HOSTCC /tmp/build/perf/pmu-events/json.o
/bin/sh: /tmp/build/perf//fixdep: Permission denied /home/acme/git/linux/tools/build/Makefile.build:91: recipe for target '/tmp/build/perf/pmu-events/json.o' failed make[2]: *** [/tmp/build/perf/pmu-events/json.o] Error 1
Makefile.perf:469: recipe for target '/tmp/build/perf/pmu-events/jevents-in.o' failed
make[1]: *** [/tmp/build/perf/pmu-events/jevents-in.o] Error 2
make[1]: *** Waiting for unfinished jobs....
PERF_VERSION = 4.9.rc6.g628b2a
make[1]: *** wait: No child processes. Stop.
Makefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf'
[acme@jouet linux]$
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target
On Thu, Dec 01, 2016 at 04:53:23PM -0200, Arnaldo Carvalho de Melo wrote:
SNIP
Quoted 10 lines
[acme@jouet linux]$ m
make: Entering directory '/home/acme/git/linux/tools/perf'BUILD: Doing 'make -j4' parallel build CC /tmp/build/perf/jvmti/libjvmti.o CC /tmp/build/perf/jvmti/jvmti_agent.o HOSTCC /tmp/build/perf/pmu-events/json.o HOSTCC /tmp/build/perf/fixdep.o HOSTCC /tmp/build/perf/pmu-events/jsmn.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep
Quoted 2 lines
/bin/sh:/tmp/build/perf//fixdep: Permission denied/home/acme/git/linux/tools/build/Makefile.build:91: recipe for target '/tmp/build/perf/pmu-events/jsmn.o' failed
I think this is unrelated.. I think we're missing jevents fixdep dependency
I'll test patch below and send it separately
jirka
---
tools/perf/Makefile.perf +1 -1
@@ -465,7 +465,7 @@ $(PERF_IN): prepare FORCE || echo "Warning: tools/include/uapi/linux/mman.h differs from kernel" >&2 )) || true $(Q)$(MAKE) $(build)=perf -$(JEVENTS_IN): FORCE +$(JEVENTS_IN): fixdep FORCE $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=jevents $(JEVENTS): $(JEVENTS_IN)
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target
In reply to Arnaldo Carvalho de MeloQuoted 14 lines · Arnaldo Carvalho de Melo
Em Thu, Dec 01, 2016 at 09:48:40AM -0800, Peter Foley escreveu:
Quoted 8 lines · Jiri Olsa
Quoted 7 lines
ok, so v3 actually ;-)
the v2 was tricky for the case when fixdep is not available, so I decided to go with Peter's fix and fixing 'fixdep' tool to properly parse out the target in case we hit the ccache error.. we need to be able to do it anyway
Quoted 4 lines
Quoted 4 lines
please apply this patch before Peter's so we keep clean bisect
thanks,
jirka
Quoted 6 lines
Doesn't work with ccache installed, but then after reinstalling ccache to check its version, I can't reproduce it anymore, go figure :-\
Can you guys please take a look at tmp.perf/fixdep in my tree and check that the last two patches are the ones that should go upstream and that you are able to build it _with_ ccache installed?
yep, works for me
thanks,
jirka
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target
Em Fri, Dec 02, 2016 at 10:15:39AM +0100, Jiri Olsa escreveu:
Quoted 12 lines · Arnaldo Carvalho de Melo
Quoted 10 lines
Em Thu, Dec 01, 2016 at 09:48:40AM -0800, Peter Foley escreveu:
Quoted 9 lines · Jiri Olsa
Quoted 8 lines
ok, so v3 actually ;-)
the v2 was tricky for the case when fixdep is not available, so I decided to go with Peter's fix and fixing 'fixdep' tool to properly parse out the target in case we hit the ccache error.. we need to be able to do it anyway
please apply this patch before Peter's so we keep clean bisect
Quoted 8 lines
Quoted 6 lines
Doesn't work with ccache installed, but then after reinstalling ccache to check its version, I can't reproduce it anymore, go figure :-\
Can you guys please take a look at tmp.perf/fixdep in my tree and check that the last two patches are the ones that should go upstream and that you are able to build it _with_ ccache installed?
yep, works for me
So I saw it again, while processing Wang's eBPF/llvm patchkit, right after removing the build dir and starting from scratch, doing that process one more time made it work, so it looks like a race, and look it is in a HOSTCC bit, related?
[acme@jouet linux]$ rm -rf /tmp/build/perf/ ; mkdir -p /tmp/build/perf ; make -k O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
Auto-detecting system features:
... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ]
GEN /tmp/build/perf/common-cmds.h HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep MKDIR /tmp/build/perf/pmu-events/ HOSTCC /tmp/build/perf/pmu-events/json.o
/bin/sh: /tmp/build/perf//fixdep: Permission denied /home/acme/git/linux/tools/build/Makefile.build:91: recipe for target '/tmp/build/perf/pmu-events/json.o' failed make[2]: *** [/tmp/build/perf/pmu-events/json.o] Error 1
Makefile.perf:469: recipe for target '/tmp/build/perf/pmu-events/jevents-in.o' failed
make[1]: *** [/tmp/build/perf/pmu-events/jevents-in.o] Error 2
make[1]: *** Waiting for unfinished jobs....
PERF_VERSION = 4.9.rc6.g165081a
make[1]: *** wait: No child processes. Stop.
Makefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf'
tip-bot for Jiri Olsa
merge bot[tip:perf/core] tools build: Make fixdep parsing wait for last target
In reply to Jiri Olsatools build: Make fixdep parsing wait for last target
Commit-ID: 1cd6472e3f8d3fdee0fd19f7088807b284d3080f Gitweb: http://git.kernel.org/tip/1cd6472e3f8d3fdee0fd19f7088807b284d3080f Author: Jiri Olsa <[email protected]> AuthorDate: Thu, 1 Dec 2016 14:00:25 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 5 Dec 2016 15:51:42 -0300
tools build: Make fixdep parsing wait for last target
The fixdep tool, among other things, replaces the target of the object in the gcc generated dependency output file.
The parsing code assumes there's only single target in the rule but this is not always the case as described in here:
https://gcc.gnu.org/ml/gcc-help/2016-11/msg00099.html
Make the fixdep code smart enough to skip all the possible targets.
--- tools/build/fixdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/build/fixdep.c +3 -2
@@ -49,7 +49,7 @@ static void parse_dep_file(void *map, size_t len)char *end = m + len;char *p;char s[PATH_MAX ]; -int is_target; +int is_target, has_target =0 ;int saw_any_target =0 ;int is_first_dep =0 ;
@@ -67,7 +67,8 @@ static void parse_dep_file(void *map, size_t len)if (is_target) {/* The /next/ file is the first dependency */ is_first_dep =1 ; - }else { + has_target =1 ; + }else if (has_target) {/* Save this token/filename */ memcpy (s, m, p-m); s[p - m] =0 ;
Em Mon, Nov 28, 2016 at 07:25:53AM -0800, Peter Foley escreveu:
Quoted 13 lines
Quoted 10 lines · Arnaldo Carvalho de Melo
After I applied this I started getting this:
CC
/tmp/build/perf/tests/sw-clock.o/tmp/build/perf/.plugin_jbd2.o.cmd:3: *** empty variable name. Stop. Makefile:192: recipe for target '/tmp/build/perf/plugin_jbd2-in.o' failed make[2]: *** [/tmp/build/perf/plugin_jbd2-in.o] Error 2
Makefile.perf:591: recipe for target '/tmp/build/perf/libtraceevent-dynamic-list' failed make[1]: *** [/tmp/build/perf/libtraceevent-dynamic-list] Error 2
make[1]: *** Waiting for unfinished jobs....
CC/tmp/build/perf/tests/mmap-thread-lookup.o
Quoted 3 lines
Odd, I can't reproduce that...
Mind sending your gcc version + the output of make V=1 + the contents of the .cmd file causing the error?
I just updated to f25, lemme see if this still happens...
- Arnaldo
tip-bot for Peter Foley
merge bot[tip:perf/core] tools build: Fix objtool build with clang
In reply to Peter Foleytools build: Fix objtool build with clang
Commit-ID: baa1973ebcf6a7bd15522a5b6a35a8fefd6cb232 Gitweb: http://git.kernel.org/tip/baa1973ebcf6a7bd15522a5b6a35a8fefd6cb232 Author: Peter Foley <[email protected]> AuthorDate: Sun, 27 Nov 2016 21:43:46 -0500 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 5 Dec 2016 15:51:42 -0300
tools build: Fix objtool build with clang
Clang doesn't support multiple arguments being passed to -Wp, so split them.
Fixes this error:
HOSTCC tools/objtool/fixdep.o
cat: tools/objtool/.fixdep.o.d: No such file or directory
--- tools/build/Build.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/build/Build.include +3 -3
@@ -89,12 +89,12 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - per target C flags # - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +c_flags_1 = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1)) c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2)) -cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) +cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) ### ## HOSTCC C flags -host_c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) +host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))