w32: Use additional library libiberty.a
PATCH 1/2 w32: Use additional library libiberty.a
libiberty.a is part of MinGW and provides useful functions like ffs (MinGW) and getopt (MinGW-w64).
It is needed for w64 compilations and allows simpler code for w32.
Cc Anthony Liguori <[email protected]>
Signed-off-by Stefan Weil <[email protected]>
--- configure | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
@@ -474,7 +474,7 @@ 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" - LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" + LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS" prefix="c:/Program Files/Qemu" mandir="\${prefix}" datadir="\${prefix}"
Signature · 1 line
1.7.2.3
PATCH 2/2 w32: Remove implementation of function ffs
This implementation is no longer needed.
ffs is either a built-in function (for compilations with optimisation) or taken from libiberty.a (which was added by the previous patch).
Cc Anthony Liguori <[email protected]>
Signed-off-by Stefan Weil <[email protected]>
--- oslib-win32.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
oslib-win32.c +0 -7
@@ -93,13 +93,6 @@ void qemu_set_cloexec(int fd) { } -/* mingw32 needs ffs for compilations without optimization. */ -int ffs (int i) -{ -/* Use gcc's builtin ffs. */ -return __builtin_ffs (i); -} -/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */ #define _W32_FT_OFFSET (116444736000000000ULL)
Signature · 1 line
1.7.2.3
Blue Swirl
AppliedThanks, applied both.
Quoted 29 lines · Stefan Weil
libiberty.a is part of MinGW and provides useful functions like ffs (MinGW) and getopt (MinGW-w64).
It is needed for w64 compilations and allows simpler code for w32.
Cc Anthony Liguori <[email protected]>Signed-off-by Stefan Weil <[email protected]>---
configure | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)configure +0
-0@@ -474,7 +474,7 @@ if test "$mingw32" = "yes" ; thenQEMU_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" - LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" + LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS" prefix="c:/Program Files/Qemu" mandir="\${prefix}" datadir="\${prefix}" -- 1.7.2.3