qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Compiling Qemu from Cygwin
@ 2015-09-15 18:48 Mike Ladouceur
  2015-09-15 20:10 ` Stefan Weil
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Ladouceur @ 2015-09-15 18:48 UTC (permalink / raw)
  To: sw; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2542 bytes --]

Stefan,

 I got your email from the #qemu channel on OFTC. I was told you may be
able to assist me. I'm trying to compile Qemu from within Cygwin. At first
I was getting an error about not being able to find zlib.h even though it
is in fact installed on the "system". I commented out the code that errors
out the make command. Once I did that, it does go further, however, I get
the following errors:

  CC    qga/commands-win32.o
> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
> qga/commands-win32.c:1254:55: warning: passing argument 2 of
> ‘g_base64_decode’ from incompatible pointer type
>      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
>                                                        ^
> In file included from /usr/include/glib-2.0/glib.h:35:0,
>                  from qga/commands-win32.c:14:
> /usr/include/glib-2.0/glib/gbase64.h:52:9: note: expected ‘gsize *’ but
> argument is of type ‘size_t *’
>  guchar *g_base64_decode         (const gchar  *text,
>          ^
>   CC    qga/channel-win32.o
> qga/channel-win32.c: In function ‘ga_channel_create_watch’:
> qga/channel-win32.c:199:24: warning: cast from pointer to integer of
> different size [-Wpointer-to-int-cast]
>      watch->pollfd.fd = (gintptr) c->rstate.ov.hEvent;
>                         ^
> qga/channel-win32.c: At top level:
> qga/channel-win32.c:205:11: error: conflicting types for ‘ga_channel_read’
>  GIOStatus ga_channel_read(GAChannel *c, char *buf, size_t size, gsize
> *count)
>            ^
> In file included from qga/channel-win32.c:9:0:
> ./qga/channel.h:30:11: note: previous declaration of ‘ga_channel_read’ was
> here
>  GIOStatus ga_channel_read(GAChannel *c, gchar *buf, gsize size, gsize
> *count);
>            ^
> qga/channel-win32.c:269:11: error: conflicting types for
> ‘ga_channel_write_all’
>  GIOStatus ga_channel_write_all(GAChannel *c, const char *buf, size_t size)
>            ^
> In file included from qga/channel-win32.c:9:0:
> ./qga/channel.h:31:11: note: previous declaration of
> ‘ga_channel_write_all’ was here
>  GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize
> size);
>            ^
> /build/qemu/rules.mak:57: recipe for target 'qga/channel-win32.o' failed
> make: *** [qga/channel-win32.o] Error 1
>

I have tried your builds, however, I am only returned to the prompt without
any output whatsoever. I appreciate any help you can give me.


Thanks,

Mike.

[-- Attachment #2: Type: text/html, Size: 2947 bytes --]

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-15 18:48 [Qemu-devel] Compiling Qemu from Cygwin Mike Ladouceur
@ 2015-09-15 20:10 ` Stefan Weil
  2015-09-15 20:44   ` Eric Blake
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Weil @ 2015-09-15 20:10 UTC (permalink / raw)
  To: Mike Ladouceur; +Cc: qemu-devel

Am 15.09.2015 um 20:48 schrieb Mike Ladouceur:
> Stefan,
> 
>  I got your email from the #qemu channel on OFTC. I was told you may be
> able to assist me. I'm trying to compile Qemu from within Cygwin. At first
> I was getting an error about not being able to find zlib.h even though it
> is in fact installed on the "system". I commented out the code that errors
> out the make command. Once I did that, it does go further, however, I get
> the following errors:
> 
>   CC    qga/commands-win32.o
>> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
>> qga/commands-win32.c:1254:55: warning: passing argument 2 of
>> ‘g_base64_decode’ from incompatible pointer type
>>      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
>>                                                        ^
>> In file included from /usr/include/glib-2.0/glib.h:35:0,
>>                  from qga/commands-win32.c:14:
>> /usr/include/glib-2.0/glib/gbase64.h:52:9: note: expected ‘gsize *’ but
>> argument is of type ‘size_t *’
>>  guchar *g_base64_decode         (const gchar  *text,
>>          ^
>>   CC    qga/channel-win32.o
>> qga/channel-win32.c: In function ‘ga_channel_create_watch’:
>> qga/channel-win32.c:199:24: warning: cast from pointer to integer of
>> different size [-Wpointer-to-int-cast]
>>      watch->pollfd.fd = (gintptr) c->rstate.ov.hEvent;
>>                         ^
>> qga/channel-win32.c: At top level:
>> qga/channel-win32.c:205:11: error: conflicting types for ‘ga_channel_read’
>>  GIOStatus ga_channel_read(GAChannel *c, char *buf, size_t size, gsize
>> *count)
>>            ^
>> In file included from qga/channel-win32.c:9:0:
>> ./qga/channel.h:30:11: note: previous declaration of ‘ga_channel_read’ was
>> here
>>  GIOStatus ga_channel_read(GAChannel *c, gchar *buf, gsize size, gsize
>> *count);
>>            ^
>> qga/channel-win32.c:269:11: error: conflicting types for
>> ‘ga_channel_write_all’
>>  GIOStatus ga_channel_write_all(GAChannel *c, const char *buf, size_t size)
>>            ^
>> In file included from qga/channel-win32.c:9:0:
>> ./qga/channel.h:31:11: note: previous declaration of
>> ‘ga_channel_write_all’ was here
>>  GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize
>> size);
>>            ^
>> /build/qemu/rules.mak:57: recipe for target 'qga/channel-win32.o' failed
>> make: *** [qga/channel-win32.o] Error 1
>>
> 
> I have tried your builds, however, I am only returned to the prompt without
> any output whatsoever. I appreciate any help you can give me.
> 
> 
> Thanks,
> 
> Mike.

Hi Mike,

compiling with cygwin is unsupported. I suggest using MinGW-w64
(which also works for cross compilations under Linux).

See http://qemu.weilnetz.de/FAQ for your last question.

Cheers
Stefan

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-15 20:10 ` Stefan Weil
@ 2015-09-15 20:44   ` Eric Blake
  2015-09-16 17:51     ` Mike Ladouceur
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Blake @ 2015-09-15 20:44 UTC (permalink / raw)
  To: Stefan Weil, Mike Ladouceur; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1631 bytes --]

