[OE-core] [PATCH] perf: synchronize unistd.h between libc-headers and perf source

Martin Jansa martin.jansa at gmail.com
Fri Mar 8 06:38:02 UTC 2019


Why not use STAGING_INCDIR ?

On Fri, Mar 8, 2019 at 7:36 AM <bruce.ashfield at gmail.com> wrote:

> From: Bruce Ashfield <bruce.ashfield at gmail.com>
>
> 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 at gmail.com>
> ---
>
> Richard,
>
> This should fix the perf build failure with 4.19 and the 5.0
> libc-headers.
>
> It also builds fine in the other combinations I was able to
> test. No sense sitting on this, it can use some AB combinations
> for more testing.
>
> Bruce
>
>  meta/recipes-kernel/perf/perf.bb | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/
> perf.bb
> index 9120766858..2f85006ee1 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -235,6 +235,9 @@ 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}"
>      done
> +
> +    # cp from the sysroot unistd.h to the perf unistd.h
> +    cp ${RECIPE_SYSROOT}/usr/include/asm-generic/unistd.h
> ${S}/tools/include/uapi/asm-generic/unistd.h
>  }
>
>  python do_package_prepend() {
> --
> 2.19.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20190308/613572cc/attachment-0001.html>


More information about the Openembedded-core mailing list