On a uclibc system, HAVE_ISNAN and HAVE_ISINF are left undefined by gtk+'s configure.ac's AC_CHECK_FUNCS(round rint isnan isinf nearbyint) around line 740. I'm not 100% sure why because both are provided by libm on uclibc. Eg. #include <stdio.h> #include <math.h> int main() { printf("%d\n", isnan(1)); return 0; } builds and runs fine with "gcc -o isnan-test isnan-test.c -lm". I suspect that maybe something in autoconf's AC_CHECK_FUNCS misses the -lm because on a uclibc system you need -lm (or you get undefined reference to `__isnanf') while on glibc you can build the above with just "gcc -o isnan-test isnan-test.c". This hits gtk+ which tries to fall back on C89 with an #include which includes definitions of isnan() and isifn() in gdk/gdkrgba.c. A simple patch avoids that include which winds up with an error since isnan/isinf are already there.
Here's a patch which would avoid the inclusion of the "fall back to C89" code. It may be hacky since a better fix may be in autoconf. I'm cc-ing toolchain@ and base-system@ to get opinions if I should pursue that avenue. The patch is on my overlay: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=blob;f=x11-libs/gtk%2B/files/gtk%2B-3.4.4-dont-fallback-c89-uclibc.patch;h=79eda021a5978edf3a5688dd181a1a75ebd90cd2;hb=e3394b1dd8ba0b6cdf4c39d8e6542dcdc816ff8a
Created attachment 328266 [details, diff] upstream patch Please test the attached patch (it was applied upstream in gtk+-3.5.4)
(In reply to comment #2) > Created attachment 328266 [details, diff] [details, diff] > upstream patch > > Please test the attached patch (it was applied upstream in gtk+-3.5.4) Works. Not surprising. Its obvious in retrospect what the problem was.
Thanks, fixed in cvs. >*gtk+-2.24.13-r1 (05 Nov 2012) > > 05 Nov 2012; Alexandre Rostovtsev <tetromino@gentoo.org> gtk+-2.24.12.ebuild, > gtk+-2.24.13.ebuild, +gtk+-2.24.13-r1.ebuild, > +files/gtk+-2.24.13-gtk3-bookmarks.patch, gtk+-3.4.4.ebuild, > +files/gtk+-3.4.4-isnan.patch: > Fix 3.4.4 build failure with uclibc (bug #441634, thanks to Anthony Basile). > For 2.24.13-r1, share bookmarks with gtk3, and do not install obsolete env.d > file (bug #431018, thanks to Hans). UI tests in gtk2 fail if immodules are > not already installed (bug #413185, thanks to Patrick Lauer).