qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] configure: sanity check the glib library that pkg-config finds
Date: Mon, 25 Jan 2016 14:47:42 +0000	[thread overview]
Message-ID: <20160125144741.GC8866@redhat.com> (raw)
In-Reply-To: <CAFEAcA-rXJoro9zxBODKXqpSX968bWCGseQurz2oBW0aAXUvNg@mail.gmail.com>

On Mon, Jan 25, 2016 at 02:42:10PM +0000, Peter Maydell wrote:
> On 13 November 2015 at 11:31, Daniel P. Berrange <berrange@redhat.com> wrote:
> > Developers on 64-bit machines will often try to perform a
> > 32-bit build of QEMU by running
> >
> >   ./configure --extra-cflags="-m32"
> >
> > Unfortunately if PKG_CONFIG_LIBDIR is not set to point to
> > the location of the 32-bit pkg-config files, then configure
> > will silently pick up the 64-bit pkg-config files and still
> > succeed.
> >
> > This causes a problem for glib because it means QEMU will
> > be pulling in /usr/lib64/glib-2.0/include/glibconfig.h
> > instead of /usr/lib/glib-2.0/include/glibconfig.h
> >
> > This causes problems because the 'gsize' type (defined as
> > 'unsigned long') will no longer be fully compatible with
> > the 'size_t' type (defined as 'unsigned int'). Although
> > both are the same size, the compiler refuses to allow
> > casts from 'unsigned long *' to 'unsigned int *' as they
> > are different pointer types. This results in non-obvious
> > compiler errors when building QEMU eg
> >
> > qga/commands-posix.c: In function ‘qmp_guest_set_user_password’:
> > qga/commands-posix.c:1912:55: error: passing argument 2 of ‘g_base64_decode’ from incompatible pointer type [-Werror=incompatible-pointer-types]
> >      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
> >                                                             ^
> > In file included from /usr/include/glib-2.0/glib.h:35:0,
> >                  from qga/commands-posix.c:14:
> > /usr/include/glib-2.0/glib/gbase64.h:52:9: note: expected ‘gsize * {aka long unsigned int *}’ but argument is of type ‘size_t * {aka unsigned int *}’
> >  guchar *g_base64_decode         (const gchar  *text,
> >          ^
> > cc1: all warnings being treated as errors
> >
> > To detect this problem, add a check to configure that
> > verifies that GLIB_SIZEOF_SIZE_T matches sizeof(size_t).
> > If this fails print a warning suggesting that the dev
> > probably needs to set PKG_CONFIG_LIBDIR.
> >
> > On Fedora x86_64 it passes with any of:
> >
> >  # ./configure
> >  # PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig ./configure --extra-cflags="-m32"
> >  # PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig ./configure --extra-cflags="-m64"
> >
> > And fails with a mis-match
> >
> >  # PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig ./configure --extra-cflags="-m32"
> >  # PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig ./configure --extra-cflags="-m64"
> >
> > ERROR: sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T.
> >        You probably need to set PKG_CONFIG_LIBDIR
> >        to point to the right pkg-config files for your
> >        build target
> >
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> 
> I just noticed this never got applied to master -- did it just fall through
> the cracks, or is there an issue with it?

AFAIK, no one raised a blocking issue with it.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2016-01-25 14:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 11:31 [Qemu-devel] [PATCH v2] configure: sanity check the glib library that pkg-config finds Daniel P. Berrange
2015-11-13 12:54 ` Dr. David Alan Gilbert
2015-11-13 13:01 ` Gerd Hoffmann
2015-11-17 17:25   ` Daniel P. Berrange
2015-11-13 13:01 ` Peter Maydell
2015-11-13 14:16   ` Daniel P. Berrange
2016-01-25 14:42 ` Peter Maydell
2016-01-25 14:47   ` Daniel P. Berrange [this message]
2016-01-25 14:58     ` Peter Maydell
2016-01-25 15:00       ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160125144741.GC8866@redhat.com \
    --to=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).