From patchwork Sat Feb 16 18:48:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Kroon X-Patchwork-Id: 221024 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 9B7C72C0085 for ; Sun, 17 Feb 2013 05:49:07 +1100 (EST) Received: from localhost ([::1]:53147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6mor-0003U9-N2 for incoming@patchwork.ozlabs.org; Sat, 16 Feb 2013 13:49:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6moj-0003TS-5j for qemu-devel@nongnu.org; Sat, 16 Feb 2013 13:48:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6moe-0005xN-JU for qemu-devel@nongnu.org; Sat, 16 Feb 2013 13:48:57 -0500 Received: from mail-vb0-f51.google.com ([209.85.212.51]:58596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6moe-0005xJ-Ey for qemu-devel@nongnu.org; Sat, 16 Feb 2013 13:48:52 -0500 Received: by mail-vb0-f51.google.com with SMTP id fq11so2743890vbb.38 for ; Sat, 16 Feb 2013 10:48:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Gtr7UALsWa8hY5WZKUEfPoPzZnAlqTkAhqKq1SuSxiA=; b=oQdWiYigtEEkTEjhkWGZob1D2XNfdpZfEJx3f5+kYdR2EvyEFZ1yETKASS+yubQ7BS TRgEcgpIUis/1XaPGZlXvEbl34RmppBLHIBtsloUAa/lLNISSMekVcg7snxcU7J/ZS2C qZ7BuixoY/VyG8RNE4DKV7tbvMrg+sZLG9xTE1FSzx81B8x3WUAnZBDrwf+6/v5q0+ne KI8GLqIy+RSKkh+/kgfPF9lWLNIC6XC39PALqCWxkZlv+U3cw8GXap8vBNUxm94NeZWr r23S8heE9v1lwtVgXuiahixn2bcO2DiwTS47SOyw81PQD+kKgU1f6dFpG4KfL0kebrR/ pY1A== MIME-Version: 1.0 X-Received: by 10.52.98.5 with SMTP id ee5mr7612318vdb.102.1361040531743; Sat, 16 Feb 2013 10:48:51 -0800 (PST) Received: by 10.58.178.147 with HTTP; Sat, 16 Feb 2013 10:48:51 -0800 (PST) In-Reply-To: <1361039412-4064-1-git-send-email-sw@weilnetz.de> References: <1361039412-4064-1-git-send-email-sw@weilnetz.de> Date: Sat, 16 Feb 2013 19:48:51 +0100 Message-ID: From: Jacob Kroon To: Stefan Weil X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.51 Cc: qemu-devel@nongnu.org, afaerber@suse.de Subject: Re: [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 Hi Stefan, On Sat, Feb 16, 2013 at 7:30 PM, Stefan Weil wrote: > 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. Thanks for looking into this. The patch as it is still results in linker errors on my machine, but yes, defining "ffs" unconditionally like below does fix the problem here. Regards Jacob diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index bf9edeb..e2972c8 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -66,6 +66,7 @@ /* Declaration of ffs() is missing in MinGW's strings.h. */ int ffs(int i); +#define ffs(i) __builtin_ffs(i) /* Missing POSIX functions. Don't use MinGW-w64 macros. */ #undef gmtime_r