All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows
@ 2017-03-22 13:09 Sameeh Jubran
  2017-03-22 13:21 ` Peter Maydell
  2017-03-22 13:29 ` Marc-André Lureau
  0 siblings, 2 replies; 5+ messages in thread
From: Sameeh Jubran @ 2017-03-22 13:09 UTC (permalink / raw)
  To: qemu-devel, Michael Roth; +Cc: Yan Vugenfirer, Stefan Hajnoczi, Peter Maydell

Attempting to compile qemu-ga statically as follows for Windows causes
the following error:

Compilation:
    ./configure --disable-docs --target-list=x86_64-softmmu \
    --cross-prefix=x86_64-w64-mingw32- --static \
    --enable-guest-agent-msi --with-vss-sdk=/path/to/VSSSDK72

    make -j8 qemu-ga

Error:
    path/to/qemu/stubs/error-printf.c:7: undefined reference to `__imp_g_test_config_vars'
    collect2: error: ld returned 1 exit status
    Makefile:444: recipe for target 'qemu-ga.exe' failed
    make: *** [qemu-ga.exe] Error 1

This is caused by a bug in the pkg-config file for glib as it doesn't define
GLIB_STATIC_COMPILATION for pkg-config --static.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index b9a30cf..6f7b460 100755
--- a/configure
+++ b/configure
@@ -4138,7 +4138,7 @@ int main(void) { return VSS_CTX_BACKUP; }
 EOF
   if compile_prog "$vss_win32_include" "" ; then
     guest_agent_with_vss="yes"
-    QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
+    QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS $vss_win32_include"
     libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga"
     qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb"
   else
-- 
2.9.3

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

* Re: [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows
  2017-03-22 13:09 [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows Sameeh Jubran
@ 2017-03-22 13:21 ` Peter Maydell
  2017-03-22 14:12   ` Sameeh Jubran
  2017-03-22 13:29 ` Marc-André Lureau
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2017-03-22 13:21 UTC (permalink / raw)
  To: Sameeh Jubran
  Cc: QEMU Developers, Michael Roth, Yan Vugenfirer, Stefan Hajnoczi

On 22 March 2017 at 13:09, Sameeh Jubran <sameeh@daynix.com> wrote:
> Attempting to compile qemu-ga statically as follows for Windows causes
> the following error:
>
> Compilation:
>     ./configure --disable-docs --target-list=x86_64-softmmu \
>     --cross-prefix=x86_64-w64-mingw32- --static \
>     --enable-guest-agent-msi --with-vss-sdk=/path/to/VSSSDK72
>
>     make -j8 qemu-ga
>
> Error:
>     path/to/qemu/stubs/error-printf.c:7: undefined reference to `__imp_g_test_config_vars'
>     collect2: error: ld returned 1 exit status
>     Makefile:444: recipe for target 'qemu-ga.exe' failed
>     make: *** [qemu-ga.exe] Error 1
>
> This is caused by a bug in the pkg-config file for glib as it doesn't define
> GLIB_STATIC_COMPILATION for pkg-config --static.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
> Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
> @@ -4138,7 +4138,7 @@ int main(void) { return VSS_CTX_BACKUP; }
>  EOF
>    if compile_prog "$vss_win32_include" "" ; then
>      guest_agent_with_vss="yes"
> -    QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
> +    QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS $vss_win32_include"
>      libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga"
>      qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb"
>    else

If we need this for static glib compilation we should
be adding it where we do the "test for glib and
add glib related flags to the CFLAGS", not in the
part of configure where we decide that we're
compiling the guest agent.

Also, please can we have a comment that clearly states
why we need this and that we're working around a
packaging bug in glib for Windows, please?

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows
  2017-03-22 13:09 [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows Sameeh Jubran
  2017-03-22 13:21 ` Peter Maydell
@ 2017-03-22 13:29 ` Marc-André Lureau
  2017-03-22 14:11   ` Sameeh Jubran
  1 sibling, 1 reply; 5+ messages in thread
