wxx: Last minute fixes for 2.5
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(-)
[Qemu-devel] [PULL 1/3] trace/simple: Fix warning and wrong trace file name for MinGW
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=]
--- trace/simple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
trace/simple.c +2 -1
@@ -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); }
Signature · 1 line
2.1.4
[Qemu-devel] [PULL 2/3] oslib-win32: Change return type of function getpagesize
In reply to Stefan Weilgetpagesize 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).
--- include/sysemu/os-win32.h | 2 +- util/oslib-win32.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/sysemu/os-win32.h +1 -1
@@ -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
util/oslib-win32.c +1 -1
@@ -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;
Signature · 1 line
2.1.4
Juan Quintela
Reviewed-byRe: [Qemu-devel] [PULL 2/3] oslib-win32: Change return type of function getpagesize
Quoted 7 lines · 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 <[email protected]>
This makes -Werror + cross mingw64 cross-compiler for win64 work for me.
Thanks, Juan.
[Qemu-devel] [PULL 3/3] w32: Use gcc option -mthreads
In reply to Stefan WeilQEMU uses threads / coroutines, therefore support for thread local storage and thread safe libraries (-D_MT) must be enabled by using -mthreads.
--- configure | 2 ++ 1 file changed, 2 insertions(+)
configure +2 -0
@@ -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
Signature · 1 line
2.1.4
Peter Maydell
AppliedQuoted 21 lines · Stefan Weil
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.gittags/pull-wxx-20151130for 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
Quoted 5 lines
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