[bug-notifications] [ruby 0003445]: Missing rb_hash_foreach

Mantis Bug Tracker noreply at opencsw.org
Mon Feb 23 18:03:00 CET 2009


A NOTE has been added to this issue. 
====================================================================== 
http://opencsw.org/bugtrack/view.php?id=3445 
====================================================================== 
Reported By:                mswatters
Assigned To:                bwalton
====================================================================== 
Project:                    ruby
Issue ID:                   3445
Category:                   regular use
Reproducibility:            always
Severity:                   block
Priority:                   normal
Status:                     confirmed
====================================================================== 
Date Submitted:             2009-02-21 22:31 CET
Last Modified:              2009-02-23 18:02 CET
====================================================================== 
Summary:                    Missing rb_hash_foreach
Description: 
Configure scripts check if rb_hash_foreach function exists
using the following command.  if it does not exist, it is assumed the
release level is prior to 1.8.2.  

$ /opt/csw/bin/ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [sparc-solaris2.8]

$ /opt/csw/bin/ruby -r mkmf -e 'have_func("rb_hash_foreach")'
checking for rb_hash_foreach()... no

====================================================================== 

---------------------------------------------------------------------- 
 (0005558) bwalton (manager) - 2009-02-22 01:15
 http://opencsw.org/bugtrack/view.php?id=3445#c5558 
---------------------------------------------------------------------- 
The have_func feature of mkmf is a header test.  The function is defined in
/opt/csw/lib/ruby/1.8/$arch-solaris2.8/intern.h.  I'll determine why the
test is failing to find this function.

Confirmed on solaris 10 x86 (other platforms not tested yet).

-Ben 

---------------------------------------------------------------------- 
 (0005559) bwalton (manager) - 2009-02-22 03:29
 http://opencsw.org/bugtrack/view.php?id=3445#c5559 
---------------------------------------------------------------------- 
have_func builds a small c extension that requires the rb_hash_foreach
symbol.  This is linked against ruby-static.  The ruby-static library isn't
included with the package.  I'll resolve this asap. 

---------------------------------------------------------------------- 
 (0005561) bwalton (manager) - 2009-02-22 14:23
 http://opencsw.org/bugtrack/view.php?id=3445#c5561 
---------------------------------------------------------------------- 
Modified the GAR build to allow libruby-static.a to be bundled.  Have
verified the problem is resolved after including this file.  I'll have
packages in testing/ by days end. 

---------------------------------------------------------------------- 
 (0005562) mwatters (reporter) - 2009-02-23 17:49
 http://opencsw.org/bugtrack/view.php?id=3445#c5562 
---------------------------------------------------------------------- 
I have tested it and ruby itself works fine.

however, the dependency list is wrong or there is still a bug  ;)

I found that I actually needed the gcc binary itself and not just the
libraries
for mkmf...have_func  work correctly

The output of mkmf.log is below. 
without gcc it rb_hash_foreach returns no and fails with the shell command
{path to gcc}/gcc not found.  

$ cat mkmf.log 
have_func: checking for rb_hash_foreach()... -------------------- yes

"/opt/csw/gcc4/bin/gcc -o conftest -I.
-I/opt/csw/lib/ruby/1.8/sparc-solaris2.8 -I. -I/opt/csw/include
-D_FILE_OFFSET_BITS=64 -I/opt/csw/include -O2 -pipe -mcpu=v8
-I/opt/csw/include  -fPIC   conftest.c  -L. -L/opt/csw/lib
-Wl,-R/opt/csw/lib -L. -L/opt/csw/gcc4/lib -mcpu=v8 -L/opt/csw/lib
-R/opt/csw/lib/\\\\\\$ISALIST -R/opt/csw/lib     -lruby-static  -lrt
-lpthread -ldl -lcrypt -lm   -lc"
conftest.c: In function 't':
conftest.c:3: error: 'rb_hash_foreach' undeclared (first use in this
function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))rb_hash_foreach;
return 0; }
/* end */

"/opt/csw/gcc4/bin/gcc -o conftest -I.
-I/opt/csw/lib/ruby/1.8/sparc-solaris2.8 -I. -I/opt/csw/include
-D_FILE_OFFSET_BITS=64 -I/opt/csw/include -O2 -pipe -mcpu=v8
-I/opt/csw/include  -fPIC   conftest.c  -L. -L/opt/csw/lib
-Wl,-R/opt/csw/lib -L. -L/opt/csw/gcc4/lib -mcpu=v8 -L/opt/csw/lib
-R/opt/csw/lib/\\\\\\$ISALIST -R/opt/csw/lib     -lruby-static  -lrt
-lpthread -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { rb_hash_foreach(); return 0; }
/* end */

-------------------- 

---------------------------------------------------------------------- 
 (0005563) bwalton (manager) - 2009-02-23 18:02
 http://opencsw.org/bugtrack/view.php?id=3445#c5563 
---------------------------------------------------------------------- 
Looking at how Debian package ruby, they've split out a ruby-dev package
which includes the headers, mkmf module and libruby stuff.  I think that
would be a better solution for us too, thus the gcc dependency would only
affect people that want to build native extensions.  Will try to get to
this today. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-02-21 22:31 mswatters      New Issue                                    
2009-02-22 01:15 bwalton        Note Added: 0005558                          
2009-02-22 01:15 bwalton        Assigned To               => bwalton         
2009-02-22 01:15 bwalton        Status                   new => confirmed    
2009-02-22 03:29 bwalton        Note Added: 0005559                          
2009-02-22 14:23 bwalton        Note Added: 0005561                          
2009-02-23 17:49 mwatters       Note Added: 0005562                          
2009-02-23 18:02 bwalton        Note Added: 0005563                          
======================================================================




More information about the bug-notifications mailing list