[libvirt] gnulib tests in libvirt broken by newer glibc 2.26
Daniel P. Berrange
berrange at redhat.com
Mon Oct 9 10:07:42 UTC 2017
On Fri, Oct 06, 2017 at 07:59:13PM +0200, Bruno Haible wrote:
> 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
Tested-by: Daniel P. Berrange <berrange at redhat.com>
Confirmed it fixes the failure on Fedora 28, and does not cause a regression
on Fedora 26 with older glibc.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list