The problem is that the build system doesn't recognize that isnan and isinf are #defined elsewhere and it tries to compile "missing" functions. Of course, the function names are replaced with the defined values causing a mess. Here's the last few lines of the build: x86_64-gentoo-linux-uclibc-gcc -ggdb -O2 -pipe -fno-strict-aliasing -fPIC -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -I. -I.ext/include/x86_64-linux-uclibc -I./include -I. -o isnan.o -c ./missing/isnan.c ./missing/isnan.c:8:1: error: expected identifier or '(' before 'sizeof' make: *** [isnan.o] Error 1 make: *** Waiting for unfinished jobs.... As a diagnostic tool, you can "fix" this by undefining isnan before the function definition, or isinf elsewhere, and then it compiles fine. I'll inline the patch for easy reading (its not cross platform so you really don't want to use it): diff -Naur ruby-2.0.0-p247.orig/missing/isinf.c ruby-2.0.0-p247/missing/isinf.c --- ruby-2.0.0-p247.orig/missing/isinf.c 2011-05-15 07:55:52.000000000 -0400 +++ ruby-2.0.0-p247/missing/isinf.c 2013-09-09 15:28:47.750452951 -0400 @@ -52,6 +52,8 @@ static double one (void) { return 1.0; } static double inf (void) { return one() / zero(); } +#undef isinf + int isinf(double n) { diff -Naur ruby-2.0.0-p247.orig/missing/isnan.c ruby-2.0.0-p247/missing/isnan.c --- ruby-2.0.0-p247.orig/missing/isnan.c 2010-07-28 04:12:01.000000000 -0400 +++ ruby-2.0.0-p247/missing/isnan.c 2013-09-09 15:28:32.791451837 -0400 @@ -4,6 +4,8 @@ static int double_ne(double n1, double n2); +#undef isnan + int isnan(double n) { Reproducible: Always
Looks like this is already fixed upstream: http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/40422 Most likely this only got fixed in ruby-trunk which will be ruby 2.1 at the end of the year.
(In reply to Hans de Graaff from comment #1) > Looks like this is already fixed upstream: > http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/40422 > > Most likely this only got fixed in ruby-trunk which will be ruby 2.1 at the > end of the year. Looks like the isnan was fixed, but not the isinf.
Created attachment 369260 [details, diff] ruby-2.0.0_p353-uclibc.patch Patch based on upstream changeset 40422 with the isinf fix added
Created attachment 369262 [details, diff] ruby-2.0.0_p353.ebuild.patch Ebuild patch adding the epatch instruction. I do not have access to the patches tarball, hence the ${FILESDIR} usage.
(In reply to Anthony Basile from comment #2) > (In reply to Hans de Graaff from comment #1) > > Looks like this is already fixed upstream: > > http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/40422 > > > > Most likely this only got fixed in ruby-trunk which will be ruby 2.1 at the > > end of the year. > > Looks like the isnan was fixed, but not the isinf. As far as I can tell ruby 2.1.0 also has fixed isinf, but perhaps in a different commit.
(In reply to René Rhéaume from comment #3) > Created attachment 369260 [details, diff] [details, diff] > ruby-2.0.0_p353-uclibc.patch > > Patch based on upstream changeset 40422 with the isinf fix added Thanks, I've added this to the tree as ruby 2.0.0_p353-r2.