From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgXw9-0004Bl-R4 for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:21:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgXw6-0004g7-Lx for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:21:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgXw6-0004fv-Gv for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:21:26 -0400 Date: Fri, 10 Apr 2015 13:21:23 +0100 From: Stefan Hajnoczi Message-ID: <20150410122123.GN23555@stefanha-thinkpad.redhat.com> References: <1428615372-615-1-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nb8zVy0QMK3AA1xu" Content-Disposition: inline In-Reply-To: <1428615372-615-1-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH] configure: improve multiarch support for pkgconfig List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, pbonzini@redhat.com --nb8zVy0QMK3AA1xu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 09, 2015 at 05:36:12PM -0400, John Snow wrote: > This will improve the multi-arch compilation for hosts using gcc. > configurations using clang won't see an improvement, but also won't > see a regression. The commit description does not explain what this patch "improves". Please add this explanation (or something equivalent) when merging: 32-bit compilation on 64-bit hosts is broken because pkgconfig isn't multi-arch aware and selects the 64-bit glibconfig.h header file. That file assumes the LP64 data model so guint64 is defined as unsigned long. This does not work for 32-bit builds where sizeof(unsigned long) =3D=3D 4 bytes. This patch makes "./configure --extra-cflags=3D-m32" just work by pointing pkgconfig at the correct .pc files. > Signed-off-by: John Snow > --- > configure | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > diff --git a/configure b/configure > index 826d6fd..d27729a 100755 > --- a/configure > +++ b/configure > @@ -1759,6 +1759,20 @@ if ! has "$pkg_config_exe"; then > fi > =20 > ########################################## > +# pkg-config multi-arch probe > + > +if $cc -print-multiarch >/dev/null 2>&1; then > + mlibdir=3D$($cc -print-multiarch $QEMU_CFLAGS) > +fi > +if test -z "${mlibdir}"; then > + mlibdir=3D$($cc --print-multi-os-directory $QEMU_CFLAGS) > +fi > + > +if [ -n "${mlibdir}" ] && [ -d "/usr/lib/${mlibdir}/pkgconfig" ]; then > + export PKG_CONFIG_LIBDIR=3D"/usr/lib/${mlibdir}/pkgconfig" > +fi > + > +########################################## > # NPTL probe Reviewed-by: Stefan Hajnoczi --nb8zVy0QMK3AA1xu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVJ8BDAAoJEJykq7OBq3PIynEIAJKw0MlHK4bd3jKsByAEezzc oFitgaMHJmqb1FIqfKHyu2a11ylmlbNWrNPAz8Eud1LeLLHfI5pwNjlybmiH/nmN 68a8Z3ayA88v2JOQYjvdG+OpYRy17NAPIXSNdsYGFsw2sy+zvDyY9oLxYWtra9eF 62DLlRpfHHHW0M4XWpvBfJCZNl8/2T79398yY0IOzXv67UKcy4CoHBWahgdMECBY MhcimnpILlULIyx6QPD1tcc0Z+JErEgBjAgTCHQUOpqlr+QbfKKnMs9gf590Ino8 jxOtVz2V09kYQElfRaOSu85wqoWaNDgbAApd5tfnu+AH9XpUibaaiIRvftl88sc= =eZF/ -----END PGP SIGNATURE----- --nb8zVy0QMK3AA1xu--