Skip to contentSkip to conversation

w32: Use additional library libiberty.a

PATCH Applied Stefan Weil 2 participants 3 messages Feb 4, 2011 – Feb 20, 2011

lore
Share & tools
lore
#0 lore raw

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]>
---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
index 598e8e1..7be4cd5 100755
@@ -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
#1 lore raw

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]>
---
 oslib-win32.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
oslib-win32.c +0 -7
index ab29eae..5f0759f 100644
@@ -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
Applied
#2 lore raw
In reply to Stefan Weil

Thanks, 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]>

---
 configure |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
configure +0 -0
index 598e8e1..7be4cd5 100755
@@ -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}"
--
1.7.2.3