Bug #10906
closedProblem building on Solaris 10 - symbol rb_infinity not found
Description
Hi,
Solaris 10
gcc 4.8
ruby 2.2.0 current stable
I did configure/make, and it works until it tries to generate rdoc:
Generating RDoc documentation
/export/home/djberge/Downloads/Ruby/ruby-2.2.0/.ext/common/date.rb:3:in `require': ld.so.1: ruby: fatal: relocation error: file /export/home/djberge/Downloads/Ruby/ruby-2.2.0/.ext/i386-solaris2.10/date_core.so: symbol rb_infinity: referenced symbol not found - /export/home/djberge/Downloads/Ruby/ruby-2.2.0/.ext/i386-solaris2.10/date_core.so (LoadError)
from /export/home/djberge/Downloads/Ruby/ruby-2.2.0/.ext/common/date.rb:3:in `<top (required)>'
from /export/home/djberge/Downloads/Ruby/ruby-2.2.0/lib/time.rb:1:in `require'
from /export/home/djberge/Downloads/Ruby/ruby-2.2.0/lib/time.rb:1:in `<top (required)>'
from /export/home/djberge/Downloads/Ruby/ruby-2.2.0/lib/rdoc/rdoc.rb:6:in `require'
from /export/home/djberge/Downloads/Ruby/ruby-2.2.0/lib/rdoc/rdoc.rb:6:in `<top (required)>'
from ./bin/rdoc:16:in `require'
from ./bin/rdoc:16:in `<main>'
make: *** [rdoc] Error 1
Updated by ngoto (Naohisa Goto) over 10 years ago
- Status changed from Open to Feedback
Could you please show configure options and environment variables,
and execute the following commands and show results?
% /usr/ccs/bin/nm numeric.o | grep infinity
% /usr/ccs/bin/nm .ext/i386-solaris2.10/date_core.so | grep infinity
Updated by djberg96 (Daniel Berger) over 10 years ago
I didn't send any options to configure.
/usr/ccs/bin/nm numeric.o | grep infinity
/usr/ccs/bin/nm .ext/i386-solaris2.10/date_core.so | grep infinity
[1620] | 0| 0|NOTY |GLOB |0 |UNDEF |rb_infinity
env
LDFLAGS=-R/usr/local/lib -R/opt/csw/lib -R/opt/csw/gcc4/lib
MANPATH=/usr/dt/man:/usr/man:/usr/openwin/share/man:/opt/csw/man:/usr/local/man:/opt/csw/man:/usr/local/man
DTSOURCEPROFILE=true
SHELL=/usr/bin/bash
TERM=dtterm
WINDOWID=54526077
OLDPWD=/export/home/djberge/Downloads/Ruby/ruby-2.2.0/ext
DTHELPSEARCHPATH=/export/home/djberge/.dt/help/djberge-unknown-0/%H:/export/home/djberge/.dt/help/djberge-unknown-0/%H.sdl:/export/home/djberge/.dt/help/djberge-unknown-0/%H.hv:/export/home/djberge/.dt/help/%H:/export/home/djberge/.dt/help/%H.sdl:/export/home/djberge/.dt/help/%H.hv:/usr/dt/appconfig/help/%L/%H:/usr/dt/appconfig/help/%L/%H.sdl:/usr/dt/appconfig/help/%L/%H.hv:/usr/dt/appconfig/help/C/%H:/usr/dt/appconfig/help/C/%H.sdl:/usr/dt/appconfig/help/C/%H.hv
DTDEVROOT=
USER=djberge
LD_LIBRARY_PATH=/opt/csw/lib:/usr/local/lib/lib:/usr/lib:/usr/ucblib
OPENWINHOME=/usr/openwin
DTXSERVERLOCATION=local
XMBINDDIR=/usr/dt/lib/bindings
SESSION_SVR=unknown
HELPPATH=/usr/openwin/lib/locale:/usr/openwin/lib/help
PATH=/usr/local/bin:/opt/local/bin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/ucb:/opt/solstudio12.2/bin:/opt/csw/bin:/usr/ccs/bin:/usr/sbin:/usr/local/bin:/opt/bin:/opt/csw/gcc4/bin:/usr/local/jruby/bin:/usr/xpg4/bin:/usr/local/bin:/opt/local/bin:/opt/solstudio12.2/bin:/opt/csw/bin:/usr/ccs/bin:/usr/sbin:/usr/local/bin:/opt/bin:/opt/csw/gcc4/bin:/usr/local/jruby/bin:/usr/xpg4/bin:/usr/local/bin:/opt/local/bin
MAIL=/usr/mail/djberge
TERMINAL_EMULATOR=dtterm
PWD=/export/home/djberge/Downloads/Ruby/ruby-2.2.0
EDITOR=/usr/dt/bin/dtpad
LANG=C
DTAPPSEARCHPATH=/export/home/djberge/.dt/appmanager:/usr/dt/appconfig/appmanager/%L:/usr/dt/appconfig/appmanager/C
TZ=US/Mountain
XFILESEARCHPATH=/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%S
PS1=\u:\w [\033[0m]$(parse_git_branch)>
HOME=/export/home/djberge
SHLVL=2
DTSCREENSAVERLIST=StartDtscreenSwarm StartDtscreenQix StartDtscreenFlame StartDtscreenHop StartDtscreenImage StartDtscreenLife StartDtscreenRotor StartDtscreenPyro StartDtscreenWorm StartDtscreenBlank
AB_CARDCATALOG=/usr/dt/share/answerbooks/C/ab_cardcatalog
LOGNAME=djberge
DTDATABASESEARCHPATH=/export/home/djberge/.dt/types,/usr/dt/appconfig/types/%L,/usr/dt/appconfig/types/C
DTUSERSESSION=djberge-unknown-0
XMICONSEARCHPATH=/export/home/djberge/.dt/icons/%B%M.pm:/export/home/djberge/.dt/icons/%B%M.bm:/export/home/djberge/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B
CC=gcc -Wall
DISPLAY=:0.0
RUBYOPT=-rubygems
XMICONBMSEARCHPATH=/export/home/djberge/.dt/icons/%B%M.bm:/export/home/djberge/.dt/icons/%B%M.pm:/export/home/djberge/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B
dtstart_sessionlogfile=/dev/null
_=/usr/bin/env
Updated by ngoto (Naohisa Goto) over 10 years ago
Thanks.
The output of the commands suggest that the macro INFINITY was defined when compiling numeric.c but was not defined when compiling ext/date/date_core.c.
I still couldn't find why.
INFINITY is C99 feature, and whether INFINITY is already defined or not is checked in include/ruby/missing.h:
#ifdef INFINITY
# define HAVE_INFINITY
#else
/** @internal */
RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
# define INFINITY (rb_infinity.float_value)
#endif
The concrete definition of rb_infinity is in numeric.c:
#ifdef HAVE_INFINITY
#elif !defined(WORDS_BIGENDIAN) /* BYTE_ORDER == LITTLE_ENDIAN */
const union bytesequence4_or_float rb_infinity = {{0x00, 0x00, 0x80, 0x7f}};
#else
const union bytesequence4_or_float rb_infinity = {{0x7f, 0x80, 0x00, 0x00}};
#endif
Updated by djberg96 (Daniel Berger) over 10 years ago
I don't know what to tell you. For anyone reading this, to get around it I did this:
configure --disable-install-doc --disable-install-rdoc
make
make install
It failed when it tried to install bundle gems, but core Ruby was still installed by that point. So then I went to ext/date and added this line near the top of date_core.c
const union bytesequence4_or_float rb_infinity = {{0x7f, 0x80, 0x00, 0x00}};
I also had to fix the Makefile:
top_srcdir = ../..
Then make; make install
Now it's working.
Updated by ngoto (Naohisa Goto) over 10 years ago
Adding "-std=gnu99" to CFLAGS might solve the problem.
% CFLAGS="-std=gnu99" ./configure
Updated by naruse (Yui NARUSE) over 10 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100
Applied in changeset r50104.
- ext/date/extconf.rb: try_cflags("-std=iso9899:1999") [Bug #10906]
ruby itself (including numeric.c) is built with strict compile
options including -std=iso9899:1999, but ext/date is not.
By the way -std=iso9899:1999 is not only a warning option but also
changes behavior like MACRO definitions for example INFINITY.
gcc on Solaris affect this.
Updated by daqo (David Qorashi) almost 10 years ago
Adding CFLAGS="-std=iso9899:1999" worked for me.
Updated by ngoto (Naohisa Goto) almost 10 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED
Updated by nagachika (Tomoyuki Chikanaga) almost 10 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: DONE
Backported into ruby_2_2
branch at r51553.
Updated by usa (Usaku NAKAMURA) over 9 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: DONE to 2.0.0: UNKNOWN, 2.1: DONE, 2.2: DONE
ruby_2_1 r52645 merged revision(s) 50104,50105.