delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/22/10:02:58

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <49788A91.5070803@sbcglobal.net>
Date: Thu, 22 Jan 2009 15:02:41 +0000
From: Greg Chicares <gchicares AT sbcglobal DOT net>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: 1.5.18-1: undefined reference to `ffs' in mno-cygwin mode
References: <dd5065570901220632u32917372pcc06036f24ef87a7 AT mail DOT gmail DOT com>
In-Reply-To: <dd5065570901220632u32917372pcc06036f24ef87a7@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 2009-01-22 14:32Z, Dmitry Smirnov wrote:
> 
> I was successfully built QEMU with -mno-cygwin and -O2 (default debug option).
> But -O0 gives me the following:
[...]
> /cygdrive/d/Dvs/Project/qemu-0.9.1/hw/omap.c:125: undefined reference to `ffs'
> omap.o:/cygdrive/d/Dvs/Project/qemu-0.9.1/hw/omap.c:3650: more
> undefined references to `ffs' follow

While this isn't a Cygwin issue (you're using '-mno-cygwin'),
it seems that with the '-O2' optimization option you're getting
a gcc builtin (also called "intrinsic") function:

> With the help of disassembler I found that with -O2 option, ffs was
> replaced with some inline code.
> Most likely, with -O0 gcc tries to link it with some function, but CRT
> for -mno-cygwin mode seems does not contain such a function.

...but with '-O0' the intrinsic isn't used.

> Is there any way to fix this problem?

Maybe one of gcc's "builtin" flags would help. Also see:
  http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Other-Builtins.html#Other-Builtins
Or you could implement your own ffs() and offer it to the qemu
developers so they can make their code more portable.

This search:
  http://www.google.com/search?q=ffs+qemu
leads to some links that look promising.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019