[cairo] cairo-1.0.0 build issue

Marco Manfredini mldb at gmx.net
Fri Aug 26 09:44:45 PDT 2005

Compiling the cairo release with gcc-4.0.1 and -O3 fails in pixman/src

$ gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I. -mmmx -msse -Winline --param 
inline-unit-growth=10000 --param large-function-growth=10000 -O3 
-march=athlon-xp -fomit-frame-pointer -MT libpixman_mmx_la-fbmmx.lo -MD -MP 
-MF .deps/libpixman_mmx_la-fbmmx.Tpo -c fbmmx.c -o libpixman_mmx_la-fbmmx.o
/tmp/ccUfhV8U.s: Assembler messages:
/tmp/ccUfhV8U.s:783: Error: symbol `skip' is already defined
/tmp/ccUfhV8U.s:878: Error: symbol `skip2' is already defined

That's because gcc-4.0.1 is inlining more aggressively and duplicates the 
assembly in detectCPUFeatures().

I tried to replace skip* by local symbols. This made inlining work, but gave 
me segfaults when run.

So I did the obvious: 
static __attribute__((noinline)) unsigned int detectCPUFeatures(void) { ... }

and this works. So either the compiler is doing something wrong during 
inlining or there is an issue with the inline assembly that I can't see, 
because i386 assembly makes me mad.


- I would have liked to post this to bugzilla, but bugs.freedesktop.org seems 
to known only about cairo 0.9.3

More information about the cairo mailing list