# Thread library issue with 64-bit Ruby on OS X

**URL:** <https://www.ruby-forum.com/t/thread-library-issue-with-64-bit-ruby-on-os-x/106393>\
**Category:** Ruby\
**Created:** [June 9, 2007, 6:58pm UTC](https://www.ruby-forum.com/t/thread-library-issue-with-64-bit-ruby-on-os-x/106393 "2007-06-09T18:58:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [June 9, 2007, 6:58pm UTC](https://www.ruby-forum.com/t/thread-library-issue-with-64-bit-ruby-on-os-x/106393/1 "2007-06-09T18:58:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [June 9, 2007, 8:38pm UTC](https://www.ruby-forum.com/t/thread-library-issue-with-64-bit-ruby-on-os-x/106393/2 "2007-06-09T20:38:34Z")

</div>

Daniel B. wrote:

> 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

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

Disregard.

Dan

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [June 11, 2007, 10:44am UTC](https://www.ruby-forum.com/t/thread-library-issue-with-64-bit-ruby-on-os-x/106393/3 "2007-06-11T10:44:19Z")

</div>

On 09/06/07, Daniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > x86\_64 in file
> 
> 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
