]> code.ossystems Code Review - openembedded-core.git/commit
perf: synchronize unistd.h between libc-headers and perf source
authorBruce Ashfield <bruce.ashfield@gmail.com>
Fri, 8 Mar 2019 13:46:10 +0000 (08:46 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 9 Mar 2019 14:41:20 +0000 (14:41 +0000)
commit3a23e094c4189af878e467f1636aea63955e250d
treed5e464ba2f91230904f14f363e927aace341c50d
parent4b1f421ab5c7e5a3ee7bad5744149d331c6e0511
perf: synchronize unistd.h between libc-headers and perf source

During the build for some architectures, perf generates a program
which executes on the host to dump the syscall table.

The generation of that program uses the cross compiler + sysroot
to expand unistd.h. As such, we are getting the contents of that
file from linux-libc-headers.

The compilation of that generated program uses the host compiler
and a restricted include path to the perf source code. In the
perf source there is a captured unistd.h, as such it will be used
when compiling the host executable. The perf source code is copied
from the kernel version that is being built .. so we have a
mismatch between the generation and the compilation of the host
program.

Normally this mismatch is fine, but if the libc-headers are
newer than the kernel, we'll have syscalls (and their syscall
numbers) that are not defined in the perf source code. This
leads to a compiler error and a cascading failure of the perf
build due to a missing generated file.

To fix this, we can copy unistd.h from the recipe-sysroot
into the perf source code and they will always be in sync.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/perf/perf.bb