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).
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.
(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; }
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 :-)
*** This bug has been marked as a duplicate of bug 431560 ***