Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1530789 > unrolled thread
| Started by | Peter Foley <pefoley2@pefoley.com> |
|---|---|
| First post | 2016-11-26 23:30 +0100 |
| Last post | 2016-12-06 09:30 +0100 |
| Articles | 5 on this page of 25 — 5 participants |
Back to article view | Back to linux.kernel
[PATCH] Fix objtool with clang Peter Foley <pefoley2@pefoley.com> - 2016-11-26 23:30 +0100
Re: [PATCH] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-27 17:20 +0100
[PATCH v2] Fix objtool with clang Peter Foley <pefoley2@pefoley.com> - 2016-11-28 03:50 +0100
Re: [PATCH v2] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-28 12:40 +0100
Re: [PATCH v2] Fix objtool with clang Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-11-28 16:10 +0100
Re: [PATCH v2] Fix objtool with clang Peter Foley <pefoley2@pefoley.com> - 2016-11-28 16:30 +0100
Re: [PATCH v2] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-28 18:00 +0100
Re: [PATCH v2] Fix objtool with clang Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-11-28 20:50 +0100
Re: [PATCH v2] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-28 21:10 +0100
Re: [PATCH v2] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-29 10:40 +0100
Re: [PATCH v2] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-29 11:00 +0100
Re: [PATCH v2] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-29 15:30 +0100
Re: [PATCH v2] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-29 15:40 +0100
Re: [PATCH v2] Fix objtool with clang Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-11-29 15:50 +0100
Re: [PATCH v2] Fix objtool with clang Jiri Olsa <jolsa@redhat.com> - 2016-11-29 16:30 +0100
[PATCHv3] tools build: Make fixdep parsing wait for last target Jiri Olsa <jolsa@redhat.com> - 2016-12-01 14:10 +0100
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target Peter Foley <pefoley2@pefoley.com> - 2016-12-01 18:50 +0100
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-12-01 20:00 +0100
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target Jiri Olsa <jolsa@redhat.com> - 2016-12-02 09:50 +0100
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target Jiri Olsa <jolsa@redhat.com> - 2016-12-02 10:20 +0100
Re: [PATCHv3] tools build: Make fixdep parsing wait for last target Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-12-02 16:20 +0100
[tip:perf/core] tools build: Make fixdep parsing wait for last target tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-12-06 09:30 +0100
Re: [PATCH v2] Fix objtool with clang Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-11-29 15:40 +0100
Re: [PATCH v2] Fix objtool with clang Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-11-28 20:40 +0100
[tip:perf/core] tools build: Fix objtool build with clang tip-bot for Peter Foley <tipbot@zytor.com> - 2016-12-06 09:30 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | Arnaldo Carvalho de Melo <acme@redhat.com> |
|---|---|
| Date | 2016-12-02 16:20 +0100 |
| Subject | Re: [PATCHv3] tools build: Make fixdep parsing wait for last target |
| Message-ID | <sJXMZ-5xy-15@gated-at.bofh.it> |
| In reply to | #1534758 |
Em Fri, Dec 02, 2016 at 10:15:39AM +0100, Jiri Olsa escreveu: > On Thu, Dec 01, 2016 at 04:53:23PM -0200, Arnaldo Carvalho de Melo wrote: > > Em Thu, Dec 01, 2016 at 09:48:40AM -0800, Peter Foley escreveu: > > > On Thu, Dec 1, 2016 at 5:00 AM, Jiri Olsa <jolsa@redhat.com> wrote: > > > > 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 > > 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'
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Jiri Olsa <tipbot@zytor.com> |
|---|---|
| Date | 2016-12-06 09:30 +0100 |
| Subject | [tip:perf/core] tools build: Make fixdep parsing wait for last target |
| Message-ID | <sLjiq-84n-31@gated-at.bofh.it> |
| In reply to | #1534078 |
Commit-ID: 1cd6472e3f8d3fdee0fd19f7088807b284d3080f
Gitweb: http://git.kernel.org/tip/1cd6472e3f8d3fdee0fd19f7088807b284d3080f
Author: Jiri Olsa <jolsa@redhat.com>
AuthorDate: Thu, 1 Dec 2016 14:00:25 +0100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
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.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Foley <pefoley2@pefoley.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20161201130025.GA16430@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/fixdep.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/build/fixdep.c b/tools/build/fixdep.c
index 1521d36..734d154 100644
--- a/tools/build/fixdep.c
+++ b/tools/build/fixdep.c
@@ -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;
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@redhat.com> |
|---|---|
| Date | 2016-11-29 15:40 +0100 |
| Subject | Re: [PATCH v2] Fix objtool with clang |
| Message-ID | <sIRJD-1es-13@gated-at.bofh.it> |
| In reply to | #1532339 |
Em Tue, Nov 29, 2016 at 03:28:08PM +0100, Jiri Olsa escreveu:
> On Mon, Nov 28, 2016 at 05:40:46PM -0200, Arnaldo Carvalho de Melo wrote:
>
> 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]$
>
> 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...
> I have some difficulties now with getting Fedora 25.. I'll test
> and send this out within this week
>
> jirka
>
>
> ---
> diff --git a/tools/build/Build.include b/tools/build/Build.include
> index c4ae12a5d0a5..63c898f089f7 100644
> --- a/tools/build/Build.include
> +++ b/tools/build/Build.include
> @@ -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))
> diff --git a/tools/build/fixdep.c b/tools/build/fixdep.c
> index 1521d36cef0d..734d1547cbae 100644
> --- a/tools/build/fixdep.c
> +++ b/tools/build/fixdep.c
> @@ -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;
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@redhat.com> |
|---|---|
| Date | 2016-11-28 20:40 +0100 |
| Subject | Re: [PATCH v2] Fix objtool with clang |
| Message-ID | <sIzWq-6lO-33@gated-at.bofh.it> |
| In reply to | #1531389 |
Em Mon, Nov 28, 2016 at 07:25:53AM -0800, Peter Foley escreveu: > On Mon, Nov 28, 2016 at 7:00 AM, Arnaldo Carvalho de Melo > <acme@redhat.com> wrote: > > 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? I just updated to f25, lemme see if this still happens... - Arnaldo
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Peter Foley <tipbot@zytor.com> |
|---|---|
| Date | 2016-12-06 09:30 +0100 |
| Subject | [tip:perf/core] tools build: Fix objtool build with clang |
| Message-ID | <sLjiq-84n-27@gated-at.bofh.it> |
| In reply to | #1530999 |
Commit-ID: baa1973ebcf6a7bd15522a5b6a35a8fefd6cb232 Gitweb: http://git.kernel.org/tip/baa1973ebcf6a7bd15522a5b6a35a8fefd6cb232 Author: Peter Foley <pefoley2@pefoley.com> AuthorDate: Sun, 27 Nov 2016 21:43:46 -0500 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> 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 Signed-off-by: Peter Foley <pefoley2@pefoley.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/20161128024346.17371-1-pefoley2@pefoley.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/build/Build.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/build/Build.include b/tools/build/Build.include index c4ae12a..62dcf0c 100644 --- a/tools/build/Build.include +++ b/tools/build/Build.include @@ -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))
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web