Forum: Ruby Thread library issue with 64-bit Ruby on OS X

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Daniel B. (Guest)
on 2007-06-09 20:58
(Received via mailing list)
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
Daniel B. (Guest)
on 2007-06-09 22:38
(Received via mailing list)
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

<snip>

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

Disregard.

Dan
Michal S. (Guest)
on 2007-06-11 12:44
(Received via mailing list)
On 09/06/07, Daniel B. <removed_email_address@domain.invalid> wrote:
> > x86_64 in file
>
> <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
This topic is locked and can not be replied to.