<div dir="ltr"><div dir="ltr">Why not use STAGING_INCDIR ?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 8, 2019 at 7:36 AM &lt;<a href="mailto:bruce.ashfield@gmail.com">bruce.ashfield@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Bruce Ashfield &lt;<a href="mailto:bruce.ashfield@gmail.com" target="_blank">bruce.ashfield@gmail.com</a>&gt;<br>
<br>
During the build for some architectures, perf generates a program<br>
which executes on the host to dump the syscall table.<br>
<br>
The generation of that program uses the cross compiler + sysroot<br>
to expand unistd.h. As such, we are getting the contents of that<br>
file from linux-libc-headers.<br>
<br>
The compilation of that generated program uses the host compiler<br>
and a restricted include path to the perf source code. In the<br>
perf source there is a captured unistd.h, as such it will be used<br>
when compiling the host executable. The perf source code is copied<br>
from the kernel version that is being built .. so we have a<br>
mismatch between the generation and the compilation of the host<br>
program.<br>
<br>
Normally this mismatch is fine, but if the libc-headers are<br>
newer than the kernel, we&#39;ll have syscalls (and their syscall<br>
numbers) that are not defined in the perf source code. This<br>
leads to a compiler error and a cascading failure of the perf<br>
build due to a missing generated file.<br>
<br>
To fix this, we can copy unistd.h from the recipe-sysroot<br>
into the perf source code and they will always be in sync.<br>
<br>
Signed-off-by: Bruce Ashfield &lt;<a href="mailto:bruce.ashfield@gmail.com" target="_blank">bruce.ashfield@gmail.com</a>&gt;<br>
---<br>
<br>
Richard,<br>
<br>
This should fix the perf build failure with 4.19 and the 5.0<br>
libc-headers.<br>
<br>
It also builds fine in the other combinations I was able to<br>
test. No sense sitting on this, it can use some AB combinations<br>
for more testing.<br>
<br>
Bruce<br>
<br>
 meta/recipes-kernel/perf/<a href="http://perf.bb" rel="noreferrer" target="_blank">perf.bb</a> | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/meta/recipes-kernel/perf/<a href="http://perf.bb" rel="noreferrer" target="_blank">perf.bb</a> b/meta/recipes-kernel/perf/<a href="http://perf.bb" rel="noreferrer" target="_blank">perf.bb</a><br>
index 9120766858..2f85006ee1 100644<br>
--- a/meta/recipes-kernel/perf/<a href="http://perf.bb" rel="noreferrer" target="_blank">perf.bb</a><br>
+++ b/meta/recipes-kernel/perf/<a href="http://perf.bb" rel="noreferrer" target="_blank">perf.bb</a><br>
@@ -235,6 +235,9 @@ do_configure_prepend () {<br>
     for s in `find ${S}/tools/perf/scripts/python/ -name &#39;*.py&#39;`; do<br>
         sed -i &#39;s,/usr/bin/python2,/usr/bin/env python,&#39; &quot;${s}&quot;<br>
     done<br>
+<br>
+    # cp from the sysroot unistd.h to the perf unistd.h<br>
+    cp ${RECIPE_SYSROOT}/usr/include/asm-generic/unistd.h ${S}/tools/include/uapi/asm-generic/unistd.h<br>
 }<br>
<br>
 python do_package_prepend() {<br>
-- <br>
2.19.1<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>