[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEUSe7-ercqbofx93m-d0RNW_dQqr1U7F7JYQ5X81CHSkq4KDw@mail.gmail.com>
Date: Wed, 1 Apr 2020 07:45:53 -0600
From: Daniel Díaz <daniel.diaz@...aro.org>
To: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
open list <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Guenter Roeck <linux@...ck-us.net>,
Shuah Khan <shuah@...nel.org>, patches@...nelci.org,
Ben Hutchings <ben.hutchings@...ethink.co.uk>,
lkft-triage@...ts.linaro.org,
linux- stable <stable@...r.kernel.org>
Subject: Re: [PATCH 5.6 00/23] 5.6.1-rc1 review
Hello!
On Wed, 1 Apr 2020 at 06:40, Arnaldo Carvalho de Melo
<arnaldo.melo@...il.com> wrote:
> Can you please try the one-liner at the end of this message?
[...]
>
> From 2a88ba6ddf54a4340f5a5f896705d5e42561e210 Mon Sep 17 00:00:00 2001
> From: Arnaldo Carvalho de Melo <acme@...hat.com>
> Date: Wed, 1 Apr 2020 09:33:59 -0300
> Subject: [PATCH 1/1] perf python: Fix clang detection to strip out options
> passed in $CC
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> The clang check in the python setup.py file expected $CC to be just the
> name of the compiler, not the compiler + options, i.e. all options were
> expected to be passed in $CFLAGS, this ends up making it fail in systems
> where CC is set to, e.g.:
>
> "aarch64-linaro-linux-gcc --sysroot=/oe/build/tmp/work/juno-linaro-linux/perf/1.0-r9/recipe-sysroot"
>
> Like this:
>
> $ python3
> >>> from subprocess import Popen
> >>> a = Popen(["aarch64-linux-gnu-gcc --sysroot=/oe/build/tmp/work/juno-linaro-linux/perf/1.0-r9/recipe-sysroot", "-v"])
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
> restore_signals, start_new_session)
> File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
> raise child_exception_type(errno_num, err_msg, err_filename)
> FileNotFoundError: [Errno 2] No such file or directory: 'aarch64-linux-gnu-gcc --sysroot=/oe/build/tmp/work/juno-linaro-linux/perf/1.0-r9/recipe-sysroot': 'aarch64-linux-gnu-gcc --sysroot=/oe/build/tmp/work/juno-linaro-linux/perf/1.0-r9/recipe-sysroot'
> >>>
>
> Make it more robust, covering this case, by passing cc.split()[0] as the
> first arg to popen().
>
> Reported-by: Daniel Díaz <daniel.diaz@...aro.org>
> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Cc: Adrian Hunter <adrian.hunter@...el.com>
> Cc: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
> Cc: Jiri Olsa <jolsa@...nel.org>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
> ---
> tools/perf/util/setup.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
> index 8a065a6f9713..347b2c0789e4 100644
> --- a/tools/perf/util/setup.py
> +++ b/tools/perf/util/setup.py
> @@ -3,7 +3,7 @@ from subprocess import Popen, PIPE
> from re import sub
>
> cc = getenv("CC")
> -cc_is_clang = b"clang version" in Popen([cc, "-v"], stderr=PIPE).stderr.readline()
> +cc_is_clang = b"clang version" in Popen([cc.split()[0], "-v"], stderr=PIPE).stderr.readline()
>
> def clang_has_option(option):
> return [o for o in Popen([cc, option], stderr=PIPE).stderr.readlines() if b"unknown argument" in o] == [ ]
> --
> 2.21.1
This worked on top of torvalds/master and linux-stable-rc/linux-5.6.y.
Thanks and greetings!
Daniel Díaz
daniel.diaz@...aro.org
Powered by blists - more mailing lists