summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/perf/perf.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2019-03-08 08:46:10 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-09 14:43:11 +0000
commit29500c42b44bbc477e810711c963cf7284e84307 (patch)
treee148de0ccecf538042165f41f63a891335e30558 /meta/recipes-kernel/perf/perf.bb
parentf1376858b38a3d22eac6b0e6f20f7b6c5ec840f6 (diff)
downloadpoky-29500c42b44bbc477e810711c963cf7284e84307.tar.gz
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. (From OE-Core rev: 3a23e094c4189af878e467f1636aea63955e250d) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/perf/perf.bb')
-rw-r--r--meta/recipes-kernel/perf/perf.bb4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 9120766858..5acdcfb9f0 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -235,6 +235,10 @@ do_configure_prepend () {
235 for s in `find ${S}/tools/perf/scripts/python/ -name '*.py'`; do 235 for s in `find ${S}/tools/perf/scripts/python/ -name '*.py'`; do
236 sed -i 's,/usr/bin/python2,/usr/bin/env python,' "${s}" 236 sed -i 's,/usr/bin/python2,/usr/bin/env python,' "${s}"
237 done 237 done
238
239 # unistd.h can be out of sync between libc-headers and the captured version in the perf source
240 # so we copy it from the sysroot unistd.h to the perf unistd.h
241 cp ${STAGING_INCDIR}/asm-generic/unistd.h ${S}/tools/include/uapi/asm-generic/unistd.h
238} 242}
239 243
240python do_package_prepend() { 244python do_package_prepend() {