Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1534335

Re: [PATCHv3] tools build: Make fixdep parsing wait for last target

From Peter Foley <pefoley2@pefoley.com>
Newsgroups linux.kernel
Subject Re: [PATCHv3] tools build: Make fixdep parsing wait for last target
Date 2016-12-01 18:50 +0100
Message-ID <sJDEC-7vD-29@gated-at.bofh.it> (permalink)
References (6 earlier) <sIRzY-1bf-31@gated-at.bofh.it> <sIRJD-1es-13@gated-at.bofh.it> <sIRJD-1es-11@gated-at.bofh.it> <sIRTk-1hD-21@gated-at.bofh.it> <sJzhD-4h2-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
>
> 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.
>
> Link: http://lkml.kernel.org/n/tip-anlmi1osaky314m1gu3skdnz@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  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 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;
> --
> 2.7.4
>


Acked-by: Peter Foley <pefoley2@pefoley.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[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

csiph-web