From patchwork Sat Feb 16 18:30:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 221023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D838B2C008E for ; Sun, 17 Feb 2013 05:30:45 +1100 (EST) Received: from localhost ([::1]:44859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6mX6-0005jg-1n for incoming@patchwork.ozlabs.org; Sat, 16 Feb 2013 13:30:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6mWu-0005ir-Sb for qemu-devel@nongnu.org; Sat, 16 Feb 2013 13:30:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6mWr-0001nz-KP for qemu-devel@nongnu.org; Sat, 16 Feb 2013 13:30:32 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:33954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6mWr-0001nZ-DZ for qemu-devel@nongnu.org; Sat, 16 Feb 2013 13:30:29 -0500 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id 92D587280046; Sat, 16 Feb 2013 19:30:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AwHRHCGRVfOW; Sat, 16 Feb 2013 19:30:23 +0100 (CET) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id 9DDCE7280047; Sat, 16 Feb 2013 19:30:23 +0100 (CET) From: Stefan Weil To: qemu-devel@nongnu.org Date: Sat, 16 Feb 2013 19:30:12 +0100 Message-Id: <1361039412-4064-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 78.47.199.172 Cc: Stefan Weil , Jacob Kroon , afaerber@suse.de Subject: [Qemu-devel] [PATCH] w32: Always compile with __builtin_ffs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Signed-off-by: Stefan Weil --- 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