<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 <<a href="mailto:paul@betafive.co.uk">paul@betafive.co.uk</a>> 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>
> <br>
> <br>
> On Thu, May 9, 2019 at 9:43 AM Richard Purdie <br>
> <<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>> wrote:<br>
> > On Thu, 2019-05-09 at 08:08 -0400, Paul Barker wrote:<br>
> > > On Thu, 9 May 2019, at 11:13, Paul Barker wrote:<br>
> > > > On Wed, 8 May 2019, at 14:02, Adrian Bunk wrote:<br>
> > > > > 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>
> > > > > wrote:<br>
> > > > > > ...<br>
> > > > > > +--- strace-4.26.orig/strace.c<br>
> > > > > > ++++ strace-4.26/strace.c<br>
> > > > > > +@@ -26,7 +26,7 @@<br>
> > > > > > + #include <locale.h><br>
> > > > > > + #include <sys/utsname.h><br>
> > > > > > + #ifdef HAVE_PRCTL<br>
> > > > > > +-# include <sys/prctl.h><br>
> > > > > > ++# include <linux/prctl.h><br>
> > > > > > + #endif<br>
> > > > > > + #include <asm/unistd.h><br>
> > > > > > diff --git a/meta/recipes-devtools/strace/<a href="http://strace_4.26.bb" rel="noreferrer" target="_blank">strace_4.26.bb</a><br>
> > > > > > b/meta/recipes-devtools/strace/<a href="http://strace_4.26.bb" rel="noreferrer" target="_blank">strace_4.26.bb</a><br>
> > > > > > index 24f92c99e5..b71122babf 100644<br>
> > > > > > --- a/meta/recipes-devtools/strace/<a href="http://strace_4.26.bb" rel="noreferrer" target="_blank">strace_4.26.bb</a><br>
> > > > > > +++ b/meta/recipes-devtools/strace/<a href="http://strace_4.26.bb" rel="noreferrer" target="_blank">strace_4.26.bb</a><br>
> > > > > > @@ -15,6 +15,7 @@ SRC_URI = "<br>
> > > > > > <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> <<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>> \<br>
> > > > > > file://0001-caps-abbrev.awk-fix-gawk-s-path.patch \<br>
> > > > > > file://0001-tests-sigaction-Check-for-mips-and-<br>
> > > > > > alpha-before-usin.patch \<br>
> > > > > > file://0001-mips-o32-fix-build.patch \<br>
> > > > > > + file://musl-fixes-armv8.patch \<br>
> > > > > > "<br>
> > > > > > ...<br>
> > > > > <br>
> > > > > #include <sys/prctl.h> is the documented way for getting the<br>
> > > > > prototype <br>
> > > > > of prctl(), which cannot be in linux/prctl.h for obvious reasons.<br>
> > > > > <br>
> > > > > This patch creates the following problem:<br>
> > > > > <br>
> > > > > ../strace-4.26/strace.c: In function 'startup_child':<br>
> > > > > ../strace-4.26/strace.c:1355:3: warning: implicit declaration of <br>
> > > > > function 'prctl' [-Wimplicit-function-declaration]<br>
> > > > > prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY);<br>
> > > > > ^~~~~<br>
> > > > > <br>
> > > > <br>
> > > > Ah that's definitely not a solution then. I'll have to look into<br>
> > > > this <br>
> > > > further and see if I can come up with a v2 patch that doesn't<br>
> > > > cause <br>
> > > > this warning.<br>
> > > > <br>
> > > <br>
> > > So alpine fixes this by patching the linux headers: <br>
> > > <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>
> > > <br>
> > > I think that should be acceptable here if we just do it when building<br>
> > > with musl libc.<br>
> > > <br>
> > > Any thoughts on that before I work up a v2 patch?<br>
> > <br>
> > This really needs to get fixed upstream. I don't mind a patch but only<br>
> > if its gone upstream, we don't want to be carrying patches to libc-<br>
> > headers.<br>
> <br>
> I can live with that as well, we have carried them just for musl in the <br>
> past, but yes, we should at least know that someone is trying to <br>
> upstream it. I can't get the alpine linux git to come in right now, so <br>
> I can't check the referenced change to see how it looks.<br>
> <br>
> I'm going to do new libc-headers when I get the -dev kernel up and <br>
> running with the 5.2-rc kernels, so I can watch to see that it <br>
> continues to apply. I can also do some extra build testing here, if you <br>
> want the headers change to come through my next pull request.<br>
> <br>
<br>
There's a lot of redefinition between musl and the kernel headers that hasn'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'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'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'm now dropping the `#include <linux/prctl.h>` 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's giving working builds for me but I'm not sure how universally it can be applied. I'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'm still ok with patching it out of the headers, build tests would shake any issues out, but I can'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 & 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>- "Use the force Harry" - Gandalf, Star Trek II<br><br></div></div>