* [Qemu-devel] qemu-ga static compilation
@ 2017-03-14 16:51 Sameeh Jubran
2017-03-20 12:05 ` Sameeh Jubran
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Sameeh Jubran @ 2017-03-14 16:51 UTC (permalink / raw)
To: Michael Roth, qemu-devel
Hi all,
I am trying to compile qemu-ga for Windows statically using the following
commands:
./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
And I keep getting this error:
/home/sameeh/Builds/q/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
Notes to consider:
* without --static I can compile it successfully
* Build machine is running Fedora 25
* I have upgraded all of the tools to their latest version
* If I comment out the function which is causing the issue
(g_test_initialized()), qemu ga compiles statically and runs successfully
without the need of any dlls.
Can anyone reproduce this? Do you have any idea why is this happening?
--
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] 8+ messages in thread
* Re: [Qemu-devel] qemu-ga static compilation
2017-03-14 16:51 [Qemu-devel] qemu-ga static compilation Sameeh Jubran
@ 2017-03-20 12:05 ` Sameeh Jubran
2017-03-20 12:12 ` Peter Maydell
2017-03-20 13:57 ` Stefan Hajnoczi
2 siblings, 0 replies; 8+ messages in thread
From: Sameeh Jubran @ 2017-03-20 12:05 UTC (permalink / raw)
To: Michael Roth, qemu-devel
ping.
On Tue, Mar 14, 2017 at 6:51 PM, Sameeh Jubran <sameeh@daynix.com> wrote:
> Hi all,
>
> I am trying to compile qemu-ga for Windows statically using the following
> commands:
>
> ./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
>
>
> And I keep getting this error:
>
> /home/sameeh/Builds/q/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
>
>
> Notes to consider:
> * without --static I can compile it successfully
> * Build machine is running Fedora 25
> * I have upgraded all of the tools to their latest version
> * If I comment out the function which is causing the issue
> (g_test_initialized()), qemu ga compiles statically and runs successfully
> without the need of any dlls.
>
> Can anyone reproduce this? Do you have any idea why is this happening?
>
> --
> Respectfully,
> *Sameeh Jubran*
> *Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>*
> *Software Engineer @ Daynix <http://www.daynix.com>.*
>
--
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] 8+ messages in thread
* Re: [Qemu-devel] qemu-ga static compilation
2017-03-14 16:51 [Qemu-devel] qemu-ga static compilation Sameeh Jubran
2017-03-20 12:05 ` Sameeh Jubran
@ 2017-03-20 12:12 ` Peter Maydell
2017-03-20 13:57 ` Stefan Hajnoczi
2 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2017-03-20 12:12 UTC (permalink / raw)
To: Sameeh Jubran; +Cc: Michael Roth, QEMU Developers
On 14 March 2017 at 16:51, Sameeh Jubran <sameeh@daynix.com> wrote:
> Hi all,
>
> I am trying to compile qemu-ga for Windows statically using the following
> commands:
>
> ./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
>
>
> And I keep getting this error:
>
> /home/sameeh/Builds/q/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
My guess is that maybe some dependent library's pkg-config
configuration for static builds is broken. We run into this
from time to time, because most libraries don't get used in
static builds very often and so getting the config wrong
(forgetting to explicitly say that your library depends on
some other library) is a bug that tends to not get found quickly.
(For dynamic builds dependent libraries are implicitly pulled in.)
You could try to see if you can find which library actually defines
the missing symbol and whether supplying that -lwhatever on the
command line causes the build to complete.
Giving us the linker command line for the qemu-ga.exe would also
be useful info (if you pass make V=1 it will print command lines).
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] qemu-ga static compilation
2017-03-14 16:51 [Qemu-devel] qemu-ga static compilation Sameeh Jubran
2017-03-20 12:05 ` Sameeh Jubran
2017-03-20 12:12 ` Peter Maydell
@ 2017-03-20 13:57 ` Stefan Hajnoczi
2017-03-20 14:04 ` Peter Maydell
2017-03-20 15:44 ` Sameeh Jubran
2 siblings, 2 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2017-03-20 13:57 UTC (permalink / raw)
To: Sameeh Jubran; +Cc: Michael Roth, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]
On Tue, Mar 14, 2017 at 06:51:37PM +0200, Sameeh Jubran wrote:
> I am trying to compile qemu-ga for Windows statically using the following
> commands:
>
> ./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
>
>
> And I keep getting this error:
>
> /home/sameeh/Builds/q/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
>
>
> Notes to consider:
> * without --static I can compile it successfully
> * Build machine is running Fedora 25
> * I have upgraded all of the tools to their latest version
> * If I comment out the function which is causing the issue
> (g_test_initialized()), qemu ga compiles statically and runs successfully
> without the need of any dlls.
>
> Can anyone reproduce this? Do you have any idea why is this happening?
I guess GLIB_STATIC_COMPILATION is not defined in your build (see the
definition of GLIB_VAR in the glib headers).
The pkg-config file for glib doesn't define GLIB_STATIC_COMPILATION for
pkg-config --static. I guess we must add it manually.
Does this work?
diff --git a/configure b/configure
index 99d8bec..10f23b7 100755
--- a/configure
+++ b/configure
@@ -3047,6 +3047,10 @@ if test "$modules" = yes; then
glib_modules="$glib_modules gmodule-2.0"
fi
+if test "$static" = yes; then
+ QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS"
+fi
+
for i in $glib_modules; do
if $pkg_config --atleast-version=$glib_req_ver $i; then
glib_cflags=$($pkg_config --cflags $i)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] qemu-ga static compilation
2017-03-20 13:57 ` Stefan Hajnoczi
@ 2017-03-20 14:04 ` Peter Maydell
2017-03-20 15:44 ` Sameeh Jubran
1 sibling, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2017-03-20 14:04 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Sameeh Jubran, Michael Roth, QEMU Developers
On 20 March 2017 at 13:57, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> I guess GLIB_STATIC_COMPILATION is not defined in your build (see the
> definition of GLIB_VAR in the glib headers).
>
> The pkg-config file for glib doesn't define GLIB_STATIC_COMPILATION for
> pkg-config --static. I guess we must add it manually.
This seems like a pkg-config config file bug to me.
> Does this work?
>
> diff --git a/configure b/configure
> index 99d8bec..10f23b7 100755
> --- a/configure
> +++ b/configure
> @@ -3047,6 +3047,10 @@ if test "$modules" = yes; then
> glib_modules="$glib_modules gmodule-2.0"
> fi
>
> +if test "$static" = yes; then
> + QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS"
> +fi
> +
I know this is just a "let's see if this works" patch, but
some notes for if this becomes a real patch later:
If we work around this packaging bug in our configure script
we should have a comment stating that it's a workaround for
a packaging bug, and we should probably restrict it to only
being done for Windows builds.
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] qemu-ga static compilation
2017-03-20 13:57 ` Stefan Hajnoczi
2017-03-20 14:04 ` Peter Maydell
@ 2017-03-20 15:44 ` Sameeh Jubran
2017-03-21 9:23 ` Sameeh Jubran
1 sibling, 1 reply; 8+ messages in thread
From: Sameeh Jubran @ 2017-03-20 15:44 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Michael Roth, qemu-devel
On Mon, Mar 20, 2017 at 3:57 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Tue, Mar 14, 2017 at 06:51:37PM +0200, Sameeh Jubran wrote:
> > I am trying to compile qemu-ga for Windows statically using the following
> > commands:
> >
> > ./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
> >
> >
> > And I keep getting this error:
> >
> > /home/sameeh/Builds/q/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
> >
> >
> > Notes to consider:
> > * without --static I can compile it successfully
> > * Build machine is running Fedora 25
> > * I have upgraded all of the tools to their latest version
> > * If I comment out the function which is causing the issue
> > (g_test_initialized()), qemu ga compiles statically and runs successfully
> > without the need of any dlls.
> >
> > Can anyone reproduce this? Do you have any idea why is this happening?
>
> I guess GLIB_STATIC_COMPILATION is not defined in your build (see the
> definition of GLIB_VAR in the glib headers).
>
> The pkg-config file for glib doesn't define GLIB_STATIC_COMPILATION for
> pkg-config --static. I guess we must add it manually.
>
> Does this work?
>
> diff --git a/configure b/configure
> index 99d8bec..10f23b7 100755
> --- a/configure
> +++ b/configure
> @@ -3047,6 +3047,10 @@ if test "$modules" = yes; then
> glib_modules="$glib_modules gmodule-2.0"
> fi
>
> +if test "$static" = yes; then
> + QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS"
> +fi
> +
>
Yes! this works thank you =)
> for i in $glib_modules; do
> if $pkg_config --atleast-version=$glib_req_ver $i; then
> glib_cflags=$($pkg_config --cflags $i)
>
--
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] 8+ messages in thread
* Re: [Qemu-devel] qemu-ga static compilation
2017-03-20 15:44 ` Sameeh Jubran
@ 2017-03-21 9:23 ` Sameeh Jubran
2017-03-22 17:08 ` Stefan Hajnoczi
0 siblings, 1 reply; 8+ messages in thread
From: Sameeh Jubran @ 2017-03-21 9:23 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Michael Roth, qemu-devel
Just to make it clear,
Stefan you are going to send a patch right?
On Mon, Mar 20, 2017 at 5:44 PM, Sameeh Jubran <sameeh@daynix.com> wrote:
>
>
> On Mon, Mar 20, 2017 at 3:57 PM, Stefan Hajnoczi <stefanha@gmail.com>
> wrote:
>
>> On Tue, Mar 14, 2017 at 06:51:37PM +0200, Sameeh Jubran wrote:
>> > I am trying to compile qemu-ga for Windows statically using the
>> following
>> > commands:
>> >
>> > ./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
>> >
>> >
>> > And I keep getting this error:
>> >
>> > /home/sameeh/Builds/q/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
>> >
>> >
>> > Notes to consider:
>> > * without --static I can compile it successfully
>> > * Build machine is running Fedora 25
>> > * I have upgraded all of the tools to their latest version
>> > * If I comment out the function which is causing the issue
>> > (g_test_initialized()), qemu ga compiles statically and runs
>> successfully
>> > without the need of any dlls.
>> >
>> > Can anyone reproduce this? Do you have any idea why is this happening?
>>
>> I guess GLIB_STATIC_COMPILATION is not defined in your build (see the
>> definition of GLIB_VAR in the glib headers).
>>
>> The pkg-config file for glib doesn't define GLIB_STATIC_COMPILATION for
>> pkg-config --static. I guess we must add it manually.
>>
>> Does this work?
>>
>> diff --git a/configure b/configure
>> index 99d8bec..10f23b7 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3047,6 +3047,10 @@ if test "$modules" = yes; then
>> glib_modules="$glib_modules gmodule-2.0"
>> fi
>>
>> +if test "$static" = yes; then
>> + QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS"
>> +fi
>> +
>>
> Yes! this works thank you =)
>
>> for i in $glib_modules; do
>> if $pkg_config --atleast-version=$glib_req_ver $i; then
>> glib_cflags=$($pkg_config --cflags $i)
>>
>
>
>
> --
> Respectfully,
> *Sameeh Jubran*
> *Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>*
> *Software Engineer @ Daynix <http://www.daynix.com>.*
>
--
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] 8+ messages in thread
* Re: [Qemu-devel] qemu-ga static compilation
2017-03-21 9:23 ` Sameeh Jubran
@ 2017-03-22 17:08 ` Stefan Hajnoczi
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2017-03-22 17:08 UTC (permalink / raw)
To: Sameeh Jubran; +Cc: Michael Roth, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 207 bytes --]
On Tue, Mar 21, 2017 at 11:23:39AM +0200, Sameeh Jubran wrote:
> Just to make it clear,
>
> Stefan you are going to send a patch right?
I see you've sent a patch. Please go ahead with it.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-03-22 17:08 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-14 16:51 [Qemu-devel] qemu-ga static compilation Sameeh Jubran
2017-03-20 12:05 ` Sameeh Jubran
2017-03-20 12:12 ` Peter Maydell
2017-03-20 13:57 ` Stefan Hajnoczi
2017-03-20 14:04 ` Peter Maydell
2017-03-20 15:44 ` Sameeh Jubran
2017-03-21 9:23 ` Sameeh Jubran
2017-03-22 17:08 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).