On 09/15/2015 02:10 PM, Stefan Weil wrote:
>>
>>   CC    qga/commands-win32.o
>>> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
>>> qga/commands-win32.c:1254:55: warning: passing argument 2 of
>>> ‘g_base64_decode’ from incompatible pointer type
>>>      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
>>>                                                        ^

Ugh. Compiling for cygwin should favor POSIX interfaces, not
commands-win32.  The build is failing because it isn't even correctly
deciding  which files it should be compiling.


> compiling with cygwin is unsupported. I suggest using MinGW-w64
> (which also works for cross compilations under Linux).

Remember, cygwin is itself an emulation layer - you are emulating POSIX
interfaces on top of Windows; which, while making the environment easier
to port to, also makes the environment slower.  qemu targets mingw and
not cygwin because qemu is an emulator and already slow enough, without
needing another layer of emulation thrown in the mix.

That said, if you want to port qemu to cygwin and supply patches, I'm
more than willing to help review them. It's just that right now, it's
not my personal itch to write such patches, and that the qemu community
currently favors mingw rather than cygwin.

Also, cygwin comes with cross-compilers, so you can still use your
cygwin setup to compile qemu for mingw (although doing the cross-compile
on a true Linux box will be faster).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-15 20:44   ` Eric Blake
@ 2015-09-16 17:51     ` Mike Ladouceur
  2015-09-19  2:49       ` Mike Ladouceur
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Ladouceur @ 2015-09-16 17:51 UTC (permalink / raw)
  To: Eric Blake; +Cc: Stefan Weil, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1899 bytes --]

Thanks for the reply. I will try to cross-compile via cygwin seeing as I've
had no luck installing and configuring mingw64.

On Tue, Sep 15, 2015 at 4:44 PM, Eric Blake <eblake@redhat.com> wrote:

> On 09/15/2015 02:10 PM, Stefan Weil wrote:
> >>
> >>   CC    qga/commands-win32.o
> >>> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
> >>> qga/commands-win32.c:1254:55: warning: passing argument 2 of
> >>> ‘g_base64_decode’ from incompatible pointer type
> >>>      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
> >>>                                                        ^
>
> Ugh. Compiling for cygwin should favor POSIX interfaces, not
> commands-win32.  The build is failing because it isn't even correctly
> deciding  which files it should be compiling.
>
>
> > compiling with cygwin is unsupported. I suggest using MinGW-w64
> > (which also works for cross compilations under Linux).
>
> Remember, cygwin is itself an emulation layer - you are emulating POSIX
> interfaces on top of Windows; which, while making the environment easier
> to port to, also makes the environment slower.  qemu targets mingw and
> not cygwin because qemu is an emulator and already slow enough, without
> needing another layer of emulation thrown in the mix.
>
> That said, if you want to port qemu to cygwin and supply patches, I'm
> more than willing to help review them. It's just that right now, it's
> not my personal itch to write such patches, and that the qemu community
> currently favors mingw rather than cygwin.
>
> Also, cygwin comes with cross-compilers, so you can still use your
> cygwin setup to compile qemu for mingw (although doing the cross-compile
> on a true Linux box will be faster).
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
>

[-- Attachment #2: Type: text/html, Size: 2598 bytes --]

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-16 17:51     ` Mike Ladouceur
@ 2015-09-19  2:49       ` Mike Ladouceur
  2015-09-19  6:31         ` Stefan Weil
  2015-09-21  1:19         ` Mike Ladouceur
  0 siblings, 2 replies; 10+ messages in thread
From: Mike Ladouceur @ 2015-09-19  2:49 UTC (permalink / raw)
  To: Eric Blake; +Cc: Stefan Weil, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 4528 bytes --]

I tried from Ubuntu in Virtualbox and this is the error I now get and it
appears to be similar to the error from Cygwin. Configure seems to run
fine. Make fails. I'm officially lost.

./configure --cross-prefix=x86_64-w64-mingw32
(...)
  CC    qga/commands-win32.o
qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
qga/commands-win32.c:1254:5: warning: passing argument 2 of
‘g_base64_decode’ from incompatible pointer type [enabled by default]
     rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
     ^
In file included from /usr/include/glib-2.0/glib.h:35:0,
                 from qga/commands-win32.c:14:
/usr/include/glib-2.0/glib/gbase64.h:52:9: note: expected ‘gsize *’ but
argument is of type ‘size_t *’
 guchar *g_base64_decode         (const gchar  *text,
         ^
  CC    qga/channel-win32.o
qga/channel-win32.c: In function ‘ga_channel_create_watch’:
qga/channel-win32.c:199:24: warning: cast from pointer to integer of
different size [-Wpointer-to-int-cast]
     watch->pollfd.fd = (gintptr) c->rstate.ov.hEvent;
                        ^
qga/channel-win32.c: At top level:
qga/channel-win32.c:205:11: error: conflicting types for ‘ga_channel_read’
 GIOStatus ga_channel_read(GAChannel *c, char *buf, size_t size, gsize
*count)
           ^
In file included from qga/channel-win32.c:9:0:
./qga/channel.h:30:11: note: previous declaration of ‘ga_channel_read’ was
here
 GIOStatus ga_channel_read(GAChannel *c, gchar *buf, gsize size, gsize
*count);
           ^
qga/channel-win32.c:269:11: error: conflicting types for
‘ga_channel_write_all’
 GIOStatus ga_channel_write_all(GAChannel *c, const char *buf, size_t size)
           ^
In file included from qga/channel-win32.c:9:0:
./qga/channel.h:31:11: note: previous declaration of ‘ga_channel_write_all’
was here
 GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize size);
           ^
qga/channel-win32.c: In function ‘ga_channel_open’:
qga/channel-win32.c:291:19: error: ‘MAXPATHLEN’ undeclared (first use in
this function)
     gchar newpath[MAXPATHLEN] = {0};
                   ^
qga/channel-win32.c:291:19: note: each undeclared identifier is reported
only once for each function it appears in
qga/channel-win32.c:291:11: warning: unused variable ‘newpath’
[-Wunused-variable]
     gchar newpath[MAXPATHLEN] = {0};
           ^
make: *** [qga/channel-win32.o] Error 1


On Wed, Sep 16, 2015 at 1:51 PM, Mike Ladouceur <mike.ladouceur@live.com>
wrote:

> Thanks for the reply. I will try to cross-compile via cygwin seeing as
> I've had no luck installing and configuring mingw64.
>
> On Tue, Sep 15, 2015 at 4:44 PM, Eric Blake <eblake@redhat.com> wrote:
>
>> On 09/15/2015 02:10 PM, Stefan Weil wrote:
>> >>
>> >>   CC    qga/commands-win32.o
>> >>> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
>> >>> qga/commands-win32.c:1254:55: warning: passing argument 2 of
>> >>> ‘g_base64_decode’ from incompatible pointer type
>> >>>      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
>> >>>                                                        ^
>>
>> Ugh. Compiling for cygwin should favor POSIX interfaces, not
>> commands-win32.  The build is failing because it isn't even correctly
>> deciding  which files it should be compiling.
>>
>>
>> > compiling with cygwin is unsupported. I suggest using MinGW-w64
>> > (which also works for cross compilations under Linux).
>>
>> Remember, cygwin is itself an emulation layer - you are emulating POSIX
>> interfaces on top of Windows; which, while making the environment easier
>> to port to, also makes the environment slower.  qemu targets mingw and
>> not cygwin because qemu is an emulator and already slow enough, without
>> needing another layer of emulation thrown in the mix.
>>
>> That said, if you want to port qemu to cygwin and supply patches, I'm
>> more than willing to help review them. It's just that right now, it's
>> not my personal itch to write such patches, and that the qemu community
>> currently favors mingw rather than cygwin.
>>
>> Also, cygwin comes with cross-compilers, so you can still use your
>> cygwin setup to compile qemu for mingw (although doing the cross-compile
>> on a true Linux box will be faster).
>>
>> --
>> Eric Blake   eblake redhat com    +1-919-301-3266
>> Libvirt virtualization library http://libvirt.org
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 6016 bytes --]

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-19  2:49       ` Mike Ladouceur
@ 2015-09-19  6:31         ` Stefan Weil
  2015-09-21  1:19         ` Mike Ladouceur
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Weil @ 2015-09-19  6:31 UTC (permalink / raw)
  To: Mike Ladouceur; +Cc: qemu-devel