From: Marc-André Lureau @ 2017-03-22 13:29 UTC (permalink / raw)
  To: Sameeh Jubran, qemu-devel, Michael Roth
  Cc: Yan Vugenfirer, Stefan Hajnoczi, Peter Maydell

Hi

On Wed, Mar 22, 2017 at 5:11 PM Sameeh Jubran <sameeh@daynix.com> wrote:

> Attempting to compile qemu-ga statically as follows for Windows causes
> the following error:
>
> Compilation:
>     ./configure --disable-docs --target-list=x86_64-softmmu \
>     --cross-prefix=x86_64-w64-mingw32- --static \
>     --enable-guest-agent-msi --with-vss-sdk=/path/to/VSSSDK72
>
>     make -j8 qemu-ga
>
> Error:
>     path/to/qemu/stubs/error-printf.c:7: undefined reference to
> `__imp_g_test_config_vars'
>     collect2: error: ld returned 1 exit status
>     Makefile:444: recipe for target 'qemu-ga.exe' failed
>     make: *** [qemu-ga.exe] Error 1
>

weird, I don't get this error on fedora 25 (but I have no vss-sdk, is that
related?).


>
> This is caused by a bug in the pkg-config file for glib as it doesn't
> define
> GLIB_STATIC_COMPILATION for pkg-config --static.
>

If that's a bug in glib, it would be nice to have a link to a bug report.


>
> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
> Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
>
---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index b9a30cf..6f7b460 100755
> --- a/configure
> +++ b/configure
> @@ -4138,7 +4138,7 @@ int main(void) { return VSS_CTX_BACKUP; }
>  EOF
>    if compile_prog "$vss_win32_include" "" ; then
>      guest_agent_with_vss="yes"
> -    QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
> +    QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS
> $vss_win32_include"
>      libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++
> -Wl,--enable-stdcall-fixup $libs_qga"
>      qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb"
>    else
> --
> 2.9.3
>
>
> --
Marc-André Lureau

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

* Re: [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows
  2017-03-22 13:29 ` Marc-André Lureau
