[oe-commits] [openembedded-core] 05/13: perf: synchronize unistd.h between libc-headers and perf source

git at git.openembedded.org git at git.openembedded.org
Sat Mar 9 14:43:49 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 3a23e094c4189af878e467f1636aea63955e250d
Author: Bruce Ashfield <bruce.ashfield at gmail.com>
AuthorDate: Fri Mar 8 08:46:10 2019 -0500

    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
    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 at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 meta/recipes-kernel/perf/perf.bb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 9120766..5acdcfb 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -235,6 +235,10 @@ do_configure_prepend () {
     for s in `find ${S}/tools/perf/scripts/python/ -name '*.py'`; do
         sed -i 's,/usr/bin/python2,/usr/bin/env python,' "${s}"
+    # unistd.h can be out of sync between libc-headers and the captured version in the perf source
+    # so we copy it from the sysroot unistd.h to the perf unistd.h
+    cp ${STAGING_INCDIR}/asm-generic/unistd.h ${S}/tools/include/uapi/asm-generic/unistd.h
 python do_package_prepend() {

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list