Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 457602

Summary: sys-libs/uclibc: doesn't properly export finite() anymore
Product: Gentoo Linux Reporter: Mark Reiche <mr20.gentoo>
Component: [OLD] Core systemAssignee: Embedded Gentoo Team <embedded>
Status: RESOLVED DUPLICATE    
Severity: normal CC: hwoarang, mr20.gentoo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=431560
Whiteboard:
Package list:
Runtime testing required: ---

Description Mark Reiche 2013-02-14 19:41:45 UTC
Building dev-lang/spidermonkey fails on a uclibc based system.

Reproducible: Always

Steps to Reproduce:
1. On a uclibc based system, emerge spidermonkey

Actual Results:  
build breaks with error: jsnum.h:104:20 error: 'finite' was not declared in this scope

Expected Results:  
spidermonkey is build w/o error

I already filed a bug for spidermonkey about this; in the progress of finding a solution it was found that it is actually a uclibc bug (see Bug 431560, comments 7, 8, 10).
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2013-02-14 21:15:51 UTC
I believe the spidermoney should use the isfinite() because finite() is obsolete (per the glibc man page):

       Note that these functions are obsolete.  C99 defines macros isfinite(),
       isinf(), and isnan() (for all types) replacing them.  Further note that
       the C99 isinf() has weaker guarantees on the return value.  See fpclas‐
       sify(3).

So it is not a uClibc bug per se.
Comment 2 Anthony Basile gentoo-dev 2013-02-15 00:00:01 UTC
(In reply to comment #1)
> I believe the spidermoney should use the isfinite() because finite() is
> obsolete (per the glibc man page):
> 
>        Note that these functions are obsolete.  C99 defines macros
> isfinite(),
>        isinf(), and isnan() (for all types) replacing them.  Further note
> that
>        the C99 isinf() has weaker guarantees on the return value.  See
> fpclas‐
>        sify(3).
> 
> So it is not a uClibc bug per se.

That seems to be it because I tried this little poc and sure enough it fails to compile with -DOLD on uclibc-0.9.33.2-r3 whereas its fine on glibc.  Its fine on both with -UOLD.  This should be a simple fix against spidermonkey.



/* gcc -DOLD -o test test.c -lm */

#include <stdio.h>
#include <math.h>

int
main()
{
#ifdef OLD
	printf("%d\n", finite(1));
#else
	printf("%d\n", isfinite(1));
#endif
	return 0;
}
Comment 3 Mark Reiche 2013-02-15 04:47:28 UTC
There is a similar fix already attached to Bug 431560.
However, one of the devs there claimed this to be a uclibc bug that should not be fixed in spidermonkey (and other potentially affected packages) - which is why he commented against adding the spidermonkey fix to the tree.

So, I did not want to cause double effort here - I would should love to see a fix in the tree :-)
Comment 4 SpanKY gentoo-dev 2013-02-18 06:26:46 UTC

*** This bug has been marked as a duplicate of bug 431560 ***