[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] configure: improve multiarch support for pkgcon
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] configure: improve multiarch support for pkgconfig |
Date: |
Fri, 10 Apr 2015 13:21:23 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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) == 4
bytes.
This patch makes "./configure --extra-cflags=-m32" just work by pointing
pkgconfig at the correct .pc files.
> Signed-off-by: John Snow <address@hidden>
> ---
> configure | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> 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
>
> ##########################################
> +# pkg-config multi-arch probe
> +
> +if $cc -print-multiarch >/dev/null 2>&1; then
> + mlibdir=$($cc -print-multiarch $QEMU_CFLAGS)
> +fi
> +if test -z "${mlibdir}"; then
> + mlibdir=$($cc --print-multi-os-directory $QEMU_CFLAGS)
> +fi
> +
> +if [ -n "${mlibdir}" ] && [ -d "/usr/lib/${mlibdir}/pkgconfig" ]; then
> + export PKG_CONFIG_LIBDIR="/usr/lib/${mlibdir}/pkgconfig"
> +fi
> +
> +##########################################
> # NPTL probe
Reviewed-by: Stefan Hajnoczi <address@hidden>
pgpOfDZ2vQTZ_.pgp
Description: PGP signature