All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5
@ 2015-11-30  5:55 Stefan Weil
  2015-11-30  5:55 ` [Qemu-devel] [PULL 1/3] trace/simple: Fix warning and wrong trace file name for MinGW Stefan Weil
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Stefan Weil @ 2015-11-30  5:55 UTC (permalink / raw)
  To: QEMU Developer; +Cc: Peter Maydell

The following changes since commit 714487515dbe0c65d5904251e796cd3a5b3579fb:

  Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2015-11-27 10:44:42 +0000)

are available in the git repository at:

  git://qemu.weilnetz.de/qemu.git tags/pull-wxx-20151130

for you to fetch changes up to 78e9d4ad11e7116376328860a58b96765ade7b62:

  w32: Use gcc option -mthreads (2015-11-30 06:47:02 +0100)

----------------------------------------------------------------
wxx patch queue

----------------------------------------------------------------
Stefan Weil (3):
      trace/simple: Fix warning and wrong trace file name for MinGW
      oslib-win32: Change return type of function getpagesize
      w32: Use gcc option -mthreads

 configure                 | 2 ++
 include/sysemu/os-win32.h | 2 +-
 trace/simple.c            | 3 ++-
 util/oslib-win32.c        | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

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

* [Qemu-devel] [PULL 1/3] trace/simple: Fix warning and wrong trace file name for MinGW
  2015-11-30  5:55 [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5 Stefan Weil
@ 2015-11-30  5:55 ` Stefan Weil
  2015-11-30  5:55 ` [Qemu-devel] [PULL 2/3] oslib-win32: Change return type of function getpagesize Stefan Weil
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Stefan Weil @ 2015-11-30  5:55 UTC (permalink / raw)
  To: QEMU Developer; +Cc: Peter Maydell, Stefan Weil

On Windows, getpid() always returns an int value, but pid_t (which is
expected by the format string) is either a 32 bit or a 64 bit value.

Without a type cast (or a modified format string), the compiler prints
a warning when building for 64 bit Windows and the resulting trace_file_name
will include a wrong pid:

trace/simple.c:332:9: warning:
 format ‘%lld’ expects argument of type ‘long long int’,
 but argument 2 has type ‘int’ [-Wformat=]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 trace/simple.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/trace/simple.c b/trace/simple.c
index 11ad030..56a624c 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -329,7 +329,8 @@ bool st_set_trace_file(const char *file)
     g_free(trace_file_name);
 
     if (!file) {
-        trace_file_name = g_strdup_printf(CONFIG_TRACE_FILE, getpid());
+        /* Type cast needed for Windows where getpid() returns an int. */
+        trace_file_name = g_strdup_printf(CONFIG_TRACE_FILE, (pid_t)getpid());
     } else {
         trace_file_name = g_strdup_printf("%s", file);
     }
-- 
2.1.4

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

* [Qemu-devel] [PULL 2/3] oslib-win32: Change return type of function getpagesize
  2015-11-30  5:55 [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5 Stefan Weil
  2015-11-30  5:55 ` [Qemu-devel] [PULL 1/3] trace/simple: Fix warning and wrong trace file name for MinGW Stefan Weil
@ 2015-11-30  5:55 ` Stefan Weil
  2015-11-30 14:07   ` Juan Quintela
  2015-11-30  5:55 ` [Qemu-devel] [PULL 3/3] w32: Use gcc option -mthreads Stefan Weil
  2015-11-30 17:08 ` [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5 Peter Maydell
  3 siblings, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2015-11-30  5:55 UTC (permalink / raw)
  To: QEMU Developer; +Cc: Peter Maydell, Stefan Weil

getpagesize on Linux returns an int. Fix QEMU's implementation for
Windows to return an int (instead of size_t), too.

This fixes a compiler warning which was introduced recently
(commit 093e3c42).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 include/sysemu/os-win32.h | 2 +-
 util/oslib-win32.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index 13dcef6..400e098 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -87,7 +87,7 @@ static inline void os_setup_post(void) {}
 void os_set_line_buffering(void);
 static inline void os_set_proc_name(const char *dummy) {}
 
-size_t getpagesize(void);
+int getpagesize(void);
 
 #if !defined(EPROTONOSUPPORT)
 # define EPROTONOSUPPORT EINVAL
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 09f9e98..6a47019 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -454,7 +454,7 @@ gint g_poll(GPollFD *fds, guint nfds, gint timeout)
     return retval;
 }
 
