[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] w32: Always compile with __builtin_ffs
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PATCH] w32: Always compile with __builtin_ffs |
Date: |
Sat, 16 Feb 2013 19:30:12 +0100 |
Not all MinGW build environments include a library which provides ffs(),
and some versions of gcc create a function call instead of inline code.
When gcc is called with -ansi, it will always create a function call.
This usually results in an unresolved symbol "ffs" at link time.
The patch enforces inline code for this special case.
Cc: Jacob Kroon <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
---
Hi Jacob,
please try the patch below. If it does not fix the linker problem,
you can define ffs unconditionally.
Regards
Stefan
include/sysemu/os-win32.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index bf9edeb..a885162 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -66,6 +66,9 @@
/* Declaration of ffs() is missing in MinGW's strings.h. */
int ffs(int i);
+#if defined(__STRICT_ANSI__)
+# define ffs(i) __builtin_ffs(i)
+#endif
/* Missing POSIX functions. Don't use MinGW-w64 macros. */
#undef gmtime_r
--
1.7.10.4
- [Qemu-devel] Undefined reference to 'ffs' when building for win64, Jacob Kroon, 2013/02/06
- Re: [Qemu-devel] Undefined reference to 'ffs' when building for win64, Andreas Färber, 2013/02/15
- Re: [Qemu-devel] Undefined reference to 'ffs' when building for win64, Jacob Kroon, 2013/02/15
- Re: [Qemu-devel] Undefined reference to 'ffs' when building for win64, Andreas Färber, 2013/02/15
- Re: [Qemu-devel] Undefined reference to 'ffs' when building for win64, Stefan Weil, 2013/02/15
- Re: [Qemu-devel] Undefined reference to 'ffs' when building for win64, Andreas Färber, 2013/02/15
- Re: [Qemu-devel] Undefined reference to 'ffs' when building for win64, Jacob Kroon, 2013/02/15
- [Qemu-devel] [PATCH] w32: Always compile with __builtin_ffs,
Stefan Weil <=
- Re: [Qemu-devel] [PATCH] w32: Always compile with __builtin_ffs, Jacob Kroon, 2013/02/16
- Re: [Qemu-devel] Undefined reference to 'ffs' when building for win64, Kevin Wolf, 2013/02/18
- Re: [Qemu-devel] Undefined reference to 'ffs' when building for win64, Richard Henderson, 2013/02/18