All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status
@ 2018-09-04  7:02 Thomas Huth
  2018-09-04 10:35 ` Peter Maydell
  2018-09-04 10:43 ` Daniel P. Berrangé
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Huth @ 2018-09-04  7:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, qemu-trivial

When cross-compiling QEMU for a target that significantly differs from
the host, the current information in config.status is not enough to
properly re-create the configuration. For example when I try to test
my build with the mingw32 cross-compiler, I regularly get this error
after the build system tried to re-create the configuration with the
config.status file:

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

A similar problem exists for the "windres" tool, where you have to
set the WINDRES variable in case it has a different name.
So let's fix these issues by storing the configuration for these
variables in the config.status file, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configure b/configure
index 58862d2..4d8888f 100755
--- a/configure
+++ b/configure
@@ -7534,6 +7534,12 @@ cat <<EOD >config.status
 # Compiler output produced by configure, useful for debugging
 # configure, is in config.log if it exists.
 EOD
+if [ -n "$PKG_CONFIG_LIBDIR" ]; then
+    echo "export PKG_CONFIG_LIBDIR=\"$PKG_CONFIG_LIBDIR\"" >>config.status
+fi
+if [ -n "$WINDRES" ]; then
+    echo "export WINDRES=\"$WINDRES\"" >>config.status
+fi
 printf "exec" >>config.status
 printf " '%s'" "$0" "$@" >>config.status
 echo ' "$@"' >>config.status
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status
  2018-09-04  7:02 [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status Thomas Huth
@ 2018-09-04 10:35 ` Peter Maydell
  2018-09-04 10:53   ` Thomas Huth
  2018-09-04 10:43 ` Daniel P. Berrangé
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2018-09-04 10:35 UTC (permalink / raw)
  To: Thomas Huth; +Cc: QEMU Developers, QEMU Trivial, Stefan Weil

On 4 September 2018 at 08:02, Thomas Huth <thuth@redhat.com> wrote:
> When cross-compiling QEMU for a target that significantly differs from
> the host, the current information in config.status is not enough to
> properly re-create the configuration. For example when I try to test
> my build with the mingw32 cross-compiler, I regularly get this error
> after the build system tried to re-create the configuration with the
> config.status file:
>
> 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
>RAND
> A similar problem exists for the "windres" tool, where you have to
> set the WINDRES variable in case it has a different name.
> So let's fix these issues by storing the configuration for theseq
> variables in the config.status file, too.

This is also true if the user set CC or RANLIB or any of a bunch
of other environment variables that configure uses. If we're going
to store those settings in config.status we should consistently
do it for all environment variables we care about, I think.

What does autoconf do for the equivalent situation?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status
  2018-09-04  7:02 [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status Thomas Huth
  2018-09-04 10:35 ` Peter Maydell
@ 2018-09-04 10:43 ` Daniel P. Berrangé
  2018-09-04 10:58   ` Thomas Huth
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel P. Berrangé @ 2018-09-04 10:43 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, qemu-trivial, Stefan Weil

On Tue, Sep 04, 2018 at 09:02:18AM +0200, Thomas Huth wrote:
> When cross-compiling QEMU for a target that significantly differs from
> the host, the current information in config.status is not enough to
> properly re-create the configuration. For example when I try to test
> my build with the mingw32 cross-compiler, I regularly get this error
> after the build system tried to re-create the configuration with the
> config.status file:
> 
> 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
> 
> A similar problem exists for the "windres" tool, where you have to
> set the WINDRES variable in case it has a different name.
> So let's fix these issues by storing the configuration for these
> variables in the config.status file, too.

Doh, I sent a patch to fix this problem more broadly years ago now:

  https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg04157.html

but it appears no maintainer ever merged it !

> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  configure | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/configure b/configure
> index 58862d2..4d8888f 100755
> --- a/configure
> +++ b/configure
> @@ -7534,6 +7534,12 @@ cat <<EOD >config.status
>  # Compiler output produced by configure, useful for debugging
>  # configure, is in config.log if it exists.
>  EOD
> +if [ -n "$PKG_CONFIG_LIBDIR" ]; then
> +    echo "export PKG_CONFIG_LIBDIR=\"$PKG_CONFIG_LIBDIR\"" >>config.status
> +fi
> +if [ -n "$WINDRES" ]; then
> +    echo "export WINDRES=\"$WINDRES\"" >>config.status
> +fi
>  printf "exec" >>config.status
>  printf " '%s'" "$0" "$@" >>config.status
>  echo ' "$@"' >>config.status

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status
  2018-09-04 10:35 ` Peter Maydell
@ 2018-09-04 10:53   ` Thomas Huth
  2018-09-04 12:12     ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2018-09-04 10:53 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Trivial, Stefan Weil, QEMU Developers

On 2018-09-04 12:35, Peter Maydell wrote:
> On 4 September 2018 at 08:02, Thomas Huth <thuth@redhat.com> wrote:
>> When cross-compiling QEMU for a target that significantly differs from
>> the host, the current information in config.status is not enough to
>> properly re-create the configuration. For example when I try to test
>> my build with the mingw32 cross-compiler, I regularly get this error
>> after the build system tried to re-create the configuration with the
>> config.status file:
>>
>> 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
>> RAND
>> A similar problem exists for the "windres" tool, where you have to
>> set the WINDRES variable in case it has a different name.
>> So let's fix these issues by storing the configuration for theseq
>> variables in the config.status file, too.
> 
> This is also true if the user set CC or RANLIB or any of a bunch
> of other environment variables that configure uses. If we're going
> to store those settings in config.status we should consistently
> do it for all environment variables we care about, I think.

Ok, never mind, forget about WINDRES (and the other tools like RANLIB),
that's not required, I just noticed that I simply forgot to specify
"--cross-prefix=i686-w64-mingw32-" when running configure. With that
option, i686-w64-mingw32-windres is properly used, and the pkg-config
problem also goes away since i686-w64-mingw32-pkg-config is used instead.

But still, I think at least the PKG_CONFIG_LIBDIR part could be useful,
since the same problem e.g. also occurs when trying do a 32-bit build on
a 64-bit host, i.e. when running configure with "--extra-cflags=-m32".
Or is there also another configure switch that can help to get
PKG_CONFIG_LIBDIR right here?

 Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status
  2018-09-04 10:43 ` Daniel P. Berrangé
@ 2018-09-04 10:58   ` Thomas Huth
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2018-09-04 10:58 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: qemu-trivial, Stefan Weil, qemu-devel

On 2018-09-04 12:43, Daniel P. Berrangé wrote:
> On Tue, Sep 04, 2018 at 09:02:18AM +0200, Thomas Huth wrote:
>> When cross-compiling QEMU for a target that significantly differs from
>> the host, the current information in config.status is not enough to
>> properly re-create the configuration. For example when I try to test
>> my build with the mingw32 cross-compiler, I regularly get this error
>> after the build system tried to re-create the configuration with the
>> config.status file:
>>
>> 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
>>
>> A similar problem exists for the "windres" tool, where you have to
>> set the WINDRES variable in case it has a different name.
>> So let's fix these issues by storing the configuration for these
>> variables in the config.status file, too.
> 
> Doh, I sent a patch to fix this problem more broadly years ago now:
> 
>   https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg04157.html
> 
> but it appears no maintainer ever merged it !

This certainly eases some configurations ... could you refresh the patch
and post it again?

 Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status
  2018-09-04 10:53   ` Thomas Huth
@ 2018-09-04 12:12     ` Peter Maydell
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2018-09-04 12:12 UTC (permalink / raw)
  To: Thomas Huth; +Cc: QEMU Trivial, Stefan Weil, QEMU Developers

On 4 September 2018 at 11:53, Thomas Huth <thuth@redhat.com> wrote:
> But still, I think at least the PKG_CONFIG_LIBDIR part could be useful,
> since the same problem e.g. also occurs when trying do a 32-bit build on
> a 64-bit host, i.e. when running configure with "--extra-cflags=-m32".
> Or is there also another configure switch that can help to get
> PKG_CONFIG_LIBDIR right here?

Personally I think the neatest way to handle 32-bit-build-on-64-bit-host
is to treat it like any other non-native build, ie have the distro
ship compiler, pkg-config, etc so that --cross-prefix=i686-linux-gnu-
works :-)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-04 12:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04  7:02 [Qemu-devel] [PATCH] configure: Save PKG_CONFIG_LIBDIR and WINDRES in config.status Thomas Huth
2018-09-04 10:35 ` Peter Maydell
2018-09-04 10:53   ` Thomas Huth
2018-09-04 12:12     ` Peter Maydell
2018-09-04 10:43 ` Daniel P. Berrangé
2018-09-04 10:58   ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.