Ruby load problem on AIX

Hi,
   I have built Ruby 1.8.5 on an AIX 5.2 64 bit machine. I am using
xlc with OBJECT_MODE=64. When I try to run the following:

$ gem install rails --include-dependencies
/fasthome/fast3/manas/ruby185/lib/ruby/1.8/powerpc-aix5.3.0.0/
socket.so: load failed - /fasthome/fast3/manas/ruby185/lib/ruby/1.8/
powerpc-aix5.3.0.0/socket.so Not enough spac (LoadError)
        from /fasthome/fast3/manas/ruby185/lib/ruby/1.8/net/
protocol.rb:21

Any help or tips is appreciated.

Thanks in advance.

Regards,
-MD

Hi,

Have you resolved this issue?
I tried to investigate why load() failed, but I was not able to figure out.

Attached patch is to change dln.c behavior not to use load() but dlopen()
for AIX. This seemed to work in my environment.

% oslevel -s
5300-05-06

% ~/r185-64/bin/ruby -v -rsocket -e 'p IPSocket.getaddress("www.ruby-lang.org")'
ruby 1.8.5 (2006-08-25) [powerpc-aix5.3.0.0]
"221.186.184.68"

% ~/r185-64/bin/ruby -e 'p 0xffffffff.class'
Fixnum

If you have any other solution, let me know.

64.diff.gz (1.73 KB)

···

2007/4/2, MD <manasd@gmail.com>:

Hi,
   I have built Ruby 1.8.5 on an AIX 5.2 64 bit machine. I am using
xlc with OBJECT_MODE=64. When I try to run the following:

$ gem install rails --include-dependencies
/fasthome/fast3/manas/ruby185/lib/ruby/1.8/powerpc-aix5.3.0.0/
socket.so: load failed - /fasthome/fast3/manas/ruby185/lib/ruby/1.8/
powerpc-aix5.3.0.0/socket.so Not enough spac (LoadError)
        from /fasthome/fast3/manas/ruby185/lib/ruby/1.8/net/
protocol.rb:21

--
Yutaka KANEMOTO

Hi,

At Fri, 6 Apr 2007 17:43:13 +0900,
Yutaka Kanemoto wrote in [ruby-talk:246920]:

Attached patch is to change dln.c behavior not to use load() but dlopen()
for AIX. This seemed to work in my environment.

I eventually found this thread.

- DLDFLAGS='-Wl,-G -eInit_$(TARGET)'
- LDFLAGS='-Wl,-brtl -Wl,-bE:ruby.imp'
+ DLDFLAGS="${DLDFLAGS} -Wl,-G -Wl,-bnoentry -Wl,-bexpall"
+ LDFLAGS="${LDFLAGS} -Wl,-brtl -Wl,-bE:ruby.imp"

I don't know about -bnoentry and -bexpall options, are they
preferable?

-#if defined(_AIX) && ! defined(_IA64)
-static void
-aix_loaderror(const char *pathname)

Do all AIX versions support dlopen()? If not, these probably
should not be removed but be changed the condition.

···

--
Nobu Nakada

Hi,

Thank you very much for catching this thread.

> - DLDFLAGS='-Wl,-G -eInit_$(TARGET)'
> - LDFLAGS='-Wl,-brtl -Wl,-bE:ruby.imp'
> + DLDFLAGS="${DLDFLAGS} -Wl,-G -Wl,-bnoentry -Wl,-bexpall"
> + LDFLAGS="${LDFLAGS} -Wl,-brtl -Wl,-bE:ruby.imp"

I don't know about -bnoentry and -bexpall options, are they
preferable?

To follow existing code which uses dlopen(), I omitted -e option.
Then, these options are used to supress some error message.

> -#if defined(_AIX) && ! defined(_IA64)
> -static void
> -aix_loaderror(const char *pathname)

Do all AIX versions support dlopen()? If not, these probably
should not be removed but be changed the condition.

I have AIX 4.3.3 machine which is oldest in my test environment,
and it actually has dlopen(), but I think the older version AIX
would not have dlopen() (or broken?). I had prioritized the current
supported versions as matz said ( see [ruby-dev:29154]). I should
have been more carefully to support old versions.

Please give me some time to make another patch? I have noticed
the linker_flag variable you made. I will make new patch against
ruby_1_8 branch or trunk. Since I will test on various AIX versions,
it will take a little...

Thanks and best regards,

···

--
Yutaka KANEMOTO