Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 484534 - =dev-lang/ruby-2.0.0_p247-r1: fails to build on uclibc
Summary: =dev-lang/ruby-2.0.0_p247-r1: fails to build on uclibc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-11 00:31 UTC by Anthony Basile
Modified: 2014-02-23 10:27 UTC (History)
1 user (show)

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


Attachments
ruby-2.0.0_p353-uclibc.patch (ruby-2.0.0_p353-uclibc.patch,1.32 KB, patch)
2014-02-01 15:00 UTC, René Rhéaume
Details | Diff
ruby-2.0.0_p353.ebuild.patch (ruby-2.0.0_p353.ebuild.patch,528 bytes, patch)
2014-02-01 15:01 UTC, René Rhéaume
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2013-09-11 00:31:42 UTC
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
Comment 1 Hans de Graaff gentoo-dev Security 2013-10-19 07:15:10 UTC
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.
Comment 2 Anthony Basile gentoo-dev 2013-12-22 19:56:59 UTC
(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.
Comment 3 René Rhéaume 2014-02-01 15:00:01 UTC
Created attachment 369260 [details, diff]
ruby-2.0.0_p353-uclibc.patch

Patch based on upstream changeset 40422 with the isinf fix added
Comment 4 René Rhéaume 2014-02-01 15:01:39 UTC
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.
Comment 5 Hans de Graaff gentoo-dev Security 2014-02-23 10:27:00 UTC
(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.
Comment 6 Hans de Graaff gentoo-dev Security 2014-02-23 10:27:28 UTC
(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.