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

From: Arnaldo Carvalho de Melo
Date: Wed Apr 01 2020 - 08:40:45 EST


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