From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNiQp-0002RD-P0 for qemu-devel@nongnu.org; Mon, 25 Jan 2016 09:47:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNiQl-0007yr-Fe for qemu-devel@nongnu.org; Mon, 25 Jan 2016 09:47:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNiQl-0007yQ-8Y for qemu-devel@nongnu.org; Mon, 25 Jan 2016 09:47:47 -0500 Date: Mon, 25 Jan 2016 14:47:42 +0000 From: "Daniel P. Berrange" Message-ID: <20160125144741.GC8866@redhat.com> References: <1447414307-5295-1-git-send-email-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] configure: sanity check the glib library that pkg-config finds Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , QEMU Developers , "Dr. David Alan Gilbert" On Mon, Jan 25, 2016 at 02:42:10PM +0000, Peter Maydell wrote: > On 13 November 2015 at 11:31, Daniel P. Berrange = wrote: > > Developers on 64-bit machines will often try to perform a > > 32-bit build of QEMU by running > > > > ./configure --extra-cflags=3D"-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 =E2=80=98qmp_guest_set_user_passwor= d=E2=80=99: > > qga/commands-posix.c:1912:55: error: passing argument 2 of =E2=80=98g= _base64_decode=E2=80=99 from incompatible pointer type [-Werror=3Dincompa= tible-pointer-types] > > rawpasswddata =3D (char *)g_base64_decode(password, &rawpasswdle= n); > > ^ > > 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 =E2=80=98gs= ize * {aka long unsigned int *}=E2=80=99 but argument is of type =E2=80=98= size_t * {aka unsigned int *}=E2=80=99 > > 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=3D/usr/lib/pkgconfig ./configure --extra-cflags=3D= "-m32" > > # PKG_CONFIG_LIBDIR=3D/usr/lib64/pkgconfig ./configure --extra-cflag= s=3D"-m64" > > > > And fails with a mis-match > > > > # PKG_CONFIG_LIBDIR=3D/usr/lib64/pkgconfig ./configure --extra-cflag= s=3D"-m32" > > # PKG_CONFIG_LIBDIR=3D/usr/lib/pkgconfig ./configure --extra-cflags=3D= "-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 >=20 > I just noticed this never got applied to master -- did it just fall thr= ough > the cracks, or is there an issue with it? AFAIK, no one raised a blocking issue with it. Regards, Daniel --=20 |: http://berrange.com -o- http://www.flickr.com/photos/dberrange= / :| |: http://libvirt.org -o- http://virt-manager.or= g :| |: http://autobuild.org -o- http://search.cpan.org/~danberr= / :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vn= c :|