[libvirt] gnulib tests in libvirt broken by newer glibc 2.26

Bruno Haible bruno at clisp.org
Fri Oct 6 17:59:13 UTC 2017


Daniel P. Berrange wrote:
> From my own F28 rawhide install with glibc-2.26.90-16.fc28.x86_64
> 
> > 
> >   1) The output of
> >      $ nm test-getopt-posix | grep getopt
> 
> $ nm test-getopt-posix | grep getopt
>                  U getopt@@GLIBC_2.2.5
> 0000000000400ab0 t getopt_loop.constprop.0
> 0000000000400c50 t test_getopt
> 
> 
> >   2) The output of
> >      $ gcc -DHAVE_CONFIG_H -DGNULIB_STRICT_CHECKING=1 -I. -I.. -I../gllib -g -O2 -E test-getopt-posix.c
> 
> Attached in the file 'question-2.txt'
> 
> > 
> >   3) The output of
> >      $ gcc -DHAVE_CONFIG_H -DGNULIB_STRICT_CHECKING=1 -I. -I.. -I../gllib -g -O2 -E -dM test-getopt-posix.c
> 
> Attached in the file 'question-3.txt'

Thanks. From this, I can see that getopt-pfx-core.h does not get included
at all. Please try this patch (or, if you don't want to re-run configure,
just remove the "&& !defined __GLIBC__" from the generated unistd.h).


diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 748112f..b5b6e0e 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -134,9 +134,8 @@
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
-/* Get getopt(), optarg, optind, opterr, optopt.
-   But avoid namespace pollution on glibc systems.  */
-#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
+/* Get getopt(), optarg, optind, opterr, optopt.  */
+#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
 # include <getopt-cdefs.h>
 # include <getopt-pfx-core.h>
 #endif




More information about the libvir-list mailing list