<div dir="ltr"><p id="gmail-yui_3_10_3_1_1506351361291_2622" style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Hi,<br>there seems to be an incompatibility to the last glibc due to [1].</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Eventually this breaks gnulib unittests (and maybe more).<br>Debugging went from an assert, to bidngin different symbols, to changed function names to different header resolution.</p><p id="gmail-yui_3_10_3_1_1506351361291_2615" style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Because it expects it to behave "posixly" but arguments are changed differently.<br>FAIL: test-getopt-posix<br>=======<wbr>=======<wbr>=======<wbr>==</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">../../.<wbr>./../gnulib/<wbr>tests/test-<wbr>getopt.<wbr>h:754: assertion 'strcmp (argv[1], "donald") == 0' failed</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"># get and build latest libvirt to get the local gnulib<br>$ wget <a rel="nofollow" href="http://libvirt.org/sources/libvirt-3.7.0.tar.xz" style="color:rgb(0,51,170);text-decoration-line:none">http://<wbr>libvirt.<wbr>org/sources/<wbr>libvirt-<wbr>3.7.0.tar.<wbr>xz</a><br>$ tar xf libvirt-<wbr>3.7.0.tar.<wbr>xz<br>$ cd libvirt<br>$ apt build-dep libvirt<br>$ ./autogen.sh<br>$ make -j4</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">You can run the following simplified test derived from the unit test (it is much shorter, so easier to debug e.g. in -E).</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">$ cat << EOF >> test1.c<br>#include <config.h><br>#include <unistd.h></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">#include <stdbool.h><br>#include <stdio.h><br>#include <stdlib.h></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">int main (void)<br>{<br>        return 0;<br>}<br>EOF<br>$ gcc -I ./gnulib/lib -I . test1.c -H</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">You can see in -H output already the difference in the paths of the headers that it uses:</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Glibc <2.26<br>. ./config.h<br>.. ./config-post.h<br>. /usr/include/<wbr>unistd.<wbr>h<br>[...]<br>.. /usr/include/<wbr>getopt.<wbr>h</p><p id="gmail-yui_3_10_3_1_1506351361291_2624" style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Glibc >=2.26<br>. ./config.h<br>.. ./config-post.h<br>. ./gnulib/<wbr>lib/unistd.<wbr>h<br>[...]</p><p id="gmail-yui_3_10_3_1_1506351361291_2624" style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><span style="color:rgb(0,0,0)">... /usr/include/x86_64-linux-gnu/bits/getopt_posix.h
</span><br>.... /usr/include/x86_64-linux-gnu/bits/getopt_core.<br></p><p id="gmail-yui_3_10_3_1_1506351361291_2624" style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><br></p><p id="gmail-yui_3_10_3_1_1506351361291_2624" style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">If you build with -E you'll also see that it now uses getopt from glibc instead of the prefixed rpl_getopt from gnulib.<br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">It behaves as if it would not find gnulib and instead fall back to glibc. But it finds gnulib, instead due to glibc's changes its implementation is fetched before and due to that pulling in glibc's behavior while the unit test is verifying against the one it expects from gnulib.</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px"><br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Sorry, but I don't see the right fix here yet - I could easily silence the test but that is no fix. Especially if there might be implications due to handling the args (slightly) differently.</p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">I really wanted to come up with the same test against gnulib alone, but I was lost in the build system for too long and could not get the example to fail without libvirt (OTOH I'm sure it would).<br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">Therefore I'm reaching out to you for your help and experience on the build system what could be done.<br></p><p style="margin:0px 0px 0.8em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:monospace;font-size:12px">[1]: <a rel="nofollow" href="https://sourceware.org/ml/libc-alpha/2017-04/msg00115.html" style="color:rgb(0,51,170);text-decoration-line:none">https:/<wbr>/sourceware.<wbr>org/ml/<wbr>libc-alpha/<wbr>2017-04/<wbr>msg00115.<wbr>html</a></p><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(136,136,136);font-size:12.8px">Christian Ehrhardt</span><div style="color:rgb(136,136,136);font-size:12.8px">Software Engineer, Ubuntu Server</div><div style="color:rgb(136,136,136);font-size:12.8px">Canonical Ltd</div></div></div></div></div>
</div>