<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 5:45 AM, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Mon, Feb 01, 2016 at 11:24:03AM +0200, Alexandru But wrote:<br>
&gt; On Fri, Jan 29, 2016 at 07:01:57PM +0100, Martin Jansa wrote:<br>
&gt; &gt; On Tue, Jan 19, 2016 at 12:45:18PM +0200, Alexandru But wrote:<br>
&gt; &gt; &gt; Patch based on commit a3606c0:<br>
&gt; &gt; &gt; Sometimes the compiler doesn&#39;t like { 0,} as an initializer<br>
&gt; &gt;<br>
&gt; &gt; Probably not caused by this change, but efivar now fails to build in<br>
&gt; &gt; world build for qemuarm:<br>
&gt; &gt;<br>
&gt; &gt; | linux.c: In function &#39;eb_nvme_ns_id&#39;:<br>
&gt; &gt; | linux.c:48:27: error: &#39;NVME_IOCTL_ID&#39; undeclared (first use in this function)<br>
&gt; &gt; |   uint64_t ret = ioctl(fd, NVME_IOCTL_ID, NULL);<br>
&gt; &gt; |                            ^<br>
&gt; &gt; | linux.c:48:27: note: each undeclared identifier is reported only once for each function it appears in<br>
&gt; &gt; | make[1]: *** [linux.o] Error 1<br>
&gt; &gt; | make[1]: Leaving directory `/home/jenkins/oe/world/shr-core/tmp-glibc/work/armv5te-oe-linux-gnueabi/efivar/0.21-r0/git/src&#39;<br>
&gt; &gt; | make: *** [src] Error 2<br>
&gt; &gt; | ERROR: oe_runmake failed<br>
&gt; &gt; | ERROR: Function failed: do_compile (log file is located at /home/jenkins/oe/world/shr-core/tmp-glibc/work/armv5te-oe-linux-gnueabi/efivar/0.21-r0/temp/log.do_compile.8376)<br>
&gt; &gt; NOTE: recipe efivar-0.21-r0: task do_compile: Failed<br>
&gt; &gt; ERROR: Task 5672 (/home/jenkins/oe/world/shr-core/meta-openembedded/meta-oe/recipes-extended/efivar/<a href="http://efivar_0.21.bb" rel="noreferrer" target="_blank">efivar_0.21.bb</a>, do_compile) failed with exit code &#39;1&#39;<br>
&gt; &gt;<br>
&gt;<br>
&gt; Yes, I saw the error, and indeed is not related to this change. The problem is<br>
&gt; that NVMe uapi header was renamed from nvme.h to nvme_ioctl.h. Here is the<br>
&gt; change:<br>
&gt; <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9d99a8dda154f38307d43d9c9aa504bd3703d596" rel="noreferrer" target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9d99a8dda154f38307d43d9c9aa504bd3703d596</a><br>
&gt;<br>
&gt; The Kconfig update unfortunately hasn&#39;t been change in the same time. It was<br>
&gt; commited to the kernel only recently and will most likely be present in 4.5.<br>
&gt; <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a9cf8284b45110a4d98aea180a89c857e53bf850" rel="noreferrer" target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a9cf8284b45110a4d98aea180a89c857e53bf850</a><br>
&gt;<br>
&gt; In the standard/base repository that yocto uses, only the first of the above<br>
&gt; changes have been pulled. The old header has a new name, so the desired macro<br>
&gt; is no longer there. The problem could be solved from the utility point of view<br>
&gt; with a patch that gentoo tree already has:<br>
&gt; <a href="https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/efivar/files/0.21-nvme_ioctl.h.patch" rel="noreferrer" target="_blank">https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/efivar/files/0.21-nvme_ioctl.h.patch</a><br>
&gt;<br>
&gt; The problem is that even with this change the new header will not be found since<br>
&gt; the second change is not yet in the yocto repo. I cherry-picked and created all<br>
&gt; the changes above, but efivar still does not find the new header.<br>
&gt; Problem is that the headers from sysroot are built by linux-libc-headers and<br>
&gt; this recipe uses the static 4.4 linux release archive from <a href="http://kernel.org" rel="noreferrer" target="_blank">kernel.org</a>. If all<br>
&gt; the above are pulled in and linux-libc-headers are using sources with both<br>
&gt; changes, than efivar build will pass.<br>
&gt;<br>
&gt; From my point of view the possible solutions for this problem are:<br>
&gt; - Push the efivar patch and blacklist the recipe until linux-libc-headers points<br>
&gt;   to 4.5<br>
&gt; - Revert the rename change in the yocto kernel repo and apply the efivar patch<br>
&gt;   after 4.5 token<br>
&gt; - Apply the efivar patch, and a patch for linux-libc-headers<br>
&gt; - Escalate the problem to the kernel comunity to backport the Kconfig change to<br>
&gt;   4.4<br>
&gt;<br>
&gt; I am not sure which is the right approach since they all have downsides.<br>
<br>
Thanks for detailed analysis, I don&#39;t use efivar or linux-yocto, so I<br>
was reporting the issue only because I wasn&#39;t able to even build-test<br>
your change in jenkins.<br>
<br>
Adding oe-core and Bruce, because the issue is in<br>
linux-yocto/linux-libc-headers maintained there.<br>
<br></blockquote><div><br></div><div>Thanks Martin and Alexandru,</div><div><br></div><div><font color="#555555"><span style="font-size:12.8px;white-space:nowrap">Alexandru: since we&#39;d like to fix this everywhere, and not just someone building,</span></font></div><div><font color="#555555"><span style="font-size:12.8px;white-space:nowrap">against linux-yocto .. and I&#39;d rather not wait until the 4.5 kernel is released (so</span></font></div><div><font color="#555555"><span style="font-size:12.8px;white-space:nowrap">I can bump the libc-headers).</span></font></div><div><font color="#555555"><span style="font-size:12.8px;white-space:nowrap"><br></span></font></div><div><font color="#555555"><span style="font-size:12.8px;white-space:nowrap">I&#39;d suggest that we patch linux-libc-headers to </span></font><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)">have the proper definitions, can</span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)">you prepare a patch, since you are currently building efivar and can quickly confim</span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)">a fix ?</span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)"><br></span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)">We can also nominate the Kconfig change to be backported to 4.4, but we can</span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)">get things working in the mean time.</span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)"><br></span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)">Cheers,</span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)"><br></span></div><div><span style="font-size:12.8px;white-space:nowrap;color:rgb(85,85,85)">Bruce</span></div><div><br></div><div><font color="#555555"><span style="font-size:12.8px;white-space:nowrap"><br></span></font></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Regards,<br>
<br>
&gt; &gt; &gt; Signed-off-by: Alexandru But &lt;<a href="mailto:alexandru.but@ni.com" target="_blank">alexandru.but@ni.com</a>&gt;<br>
&gt; &gt; &gt; ---<br>
&gt; &gt; &gt;  ...he-compiler-doesn-t-like-0-as-an-initiali.patch | 42 ++++++++++++++++++++++<br>
&gt; &gt; &gt;  meta-oe/recipes-extended/efivar/<a href="http://efivar_0.21.bb" rel="noreferrer" target="_blank">efivar_0.21.bb</a>     |  3 +-<br>
&gt; &gt; &gt;  2 files changed, 44 insertions(+), 1 deletion(-)<br>
&gt; &gt; &gt;  create mode 100644 meta-oe/recipes-extended/efivar/efivar/0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; diff --git a/meta-oe/recipes-extended/efivar/efivar/0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch b/meta-oe/recipes-extended/efivar/efivar/0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch<br>
&gt; &gt; &gt; new file mode 100644<br>
&gt; &gt; &gt; index 0000000..68cabd6<br>
&gt; &gt; &gt; --- /dev/null<br>
&gt; &gt; &gt; +++ b/meta-oe/recipes-extended/efivar/efivar/0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch<br>
&gt; &gt; &gt; @@ -0,0 +1,42 @@<br>
&gt; &gt; &gt; +From a3606c02fd271d32e364fcc540e34ba1899309f6 Mon Sep 17 00:00:00 2001<br>
&gt; &gt; &gt; +From: Peter Jones &lt;<a href="mailto:pjones@redhat.com" target="_blank">pjones@redhat.com</a>&gt;<br>
&gt; &gt; &gt; +Date: Tue, 14 Jul 2015 09:33:54 -0400<br>
&gt; &gt; &gt; +Subject: [PATCH] Sometimes the compiler doesn&#39;t like { 0, } as an<br>
&gt; &gt; &gt; + initializer...<br>
&gt; &gt; &gt; +<br>
&gt; &gt; &gt; +Because it really wants to be { {0, },} or something, and sometimes the<br>
&gt; &gt; &gt; +compiler, knowing full well what we&#39;re trying to do, likes to complain<br>
&gt; &gt; &gt; +about the rigor applied to our technique in doing it.<br>
&gt; &gt; &gt; +<br>
&gt; &gt; &gt; +memset() the struct ifreq to 0 instead so I don&#39;t need to figure out its<br>
&gt; &gt; &gt; +internal structure just to zero it out.<br>
&gt; &gt; &gt; +<br>
&gt; &gt; &gt; +Resolves #28<br>
&gt; &gt; &gt; +<br>
&gt; &gt; &gt; +Signed-off-by: Peter Jones &lt;<a href="mailto:pjones@redhat.com" target="_blank">pjones@redhat.com</a>&gt;<br>
&gt; &gt; &gt; +---<br>
&gt; &gt; &gt; + src/linux.c | 3 ++-<br>
&gt; &gt; &gt; + 1 file changed, 2 insertions(+), 1 deletion(-)<br>
&gt; &gt; &gt; +<br>
&gt; &gt; &gt; +diff --git a/src/linux.c b/src/linux.c<br>
&gt; &gt; &gt; +index 57f71f3..817b8e6 100644<br>
&gt; &gt; &gt; +--- a/src/linux.c<br>
&gt; &gt; &gt; ++++ b/src/linux.c<br>
&gt; &gt; &gt; +@@ -847,12 +847,13 @@ ssize_t<br>
&gt; &gt; &gt; + __attribute__((__visibility__ (&quot;hidden&quot;)))<br>
&gt; &gt; &gt; + make_mac_path(uint8_t *buf, ssize_t size, const char * const ifname)<br>
&gt; &gt; &gt; + {<br>
&gt; &gt; &gt; +-        struct ifreq ifr = { 0, };<br>
&gt; &gt; &gt; ++        struct ifreq ifr;<br>
&gt; &gt; &gt; +         struct ethtool_drvinfo drvinfo = { 0, };<br>
&gt; &gt; &gt; +         int fd, rc;<br>
&gt; &gt; &gt; +         ssize_t ret = -1, sz, off=0;<br>
&gt; &gt; &gt; +         char busname[PATH_MAX+1] = &quot;&quot;;<br>
&gt; &gt; &gt; +<br>
&gt; &gt; &gt; ++        memset(&amp;ifr, 0, sizeof (ifr));<br>
&gt; &gt; &gt; +         strncpy(ifr.ifr_name, ifname, IF_NAMESIZE);<br>
&gt; &gt; &gt; +         drvinfo.cmd = ETHTOOL_GDRVINFO;<br>
&gt; &gt; &gt; +         ifr.ifr_data = (caddr_t)&amp;drvinfo;<br>
&gt; &gt; &gt; +--<br>
&gt; &gt; &gt; +2.6.1<br>
&gt; &gt; &gt; +<br>
&gt; &gt; &gt; diff --git a/meta-oe/recipes-extended/efivar/<a href="http://efivar_0.21.bb" rel="noreferrer" target="_blank">efivar_0.21.bb</a> b/meta-oe/recipes-extended/efivar/<a href="http://efivar_0.21.bb" rel="noreferrer" target="_blank">efivar_0.21.bb</a><br>
&gt; &gt; &gt; index b5ef90a..1684a10 100644<br>
&gt; &gt; &gt; --- a/meta-oe/recipes-extended/efivar/<a href="http://efivar_0.21.bb" rel="noreferrer" target="_blank">efivar_0.21.bb</a><br>
&gt; &gt; &gt; +++ b/meta-oe/recipes-extended/efivar/<a href="http://efivar_0.21.bb" rel="noreferrer" target="_blank">efivar_0.21.bb</a><br>
&gt; &gt; &gt; @@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = &quot;file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393&quot;<br>
&gt; &gt; &gt;  DEPENDS_class-target = &quot;popt efivar-native&quot;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;  SRCREV = &quot;aab6c2a64d90b6e5a63661fb5bd6be8d878b0784&quot;<br>
&gt; &gt; &gt; -SRC_URI = &quot;git://<a href="http://github.com/rhinstaller/efivar.git" rel="noreferrer" target="_blank">github.com/rhinstaller/efivar.git</a>&quot;<br>
&gt; &gt; &gt; +SRC_URI = &quot;git://<a href="http://github.com/rhinstaller/efivar.git" rel="noreferrer" target="_blank">github.com/rhinstaller/efivar.git</a> \<br>
&gt; &gt; &gt; +           file://0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch&quot;<br>
&gt; &gt; &gt;  SRC_URI_append_class-target = &quot; file://0001-efivar-fix-for-cross-compile.patch&quot;<br>
&gt; &gt; &gt;  SRC_URI_append_class-native = &quot; file://efivar-drop-options-not-supported-by-lower-version-gcc.patch&quot;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt; 2.6.1<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; Openembedded-devel mailing list<br>
&gt; &gt; &gt; <a href="mailto:Openembedded-devel@lists.openembedded.org" target="_blank">Openembedded-devel@lists.openembedded.org</a><br>
&gt; &gt; &gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-devel" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-devel</a><br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Martin &#39;JaMa&#39; Jansa     jabber: <a href="mailto:Martin.Jansa@gmail.com" target="_blank">Martin.Jansa@gmail.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &gt; --<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Openembedded-devel mailing list<br>
&gt; &gt; <a href="mailto:Openembedded-devel@lists.openembedded.org" target="_blank">Openembedded-devel@lists.openembedded.org</a><br>
&gt; &gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-devel" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-devel</a><br>
<span><font color="#888888">&gt;<br>
&gt; --<br>
&gt; _______________________________________________<br>
&gt; Openembedded-devel mailing list<br>
&gt; <a href="mailto:Openembedded-devel@lists.openembedded.org" target="_blank">Openembedded-devel@lists.openembedded.org</a><br>
&gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-devel" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-devel</a><br>
<br>
--<br>
Martin &#39;JaMa&#39; Jansa     jabber: <a href="mailto:Martin.Jansa@gmail.com" target="_blank">Martin.Jansa@gmail.com</a><br>
</font></span><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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>&quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end&quot;</div>
</div></div>