[adding -lm to endfile in specs] > > How is it needed? Why isn't pixman linking the lib in? In other words, > > what's the error without this patch? > > Not I check again, for some reason libm is not listed in LDLIBS. I think > it belongs there? > > The error is when linking QEMU, there are some undefined references > (IIRC sqrtf) in pixman (which is QEMU dependency).
sqrtf (and indeed any of the math functions) are explicitly documented as "link with -lm". I ran into similar issues when linking mysqld. What I think is happening here is developer laziness when things "just work" on Linux (e.g. due to GCC substituting the calls for builtins, or the C++ toolchain always linking with -lm). In the case of mysqld I "fixed" the problem by doing what the Linux C++ toolchain does and always link with -lm. However, I'm not convinced that is the right thing to do for the C toolchain. Can you verify that a Linux build of qemu does not explicitly add -lm when linking qemu? Martin