@ 2017-03-22 14:11   ` Sameeh Jubran
  0 siblings, 0 replies; 5+ messages in thread
From: Sameeh Jubran @ 2017-03-22 14:11 UTC (permalink / raw)
  To: Marc-André Lureau
  Cc: qemu-devel, Michael Roth, Yan Vugenfirer, Stefan Hajnoczi, Peter Maydell

On Wed, Mar 22, 2017 at 3:29 PM, Marc-André Lureau <
marcandre.lureau@gmail.com> wrote:

> Hi
>
> On Wed, Mar 22, 2017 at 5:11 PM Sameeh Jubran <sameeh@daynix.com> wrote:
>
>> Attempting to compile qemu-ga statically as follows for Windows causes
>> the following error:
>>
>> Compilation:
>>     ./configure --disable-docs --target-list=x86_64-softmmu \
>>     --cross-prefix=x86_64-w64-mingw32- --static \
>>     --enable-guest-agent-msi --with-vss-sdk=/path/to/VSSSDK72
>>
>>     make -j8 qemu-ga
>>
>> Error:
>>     path/to/qemu/stubs/error-printf.c:7: undefined reference to
>> `__imp_g_test_config_vars'
>>     collect2: error: ld returned 1 exit status
>>     Makefile:444: recipe for target 'qemu-ga.exe' failed
>>     make: *** [qemu-ga.exe] Error 1
>>
>
> weird, I don't get this error on fedora 25 (but I have no vss-sdk, is that
> related?).
>
Can you please try it with vss-sdk (
https://www.microsoft.com/en-us/download/details.aspx?id=23490)

>
>
>>
>> This is caused by a bug in the pkg-config file for glib as it doesn't
>> define
>> GLIB_STATIC_COMPILATION for pkg-config --static.
>>
>
> If that's a bug in glib, it would be nice to have a link to a bug report.
>
I've just filed a bug report:
https://bugzilla.gnome.org/show_bug.cgi?id=780399
<https://bugzilla.gnome.org/show_bug.cgi?id=780399>

>
>
>>
>> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
>> Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
>>
> ---
>>  configure | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index b9a30cf..6f7b460 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4138,7 +4138,7 @@ int main(void) { return VSS_CTX_BACKUP; }
>>  EOF
>>    if compile_prog "$vss_win32_include" "" ; then
>>      guest_agent_with_vss="yes"
>> -    QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
>> +    QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS
>> $vss_win32_include"
>>      libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++
>> -Wl,--enable-stdcall-fixup $libs_qga"
>>      qga_vss_provider="qga/vss-win32/qga-vss.dll
>> qga/vss-win32/qga-vss.tlb"
>>    else
>> --
>> 2.9.3
>>
>>
>> --
> Marc-André Lureau
>



-- 
Respectfully,
*Sameeh Jubran*
*Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>*
*Software Engineer @ Daynix <http://www.daynix.com>.*

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

* Re: [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows
  2017-03-22 13:21 ` Peter Maydell
@ 2017-03-22 14:12   ` Sameeh Jubran
  0 siblings, 0 replies; 5+ messages in thread
From: Sameeh Jubran @ 2017-03-22 14:12 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Developers, Michael Roth, Yan Vugenfirer, Stefan Hajnoczi

On Wed, Mar 22, 2017 at 3:21 PM, Peter Maydell <peter.maydell@linaro.org>
wrote:

> On 22 March 2017 at 13:09, Sameeh Jubran <sameeh@daynix.com> wrote:
> > Attempting to compile qemu-ga statically as follows for Windows causes
> > the following error:
> >
> > Compilation:
> >     ./configure --disable-docs --target-list=x86_64-softmmu \
> >     --cross-prefix=x86_64-w64-mingw32- --static \
> >     --enable-guest-agent-msi --with-vss-sdk=/path/to/VSSSDK72
> >
> >     make -j8 qemu-ga
> >
> > Error:
> >     path/to/qemu/stubs/error-printf.c:7: undefined reference to
> `__imp_g_test_config_vars'
> >     collect2: error: ld returned 1 exit status
> >     Makefile:444: recipe for target 'qemu-ga.exe' failed
> >     make: *** [qemu-ga.exe] Error 1
> >
> > This is caused by a bug in the pkg-config file for glib as it doesn't
> define
> > GLIB_STATIC_COMPILATION for pkg-config --static.
> >
> > Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
> > Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
> > @@ -4138,7 +4138,7 @@ int main(void) { return VSS_CTX_BACKUP; }
> >  EOF
> >    if compile_prog "$vss_win32_include" "" ; then
> >      guest_agent_with_vss="yes"
> > -    QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
> > +    QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS
> $vss_win32_include"
> >      libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++
> -Wl,--enable-stdcall-fixup $libs_qga"
> >      qga_vss_provider="qga/vss-win32/qga-vss.dll
> qga/vss-win32/qga-vss.tlb"
> >    else
>
> If we need this for static glib compilation we should
> be adding it where we do the "test for glib and
> add glib related flags to the CFLAGS", not in the
> part of configure where we decide that we're
> compiling the guest agent.
>
> Also, please can we have a comment that clearly states
> why we need this and that we're working around a
> packaging bug in glib for Windows, please?
>
sure, no problem.

>
> thanks
> -- PMM
>



-- 
Respectfully,
*Sameeh Jubran*
*Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>*
*Software Engineer @ Daynix <http://www.daynix.com>.*

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

end of thread, other threads:[~2017-03-22 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-22 13:09 [Qemu-devel] [PATCH qemu-ga] qga: Make qemu-ga compile statically for Windows Sameeh Jubran
2017-03-22 13:21 ` Peter Maydell
2017-03-22 14:12   ` Sameeh Jubran
2017-03-22 13:29 ` Marc-André Lureau
2017-03-22 14:11   ` Sameeh Jubran

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.