Am 19.09.2015 um 04:49 schrieb Mike Ladouceur:
> I tried from Ubuntu in Virtualbox and this is the error I now get and it
> appears to be similar to the error from Cygwin. Configure seems to run
> fine. Make fails. I'm officially lost.
> 
> ./configure --cross-prefix=x86_64-w64-mingw32
> (...)
>   CC    qga/commands-win32.o
> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
> qga/commands-win32.c:1254:5: warning: passing argument 2 of
> ‘g_base64_decode’ from incompatible pointer type [enabled by default]
>      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
>      ^
> In file included from /usr/include/glib-2.0/glib.h:35:0,
>                  from qga/commands-win32.c:14:
> /usr/include/glib-2.0/glib/gbase64.h:52:9: note: expected ‘gsize *’ but
> argument is of type ‘size_t *’
>  guchar *g_base64_decode         (const gchar  *text,
>          ^

Your compiler gets the wrong header files for glib-2.0.

configure uses pkg-config to get the correct compiler options.
For your cross compilations, it calls x86_64-w64-mingw32-pkg-config.
Here is an example from my build machine:

$ x86_64-w64-mingw32-pkg-config --cflags glib-2.0
-mms-bitfields -I/usr/x86_64-w64-mingw32/include/glib-2.0
-I/usr/x86_64-w64-mingw32/lib/glib-2.0/include

So the header files are in /usr/x86_64-w64-mingw32/include/glib-2.0,
not in /usr/include/glib-2.0 (those are the header files for native
compilation).

Did you install glib-2.0 for cross compilation? I use the bundle from
ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip.

Regards
Stefan

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-19  2:49       ` Mike Ladouceur
  2015-09-19  6:31         ` Stefan Weil
@ 2015-09-21  1:19         ` Mike Ladouceur
  2015-09-21 17:38           ` Stefan Weil
  2015-09-22  0:00           ` Mike Ladouceur
  1 sibling, 2 replies; 10+ messages in thread
From: Mike Ladouceur @ 2015-09-21  1:19 UTC (permalink / raw)
  To: Eric Blake; +Cc: Stefan Weil, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 6991 bytes --]

Okay, i followed the steps from the reply to my email I noticed on the
website, but never made its way to my inbox. Now, I'm stuck with the
following errors:

/home/mike/qemu/include/glib-compat.h: At top level:
/home/mike/qemu/include/glib-compat.h:145:21: error: conflicting types for
‘g_cond_signal’
 static inline void (g_cond_signal)(CompatGCond *cond)
                     ^
In file included from
/usr/x86_64-w64-mingw32/include/glib-2.0/glib/gasyncqueue.h:34:0,
                 from /usr/x86_64-w64-mingw32/include/glib-2.0/glib.h:34,
                 from qga/commands.c:13:
/usr/x86_64-w64-mingw32/include/glib-2.0/glib/gthread.h:201:17: note:
previous declaration of ‘g_cond_signal’ was here
 void            g_cond_signal                   (GCond          *cond);
                 ^
In file included from /home/mike/qemu/include/qemu-common.h:25:0,
                 from ./qga/guest-agent-core.h:14,
                 from qga/commands.c:14:
/home/mike/qemu/include/glib-compat.h: In function ‘g_cond_signal’:
/home/mike/qemu/include/glib-compat.h:148:5: warning: passing argument 1 of
‘g_cond_signal’ from incompatible pointer type [enabled by default]
     g_cond_signal((GCond *) cond->once.retval);
     ^
/home/mike/qemu/include/glib-compat.h:145:21: note: expected ‘struct
CompatGCond *’ but argument is of type ‘struct GCond *’
 static inline void (g_cond_signal)(CompatGCond *cond)
                     ^
/home/mike/qemu/include/glib-compat.h: At top level:
/home/mike/qemu/include/glib-compat.h:154:24: error: static declaration of
‘g_thread_new’ follows non-static declaration
 static inline GThread *g_thread_new(const char *name,
                        ^
In file included from
/usr/x86_64-w64-mingw32/include/glib-2.0/glib/gasyncqueue.h:34:0,
                 from /usr/x86_64-w64-mingw32/include/glib-2.0/glib.h:34,
                 from qga/commands.c:13:
/usr/x86_64-w64-mingw32/include/glib-2.0/glib/gthread.h:145:17: note:
previous declaration of ‘g_thread_new’ was here
 GThread *       g_thread_new                    (const gchar    *name,
                 ^
make: *** [qga/commands.o] Error 1


On Fri, Sep 18, 2015 at 10:49 PM, Mike Ladouceur <mike.ladouceur@live.com>
wrote:

> I tried from Ubuntu in Virtualbox and this is the error I now get and it
> appears to be similar to the error from Cygwin. Configure seems to run
> fine. Make fails. I'm officially lost.
>
> ./configure --cross-prefix=x86_64-w64-mingw32
> (...)
>   CC    qga/commands-win32.o
> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
> qga/commands-win32.c:1254:5: warning: passing argument 2 of
> ‘g_base64_decode’ from incompatible pointer type [enabled by default]
>      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
>      ^
> In file included from /usr/include/glib-2.0/glib.h:35:0,
>                  from qga/commands-win32.c:14:
> /usr/include/glib-2.0/glib/gbase64.h:52:9: note: expected ‘gsize *’ but
> argument is of type ‘size_t *’
>  guchar *g_base64_decode         (const gchar  *text,
>          ^
>   CC    qga/channel-win32.o
> qga/channel-win32.c: In function ‘ga_channel_create_watch’:
> qga/channel-win32.c:199:24: warning: cast from pointer to integer of
> different size [-Wpointer-to-int-cast]
>      watch->pollfd.fd = (gintptr) c->rstate.ov.hEvent;
>                         ^
> qga/channel-win32.c: At top level:
> qga/channel-win32.c:205:11: error: conflicting types for ‘ga_channel_read’
>  GIOStatus ga_channel_read(GAChannel *c, char *buf, size_t size, gsize
> *count)
>            ^
> In file included from qga/channel-win32.c:9:0:
> ./qga/channel.h:30:11: note: previous declaration of ‘ga_channel_read’ was
> here
>  GIOStatus ga_channel_read(GAChannel *c, gchar *buf, gsize size, gsize
> *count);
>            ^
> qga/channel-win32.c:269:11: error: conflicting types for
> ‘ga_channel_write_all’
>  GIOStatus ga_channel_write_all(GAChannel *c, const char *buf, size_t size)
>            ^
> In file included from qga/channel-win32.c:9:0:
> ./qga/channel.h:31:11: note: previous declaration of
> ‘ga_channel_write_all’ was here
>  GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize
> size);
>            ^
> qga/channel-win32.c: In function ‘ga_channel_open’:
> qga/channel-win32.c:291:19: error: ‘MAXPATHLEN’ undeclared (first use in
> this function)
>      gchar newpath[MAXPATHLEN] = {0};
>                    ^
> qga/channel-win32.c:291:19: note: each undeclared identifier is reported
> only once for each function it appears in
> qga/channel-win32.c:291:11: warning: unused variable ‘newpath’
> [-Wunused-variable]
>      gchar newpath[MAXPATHLEN] = {0};
>            ^
> make: *** [qga/channel-win32.o] Error 1
>
>
> On Wed, Sep 16, 2015 at 1:51 PM, Mike Ladouceur <mike.ladouceur@live.com>
> wrote:
>
>> Thanks for the reply. I will try to cross-compile via cygwin seeing as
>> I've had no luck installing and configuring mingw64.
>>
>> On Tue, Sep 15, 2015 at 4:44 PM, Eric Blake <eblake@redhat.com> wrote:
>>
>>> On 09/15/2015 02:10 PM, Stefan Weil wrote:
>>> >>
>>> >>   CC    qga/commands-win32.o
>>> >>> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
>>> >>> qga/commands-win32.c:1254:55: warning: passing argument 2 of
>>> >>> ‘g_base64_decode’ from incompatible pointer type
>>> >>>      rawpasswddata = (char *)g_base64_decode(password,
>>> &rawpasswdlen);
>>> >>>                                                        ^
>>>
>>> Ugh. Compiling for cygwin should favor POSIX interfaces, not
>>> commands-win32.  The build is failing because it isn't even correctly
>>> deciding  which files it should be compiling.
>>>
>>>
>>> > compiling with cygwin is unsupported. I suggest using MinGW-w64
>>> > (which also works for cross compilations under Linux).
>>>
>>> Remember, cygwin is itself an emulation layer - you are emulating POSIX
>>> interfaces on top of Windows; which, while making the environment easier
>>> to port to, also makes the environment slower.  qemu targets mingw and
>>> not cygwin because qemu is an emulator and already slow enough, without
>>> needing another layer of emulation thrown in the mix.
>>>
>>> That said, if you want to port qemu to cygwin and supply patches, I'm
>>> more than willing to help review them. It's just that right now, it's
>>> not my personal itch to write such patches, and that the qemu community
>>> currently favors mingw rather than cygwin.
>>>
>>> Also, cygwin comes with cross-compilers, so you can still use your
>>> cygwin setup to compile qemu for mingw (although doing the cross-compile
>>> on a true Linux box will be faster).
>>>
>>> --
>>> Eric Blake   eblake redhat com    +1-919-301-3266
>>> Libvirt virtualization library http://libvirt.org
>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 9186 bytes --]

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-21  1:19         ` Mike Ladouceur
@ 2015-09-21 17:38           ` Stefan Weil
  2015-09-22  0:00           ` Mike Ladouceur
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Weil @ 2015-09-21 17:38 UTC (permalink / raw)
  To: Mike Ladouceur; +Cc: qemu-devel

Am 21.09.2015 um 03:19 schrieb Mike Ladouceur:
> Okay, i followed the steps from the reply to my email I noticed on the
> website, but never made its way to my inbox. Now, I'm stuck with the
> following errors:
> 
> /home/mike/qemu/include/glib-compat.h: At top level:
> /home/mike/qemu/include/glib-compat.h:145:21: error: conflicting types
> for ‘g_cond_signal’
>  static inline void (g_cond_signal)(CompatGCond *cond)
>                      ^
> In file included from
> /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gasyncqueue.h:34:0,
>                  from /usr/x86_64-w64-mingw32/include/glib-2.0/glib.h:34,
>                  from qga/commands.c:13:
> /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gthread.h:201:17: note:
> previous declaration of ‘g_cond_signal’ was here
>  void            g_cond_signal                   (GCond          *cond);
>                  ^
[...]

Sorry, I have no idea how to fix those errors. I just tried
cross compilation on cygwin. It did compile without
any problem, but the resulting executables don't work:
Windows reports error 0xc000007b when I try to run them.

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-21  1:19         ` Mike Ladouceur
  2015-09-21 17:38           ` Stefan Weil
@ 2015-09-22  0:00           ` Mike Ladouceur
  2015-09-22  5:21             ` Liviu Ionescu
  1 sibling, 1 reply; 10+ messages in thread
From: Mike Ladouceur @ 2015-09-22  0:00 UTC (permalink / raw)
  To: Eric Blake; +Cc: Stefan Weil, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 7370 bytes --]

