Re: [PATCH 5.6 00/23] 5.6.1-rc1 review

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Tue, Mar 31, 2020 at 05:18:57PM -0600, Daniel Díaz escreveu:
> On Tue, 31 Mar 2020 at 13:29, Arnaldo Carvalho de Melo <arnaldo.melo@xxxxxxxxx> wrote:
> > Em Tue, Mar 31, 2020 at 11:20:37AM -0700, Linus Torvalds escreveu:
> > > On Tue, Mar 31, 2020 at 11:08 AM Naresh Kamboju <naresh.kamboju@xxxxxxxxxx> wrote:
> > > > Perf build broken on Linux next and mainline and now on stable-rc-5.6 branch.

> > > Strange. What is it that triggers the problem for you? It works fine
> > > here.. The error looks like some kind of command line quoting error,
> > > but I don't see the direct cause.

> > > Have you bisected the failure? Build failures should be particularly
> > > easy and quick to bisect.

> > Naresh, can you try with the patch below? There was some back and forth
> > about a second patch in a series and this fell thru the cracks.

> I tried that patch, did not help.
 
> Bisection led to the expected merge, "perf-urgent-for-linus", so I
> went one by one and found this commit: a7ffd416d804 ("perf python: Fix
> clang detection when using CC=clang-version"). Specifically, the line
> that fails is:
 
>   cc_is_clang = b"clang version" in Popen([cc, "-v"],
> stderr=PIPE).stderr.readline()
 
> with:
 
>   Traceback (most recent call last):
>     File "util/setup.py", line 6, in <module>
>       cc_is_clang = b"clang version" in Popen([cc, "-v"],
> stderr=PIPE).stderr.readline()
>     File "/oe/build/tmp/work/juno-linaro-linux/perf/1.0-r9/recipe-sysroot-native/usr/lib/python2.7/subprocess.py",
> line 394, in __init__
>       errread, errwrite)
>     File "/oe/build/tmp/work/juno-linaro-linux/perf/1.0-r9/recipe-sysroot-native/usr/lib/python2.7/subprocess.py",
> line 1047, in _execute_child
>       raise child_exception
>   OSError: [Errno 2] No such file or directory
 
> There, the value for CC is "aarch64-linaro-linux-gcc
> --sysroot=/oe/build/tmp/work/juno-linaro-linux/perf/1.0-r9/recipe-sysroot".

Yeah, the assumption was that CC would be just the compiler, whatever
options needed for compiling would be in CFLAGS, so the solution should
be similar to the other patch, i.e. split CC and get the first word to
use with 'cc -v', i.e.:

  [perfbuilder@five ~]$ podman run --entrypoint=/bin/sh --rm -ti acmel/linux-perf-tools-build-ubuntu:18.04-x-arm64
  $
  [perfbuilder@five ~]$ podman run --entrypoint=/bin/bash --rm -ti acmel/linux-perf-tools-build-ubuntu:18.04-x-arm64
  perfbuilder@92dcc3ff8814:/$ python3
  Python 3.6.9 (default, Nov  7 2019, 10:44:02)
  [GCC 8.3.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> 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'
  >>> a = Popen(["aarch64-linux-gnu-gcc --sysroot=/oe/build/tmp/work/juno-linaro-linux/perf/1.0-r9/recipe-sysroot".split()[0], "-v"])
  >>> Using built-in specs.
  COLLECT_GCC=aarch64-linux-gnu-gcc
  COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/aarch64-linux-gnu/7/lto-wrapper
  Target: aarch64-linux-gnu
  Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=aarch64-linux-gnu --program-prefix=aarch64-linux-gnu- --includedir=/usr/aarch64-linux-gnu/include
  Thread model: posix
  gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  
  >>>

Can you please try the one-liner at the end of this message?

> > And also, BTW, can you please send me instructions on how to get hold of
> > the toolchain you use to crossbuild perf, so that I can add it to my set
> > of test build containers?
> 
> It's an OE build, so it's bound to take quite a bit of space. I'll try
> to get something dockerized so that it's easier to replicate.

Thanks a lot!
 
- Arnaldo

>From 2a88ba6ddf54a4340f5a5f896705d5e42561e210 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
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@xxxxxxxxxx>
Reported-by: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@xxxxxxxxx>,
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux