<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 9, 2019 at 10:00 AM Paul Barker &lt;<a href="mailto:paul@betafive.co.uk">paul@betafive.co.uk</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">On Thu, 9 May 2019, at 14:48, Bruce Ashfield wrote:<br>
&gt; <br>
&gt; <br>
&gt; On Thu, May 9, 2019 at 9:43 AM Richard Purdie <br>
&gt; &lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt; wrote:<br>
&gt; &gt; On Thu, 2019-05-09 at 08:08 -0400, Paul Barker wrote:<br>
&gt; &gt;  &gt; On Thu, 9 May 2019, at 11:13, Paul Barker wrote:<br>
&gt; &gt;  &gt; &gt; On Wed, 8 May 2019, at 14:02, Adrian Bunk wrote:<br>
&gt; &gt;  &gt; &gt; &gt; On Wed, May 08, 2019 at 11:58:36AM +0000, <a href="mailto:paul@betafive.co.uk" target="_blank">paul@betafive.co.uk</a><br>
&gt; &gt;  &gt; &gt; &gt; wrote:<br>
&gt; &gt;  &gt; &gt; &gt; &gt; ...<br>
&gt; &gt;  &gt; &gt; &gt; &gt; +--- strace-4.26.orig/strace.c<br>
&gt; &gt;  &gt; &gt; &gt; &gt; ++++ strace-4.26/strace.c<br>
&gt; &gt;  &gt; &gt; &gt; &gt; +@@ -26,7 +26,7 @@<br>
&gt; &gt;  &gt; &gt; &gt; &gt; + #include &lt;locale.h&gt;<br>
&gt; &gt;  &gt; &gt; &gt; &gt; + #include &lt;sys/utsname.h&gt;<br>
&gt; &gt;  &gt; &gt; &gt; &gt; + #ifdef HAVE_PRCTL<br>
&gt; &gt;  &gt; &gt; &gt; &gt; +-# include &lt;sys/prctl.h&gt;<br>
&gt; &gt;  &gt; &gt; &gt; &gt; ++# include &lt;linux/prctl.h&gt;<br>
&gt; &gt;  &gt; &gt; &gt; &gt; + #endif<br>
&gt; &gt;  &gt; &gt; &gt; &gt; + #include &lt;asm/unistd.h&gt;<br>
&gt; &gt;  &gt; &gt; &gt; &gt; diff --git a/meta/recipes-devtools/strace/<a href="http://strace_4.26.bb" rel="noreferrer" target="_blank">strace_4.26.bb</a><br>
&gt; &gt;  &gt; &gt; &gt; &gt; b/meta/recipes-devtools/strace/<a href="http://strace_4.26.bb" rel="noreferrer" target="_blank">strace_4.26.bb</a><br>
&gt; &gt;  &gt; &gt; &gt; &gt; index 24f92c99e5..b71122babf 100644<br>
&gt; &gt;  &gt; &gt; &gt; &gt; --- a/meta/recipes-devtools/strace/<a href="http://strace_4.26.bb" rel="noreferrer" target="_blank">strace_4.26.bb</a><br>
&gt; &gt;  &gt; &gt; &gt; &gt; +++ b/meta/recipes-devtools/strace/<a href="http://strace_4.26.bb" rel="noreferrer" target="_blank">strace_4.26.bb</a><br>
&gt; &gt;  &gt; &gt; &gt; &gt; @@ -15,6 +15,7 @@ SRC_URI = &quot;<br>
&gt; &gt;  &gt; &gt; &gt; &gt; <a href="https://strace.io/files/$%7BPV%7D/strace-$%7BPV%7D.tar.xz" rel="noreferrer" target="_blank">https://strace.io/files/${PV}/strace-${PV}.tar.xz</a> &lt;<a href="https://strace.io/files/$%7BPV%7D/strace-$%7BPV%7D.tar.xz" rel="noreferrer" target="_blank">https://strace.io/files/$%7BPV%7D/strace-$%7BPV%7D.tar.xz</a>&gt; \<br>
&gt; &gt;  &gt; &gt; &gt; &gt; file://0001-caps-abbrev.awk-fix-gawk-s-path.patch \<br>
&gt; &gt;  &gt; &gt; &gt; &gt; file://0001-tests-sigaction-Check-for-mips-and-<br>
&gt; &gt;  &gt; &gt; &gt; &gt; alpha-before-usin.patch \<br>
&gt; &gt;  &gt; &gt; &gt; &gt; file://0001-mips-o32-fix-build.patch \<br>
&gt; &gt;  &gt; &gt; &gt; &gt; + file://musl-fixes-armv8.patch \<br>
&gt; &gt;  &gt; &gt; &gt; &gt; &quot;<br>
&gt; &gt;  &gt; &gt; &gt; &gt; ...<br>
&gt; &gt;  &gt; &gt; &gt; <br>
&gt; &gt;  &gt; &gt; &gt; #include &lt;sys/prctl.h&gt; is the documented way for getting the<br>
&gt; &gt;  &gt; &gt; &gt; prototype <br>
&gt; &gt;  &gt; &gt; &gt; of prctl(), which cannot be in linux/prctl.h for obvious reasons.<br>
&gt; &gt;  &gt; &gt; &gt; <br>
&gt; &gt;  &gt; &gt; &gt; This patch creates the following problem:<br>
&gt; &gt;  &gt; &gt; &gt; <br>
&gt; &gt;  &gt; &gt; &gt; ../strace-4.26/strace.c: In function &#39;startup_child&#39;:<br>
&gt; &gt;  &gt; &gt; &gt; ../strace-4.26/strace.c:1355:3: warning: implicit declaration of <br>
&gt; &gt;  &gt; &gt; &gt; function &#39;prctl&#39; [-Wimplicit-function-declaration]<br>
&gt; &gt;  &gt; &gt; &gt; prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY);<br>
&gt; &gt;  &gt; &gt; &gt; ^~~~~<br>
&gt; &gt;  &gt; &gt; &gt; <br>
&gt; &gt;  &gt; &gt; <br>
&gt; &gt;  &gt; &gt; Ah that&#39;s definitely not a solution then. I&#39;ll have to look into<br>
&gt; &gt;  &gt; &gt; this <br>
&gt; &gt;  &gt; &gt; further and see if I can come up with a v2 patch that doesn&#39;t<br>
&gt; &gt;  &gt; &gt; cause <br>
&gt; &gt;  &gt; &gt; this warning.<br>
&gt; &gt;  &gt; &gt; <br>
&gt; &gt;  &gt; <br>
&gt; &gt;  &gt; So alpine fixes this by patching the linux headers: <br>
&gt; &gt;  &gt; <a href="https://git.alpinelinux.org/aports/tree/main/linux-headers/fix-aarch64-asm-ptrace.patch" rel="noreferrer" target="_blank">https://git.alpinelinux.org/aports/tree/main/linux-headers/fix-aarch64-asm-ptrace.patch</a><br>
&gt; &gt;  &gt; <br>
&gt; &gt;  &gt; I think that should be acceptable here if we just do it when building<br>
&gt; &gt;  &gt; with musl libc.<br>
&gt; &gt;  &gt; <br>
&gt; &gt;  &gt; Any thoughts on that before I work up a v2 patch?<br>
&gt; &gt; <br>
&gt; &gt;  This really needs to get fixed upstream. I don&#39;t mind a patch but only<br>
&gt; &gt;  if its gone upstream, we don&#39;t want to be carrying patches to libc-<br>
&gt; &gt;  headers.<br>
&gt; <br>
&gt; I can live with that as well, we have carried them just for musl in the <br>
&gt; past, but yes, we should at least know that someone is trying to <br>
&gt; upstream it. I can&#39;t get the alpine linux git to come in right now, so <br>
&gt; I can&#39;t check the referenced change to see how it looks.<br>
&gt; <br>
&gt; I&#39;m going to do new libc-headers when I get the -dev kernel up and <br>
&gt; running with the 5.2-rc kernels, so I can watch to see that it <br>
&gt; continues to apply. I can also do some extra build testing here, if you <br>
&gt; want the headers change to come through my next pull request.<br>
&gt; <br>
<br>
There&#39;s a lot of redefinition between musl and the kernel headers that hasn&#39;t been reconciled yet (see <a href="https://www.spinics.net/lists/y2038/msg03836.html" rel="noreferrer" target="_blank">https://www.spinics.net/lists/y2038/msg03836.html</a> for some discussion) so I think there&#39;s much more to be done upstream than just fixing this one instance.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Agreed. There&#39;s a long, bikeshedding, philosophical debate about musl and headers that is always ongoing (not this discussion, that is not my comment). But if this one instance is a small change, I think it is worth carrying, the amount of musl patches to libc-headers has fluctuated over time, so this is no different. We can only deal with the problems we are seeing in our builds (I state the obvious).</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I&#39;m now dropping the `#include &lt;linux/prctl.h&gt;` line in arch/arm64/include/uapi/asm/ptrace.h (<a href="https://github.com/torvalds/linux/blob/v5.1/arch/arm64/include/uapi/asm/ptrace.h#L68" rel="noreferrer" target="_blank">https://github.com/torvalds/linux/blob/v5.1/arch/arm64/include/uapi/asm/ptrace.h#L68</a>) in linux-libc-headers and that&#39;s giving working builds for me but I&#39;m not sure how universally it can be applied. I&#39;m happy to carry that as a bbappend in our distro layer for now but that will leave strace broke on aarch64 when using musl for others.<br>
<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I&#39;m still ok with patching it out of the headers, build tests would shake any issues out, but I can&#39;t see there being too many. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Bruce</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks,<br>
<br>
-- <br>
Paul Barker<br>
Managing Director &amp; Principal Engineer<br>
Beta Five Ltd<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end<br>- &quot;Use the force Harry&quot; - Gandalf, Star Trek II<br><br></div></div>