[PATCH] configure: fix GLIB_VERSION for cross-compilation

Paolo Bonzini posted 1 patch 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230107133258.110125-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] configure: fix GLIB_VERSION for cross-compilation
Posted by Paolo Bonzini 1 year, 4 months ago
configure uses "pkg-config" directly so that GLIB_VERSION is always based
on host glib version.   To correctly handle cross-compilation it should use
"$pkg_config" and take GLIB_VERSION from the cross-compiled glib.

Reported-by: Валентин <val15032008@mail.ru>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1414
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 22818926576c..6f5e77a71361 100755
--- a/configure
+++ b/configure
@@ -2375,7 +2375,7 @@ echo "QEMU_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak
 echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
 echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
 echo "GLIB_BINDIR=$glib_bindir" >> $config_host_mak
-echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak
+echo "GLIB_VERSION=$($pkg_config --modversion glib-2.0)" >> $config_host_mak
 echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
 echo "EXESUF=$EXESUF" >> $config_host_mak
 
-- 
2.38.1


Re: [PATCH] configure: fix GLIB_VERSION for cross-compilation
Posted by Philippe Mathieu-Daudé 1 year, 4 months ago
On 7/1/23 14:32, Paolo Bonzini wrote:
> configure uses "pkg-config" directly so that GLIB_VERSION is always based
> on host glib version.   To correctly handle cross-compilation it should use
> "$pkg_config" and take GLIB_VERSION from the cross-compiled glib.
> 
> Reported-by: Валентин <val15032008@mail.ru>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1414
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   configure | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>