Thread library issue with 64-bit Ruby on OS X

D

Daniel Berger

Hi all,

OS X 10.4.9
Dual Xeon, dual core (Mac tower)

I built 1.8.6-p36 using gcc -m64 -Wall. It seemed to go fine, until the
very end when it gave me this warning:

ld64 warning: in /usr/lib/libobjc.dylib, missing required architecture
x86_64 in file

I ignored it, installed anyway, and most things seem to work. One thing
that failed (which I noticed as a result of the post-install from
rubygems) was that it won't load the thread library:

LoadError: Failed to load
/opt/test/lib/ruby/site_ruby/1.8/i686-darwin8.9.1/thread.bundle
from
/opt/test/lib/ruby/site_ruby/1.8/i686-darwin8.9.1/thread.bundle
from /opt/test/lib/ruby/site_ruby/1.8/thread.rb:5
from (irb):1:in `require'
from (irb):1

So, I went to the ext/thread source directory and rebuilt. This was the
result:

gcc -Wall -m64 -I. -I/opt/test/lib/ruby/1.8/i686-darwin8.9.1
-I/opt/test/lib/ruby/1.8/i686-darwin8.9.1 -I. -DUSE_MEM_POOLS
-fno-common -g -O2 -pipe -fno-common -c thread.c
thread.c: In function 'wait_condvar':
thread.c:676: warning: passing argument 1 of 'rb_ensure' from
incompatible pointer type
cc -dynamic -bundle -undefined suppress -flat_namespace -o thread.bundle
thread.o -L"." -L"/opt/test/lib" -L. -ldl -lobjc

So, outside the warning, it built successfully. I installed it again
(and removed the old one to be sure), but I still get the same error
when I try to load it.

Any ideas?

Thanks,

Dan
 
D

Daniel Berger

Daniel said:
Hi all,

OS X 10.4.9
Dual Xeon, dual core (Mac tower)

I built 1.8.6-p36 using gcc -m64 -Wall. It seemed to go fine, until the
very end when it gave me this warning:

ld64 warning: in /usr/lib/libobjc.dylib, missing required architecture
x86_64 in file

<snip>

Oops, seems Tiger doesn't actually support 64-bit computing yet. I'll
have to wait for Leopard.

Disregard.

Dan
 
M

Michal Suchanek

<snip>

Oops, seems Tiger doesn't actually support 64-bit computing yet. I'll
have to wait for Leopard.

Disregard.
Anyway, the default Ruby linker flags (-undefined suppress) can build
(and happily install) extensions that miss libraries.
I am not sure why these flags are used but I have seen quite a few
extensions linked improperly because of this. However, ruby does not
complain about missing symbols while loading the extension so this
might something else.

Thanks

Michal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top