-size_t getpagesize(void)
+int getpagesize(void)
 {
     SYSTEM_INFO system_info;
 
-- 
2.1.4

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

* [Qemu-devel] [PULL 3/3] w32: Use gcc option -mthreads
  2015-11-30  5:55 [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5 Stefan Weil
  2015-11-30  5:55 ` [Qemu-devel] [PULL 1/3] trace/simple: Fix warning and wrong trace file name for MinGW Stefan Weil
  2015-11-30  5:55 ` [Qemu-devel] [PULL 2/3] oslib-win32: Change return type of function getpagesize Stefan Weil
@ 2015-11-30  5:55 ` Stefan Weil
  2015-11-30 17:08 ` [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5 Peter Maydell
  3 siblings, 0 replies; 6+ messages in thread
From: Stefan Weil @ 2015-11-30  5:55 UTC (permalink / raw)
  To: QEMU Developer; +Cc: Peter Maydell, Stefan Weil

QEMU uses threads / coroutines, therefore support for thread local storage
and thread safe libraries (-D_MT) must be enabled by using -mthreads.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 979bc55..67801b0 100755
--- a/configure
+++ b/configure
@@ -727,6 +727,8 @@ if test "$mingw32" = "yes" ; then
   QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
   # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
   QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
+  # MinGW needs -mthreads for TLS and macro _MT.
+  QEMU_CFLAGS="-mthreads $QEMU_CFLAGS"
   LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
   write_c_skeleton;
   if compile_prog "" "-liberty" ; then
-- 
2.1.4

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

* Re: [Qemu-devel] [PULL 2/3] oslib-win32: Change return type of function getpagesize
  2015-11-30  5:55 ` [Qemu-devel] [PULL 2/3] oslib-win32: Change return type of function getpagesize Stefan Weil
@ 2015-11-30 14:07   ` Juan Quintela
  0 siblings, 0 replies; 6+ messages in thread
From: Juan Quintela @ 2015-11-30 14:07 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Peter Maydell, QEMU Developer

Stefan Weil <sw@weilnetz.de> wrote:
> getpagesize on Linux returns an int. Fix QEMU's implementation for
> Windows to return an int (instead of size_t), too.
>
> This fixes a compiler warning which was introduced recently
> (commit 093e3c42).
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

Reviewed-by: Juan Quintela <quintela@redhat.com>

This makes -Werror + cross mingw64 cross-compiler for win64 work for me.

Thanks, Juan.

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

* Re: [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5
  2015-11-30  5:55 [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5 Stefan Weil
                   ` (2 preceding siblings ...)
  2015-11-30  5:55 ` [Qemu-devel] [PULL 3/3] w32: Use gcc option -mthreads Stefan Weil
@ 2015-11-30 17:08 ` Peter Maydell
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2015-11-30 17:08 UTC (permalink / raw)
  To: Stefan Weil; +Cc: QEMU Developer

On 30 November 2015 at 05:55, Stefan Weil <sw@weilnetz.de> wrote:
> The following changes since commit 714487515dbe0c65d5904251e796cd3a5b3579fb:
>
>   Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2015-11-27 10:44:42 +0000)
>
> are available in the git repository at:
>
>   git://qemu.weilnetz.de/qemu.git tags/pull-wxx-20151130
>
> for you to fetch changes up to 78e9d4ad11e7116376328860a58b96765ade7b62:
>
>   w32: Use gcc option -mthreads (2015-11-30 06:47:02 +0100)
>
> ----------------------------------------------------------------
> wxx patch queue
>
> ----------------------------------------------------------------
> Stefan Weil (3):
>       trace/simple: Fix warning and wrong trace file name for MinGW
>       oslib-win32: Change return type of function getpagesize
>       w32: Use gcc option -mthreads
>
>  configure                 | 2 ++
>  include/sysemu/os-win32.h | 2 +-
>  trace/simple.c            | 3 ++-
>  util/oslib-win32.c        | 2 +-
>  4 files changed, 6 insertions(+), 3 deletions(-)

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2015-11-30 17:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-30  5:55 [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5 Stefan Weil
2015-11-30  5:55 ` [Qemu-devel] [PULL 1/3] trace/simple: Fix warning and wrong trace file name for MinGW Stefan Weil
2015-11-30  5:55 ` [Qemu-devel] [PULL 2/3] oslib-win32: Change return type of function getpagesize Stefan Weil
2015-11-30 14:07   ` Juan Quintela
2015-11-30  5:55 ` [Qemu-devel] [PULL 3/3] w32: Use gcc option -mthreads Stefan Weil
2015-11-30 17:08 ` [Qemu-devel] [PULL 0/3] wxx: Last minute fixes for 2.5 Peter Maydell

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.