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/