On Thu, Sep 28, 2017 at 2:05 PM, Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx> wrote:
On Thu, Sep 28, 2017 at 12:25 AM, Eric Blake <eblake@xxxxxxxxxx> wrote:[adding gnulib]
[...]
then libvirt needs to pick up the
updated gnulib.I copied in current gnulib from git and it didn't resolve yet. But maybe it is just something that still is work in progress.
Until there is a final and better solution is available the following patch avoids the issue without fully skipping the test for now.
Since the issue seems only to apply to getopt, but not getopt_long and the code doesn't use that in anything except examples it might be a valid interim helper until glibc/gnulib sorted out how that is handled more correctly.
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
Description: fix gnulib unittests with glibc 2.26 Due to glibc and gnulib exchanging and syncing getopt implementations it now uses the implementation form glibc but expects the former gnulib behavior. Until fully resolved override the test include to use gnulib function as it used to be before. It is somewhat ok to do so as the only real user of getopt so far is an example at examples/admin/logging.c. All others use getopt_long which does not have this function name collision between unistd.h and getopt.h. Note: to be replaced by the final fix as soon as that is available. Forwarded: yes https://www.redhat.com/archives/libvir-list/2017-September/msg01039.html Author: Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx> Bug-Ubuntu: https://bugs.launchpad.net/bugs/1718668 Last-Update: 2017-09-28 test-getopt-posix.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/gnulib/tests/test-getopt-posix.c +++ b/gnulib/tests/test-getopt-posix.c @@ -22,6 +22,13 @@ ftell link warning if we are not using the gnulib ftell module. */ #define _GL_NO_LARGE_FILES +/* + * Glibc 2.26 does hard include bits/getopt_posix.h which causes the system + * to use glibc's getopt but the tests expect gnulib behavior. Until a better + * fix is available this avoids that mis-resolution. + */ +#include <getopt.h> + /* POSIX and glibc provide the getopt() function in <unistd.h>, see http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list