Sorry, at this point, I've moved to compiling from Ubuntu as you suggested
earlier.

On Sun, Sep 20, 2015 at 9:19 PM, Mike Ladouceur <mike.ladouceur@live.com>
wrote:

> Okay, i followed the steps from the reply to my email I noticed on the
> website, but never made its way to my inbox. Now, I'm stuck with the
> following errors:
>
> /home/mike/qemu/include/glib-compat.h: At top level:
> /home/mike/qemu/include/glib-compat.h:145:21: error: conflicting types for
> ‘g_cond_signal’
>  static inline void (g_cond_signal)(CompatGCond *cond)
>                      ^
> In file included from
> /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gasyncqueue.h:34:0,
>                  from /usr/x86_64-w64-mingw32/include/glib-2.0/glib.h:34,
>                  from qga/commands.c:13:
> /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gthread.h:201:17: note:
> previous declaration of ‘g_cond_signal’ was here
>  void            g_cond_signal                   (GCond          *cond);
>                  ^
> In file included from /home/mike/qemu/include/qemu-common.h:25:0,
>                  from ./qga/guest-agent-core.h:14,
>                  from qga/commands.c:14:
> /home/mike/qemu/include/glib-compat.h: In function ‘g_cond_signal’:
> /home/mike/qemu/include/glib-compat.h:148:5: warning: passing argument 1
> of ‘g_cond_signal’ from incompatible pointer type [enabled by default]
>      g_cond_signal((GCond *) cond->once.retval);
>      ^
> /home/mike/qemu/include/glib-compat.h:145:21: note: expected ‘struct
> CompatGCond *’ but argument is of type ‘struct GCond *’
>  static inline void (g_cond_signal)(CompatGCond *cond)
>                      ^
> /home/mike/qemu/include/glib-compat.h: At top level:
> /home/mike/qemu/include/glib-compat.h:154:24: error: static declaration of
> ‘g_thread_new’ follows non-static declaration
>  static inline GThread *g_thread_new(const char *name,
>                         ^
> In file included from
> /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gasyncqueue.h:34:0,
>                  from /usr/x86_64-w64-mingw32/include/glib-2.0/glib.h:34,
>                  from qga/commands.c:13:
> /usr/x86_64-w64-mingw32/include/glib-2.0/glib/gthread.h:145:17: note:
> previous declaration of ‘g_thread_new’ was here
>  GThread *       g_thread_new                    (const gchar    *name,
>                  ^
> make: *** [qga/commands.o] Error 1
>
>
> On Fri, Sep 18, 2015 at 10:49 PM, Mike Ladouceur <mike.ladouceur@live.com>
> wrote:
>
>> I tried from Ubuntu in Virtualbox and this is the error I now get and it
>> appears to be similar to the error from Cygwin. Configure seems to run
>> fine. Make fails. I'm officially lost.
>>
>> ./configure --cross-prefix=x86_64-w64-mingw32
>> (...)
>>   CC    qga/commands-win32.o
>> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
>> qga/commands-win32.c:1254:5: warning: passing argument 2 of
>> ‘g_base64_decode’ from incompatible pointer type [enabled by default]
>>      rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
>>      ^
>> In file included from /usr/include/glib-2.0/glib.h:35:0,
>>                  from qga/commands-win32.c:14:
>> /usr/include/glib-2.0/glib/gbase64.h:52:9: note: expected ‘gsize *’ but
>> argument is of type ‘size_t *’
>>  guchar *g_base64_decode         (const gchar  *text,
>>          ^
>>   CC    qga/channel-win32.o
>> qga/channel-win32.c: In function ‘ga_channel_create_watch’:
>> qga/channel-win32.c:199:24: warning: cast from pointer to integer of
>> different size [-Wpointer-to-int-cast]
>>      watch->pollfd.fd = (gintptr) c->rstate.ov.hEvent;
>>                         ^
>> qga/channel-win32.c: At top level:
>> qga/channel-win32.c:205:11: error: conflicting types for ‘ga_channel_read’
>>  GIOStatus ga_channel_read(GAChannel *c, char *buf, size_t size, gsize
>> *count)
>>            ^
>> In file included from qga/channel-win32.c:9:0:
>> ./qga/channel.h:30:11: note: previous declaration of ‘ga_channel_read’
>> was here
>>  GIOStatus ga_channel_read(GAChannel *c, gchar *buf, gsize size, gsize
>> *count);
>>            ^
>> qga/channel-win32.c:269:11: error: conflicting types for
>> ‘ga_channel_write_all’
>>  GIOStatus ga_channel_write_all(GAChannel *c, const char *buf, size_t
>> size)
>>            ^
>> In file included from qga/channel-win32.c:9:0:
>> ./qga/channel.h:31:11: note: previous declaration of
>> ‘ga_channel_write_all’ was here
>>  GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize
>> size);
>>            ^
>> qga/channel-win32.c: In function ‘ga_channel_open’:
>> qga/channel-win32.c:291:19: error: ‘MAXPATHLEN’ undeclared (first use in
>> this function)
>>      gchar newpath[MAXPATHLEN] = {0};
>>                    ^
>> qga/channel-win32.c:291:19: note: each undeclared identifier is reported
>> only once for each function it appears in
>> qga/channel-win32.c:291:11: warning: unused variable ‘newpath’
>> [-Wunused-variable]
>>      gchar newpath[MAXPATHLEN] = {0};
>>            ^
>> make: *** [qga/channel-win32.o] Error 1
>>
>>
>> On Wed, Sep 16, 2015 at 1:51 PM, Mike Ladouceur <mike.ladouceur@live.com>
>> wrote:
>>
>>> Thanks for the reply. I will try to cross-compile via cygwin seeing as
>>> I've had no luck installing and configuring mingw64.
>>>
>>> On Tue, Sep 15, 2015 at 4:44 PM, Eric Blake <eblake@redhat.com> wrote:
>>>
>>>> On 09/15/2015 02:10 PM, Stefan Weil wrote:
>>>> >>
>>>> >>   CC    qga/commands-win32.o
>>>> >>> qga/commands-win32.c: In function ‘qmp_guest_set_user_password’:
>>>> >>> qga/commands-win32.c:1254:55: warning: passing argument 2 of
>>>> >>> ‘g_base64_decode’ from incompatible pointer type
>>>> >>>      rawpasswddata = (char *)g_base64_decode(password,
>>>> &rawpasswdlen);
>>>> >>>                                                        ^
>>>>
>>>> Ugh. Compiling for cygwin should favor POSIX interfaces, not
>>>> commands-win32.  The build is failing because it isn't even correctly
>>>> deciding  which files it should be compiling.
>>>>
>>>>
>>>> > compiling with cygwin is unsupported. I suggest using MinGW-w64
>>>> > (which also works for cross compilations under Linux).
>>>>
>>>> Remember, cygwin is itself an emulation layer - you are emulating POSIX
>>>> interfaces on top of Windows; which, while making the environment easier
>>>> to port to, also makes the environment slower.  qemu targets mingw and
>>>> not cygwin because qemu is an emulator and already slow enough, without
>>>> needing another layer of emulation thrown in the mix.
>>>>
>>>> That said, if you want to port qemu to cygwin and supply patches, I'm
>>>> more than willing to help review them. It's just that right now, it's
>>>> not my personal itch to write such patches, and that the qemu community
>>>> currently favors mingw rather than cygwin.
>>>>
>>>> Also, cygwin comes with cross-compilers, so you can still use your
>>>> cygwin setup to compile qemu for mingw (although doing the cross-compile
>>>> on a true Linux box will be faster).
>>>>
>>>> --
>>>> Eric Blake   eblake redhat com    +1-919-301-3266
>>>> Libvirt virtualization library http://libvirt.org
>>>>
>>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 9639 bytes --]

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

* Re: [Qemu-devel] Compiling Qemu from Cygwin
  2015-09-22  0:00           ` Mike Ladouceur
@ 2015-09-22  5:21             ` Liviu Ionescu
  0 siblings, 0 replies; 10+ messages in thread
From: Liviu Ionescu @ 2015-09-22  5:21 UTC (permalink / raw)
  To: Mike Ladouceur; +Cc: Stefan Weil, qemu-devel


> On 22 Sep 2015, at 03:00, Mike Ladouceur <mike.ladouceur@live.com> wrote:
> 
> Sorry, at this point, I've moved to compiling from Ubuntu as you suggested earlier.

another option, suitable for production environments, where repeatability is important, is to use Docker images.

you can take a look at how GNU ARM Eclipse QEMU is build, for Windows, Linux and OS X:

	https://github.com/gnuarmeclipse/build-scripts/blob/master/scripts/build-qemu.sh

it is almost entirely build from sources, and all required dynamic libraries are packed in the output file.

the Windows files (32/64-bits) are build with MinGW-w64, in my opinion the best build environment for Windows. highly recommended.


regards,

Liviu

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

end of thread, other threads:[~2015-09-22  5:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15 18:48 [Qemu-devel] Compiling Qemu from Cygwin Mike Ladouceur
2015-09-15 20:10 ` Stefan Weil
2015-09-15 20:44   ` Eric Blake
2015-09-16 17:51     ` Mike Ladouceur
2015-09-19  2:49       ` Mike Ladouceur
2015-09-19  6:31         ` Stefan Weil
2015-09-21  1:19         ` Mike Ladouceur
2015-09-21 17:38           ` Stefan Weil
2015-09-22  0:00           ` Mike Ladouceur
2015-09-22  5:21             ` Liviu Ionescu

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).