Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 441634 - x11-libs/gtk+-3.4.4: don't include fallback-c89.c (ie redefine isnan and isinf) on a uclibc system
Summary: x11-libs/gtk+-3.4.4: don't include fallback-c89.c (ie redefine isnan and isin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-03 21:55 UTC by Anthony Basile
Modified: 2012-11-05 01:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
upstream patch (gtk+-3.4.4-isnan.patch,1.47 KB, patch)
2012-11-04 02:49 UTC, Alexandre Rostovtsev (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2012-11-03 21:55:06 UTC
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.
Comment 1 Anthony Basile gentoo-dev 2012-11-03 22:12:50 UTC
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
Comment 2 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-11-04 02:49:37 UTC
Created attachment 328266 [details, diff]
upstream patch

Please test the attached patch (it was applied upstream in gtk+-3.5.4)
Comment 3 Anthony Basile gentoo-dev 2012-11-04 17:47:57 UTC
(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.
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-11-05 01:13:18 UTC
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).