Ruby for AIX 5.2?

Latest stable ruby, as well as 1.8.1 preview 4, does not build on AIX
5L using gcc (xlc not an option for me right now).

Anyone have manual steps required to compile with gcc on 5.2? Willing
to use older release of ruby, so long as it builds.

dfelicia --> oslevel -r
5200-02

dfelicia --> gcc --version
gcc (GCC) 3.3.2
Copyright © 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

Thanks!

FYI, here is the build error:

gcc -g -O2 -I. -I. -c dmyext.c
ar rcu libruby-static.a array.o bignum.o class.o compar.o
dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o
io.o marshal.o math.o numeric.o object.o pack.o parse.o
process.o prec.o random.o range.o re.o regex.o ruby.o signal.o
sprintf.o st.o string.o struct.o time.o util.o variable.o
version.o flock.o dmyext.o
gcc -g -O2 -I. -I. -c main.c
gcc -g -O2 -brtl main.o dmyext.o libruby-static.a -ldl
-lcrypt -lm -o miniruby
gcc: `-b’ must come at the start of the command line
make: 1254-004 The error code from the last command is 1.

dfelicia → oslevel -r
5200-02

The solution I’m providing works on AIX 5.1, and I expect on 5.2, also.

I promised matz a bug report, but I have not yet filed it (bad luke!).

gcc: `-b’ must come at the start of the command line
make: 1254-004 The error code from the last command is 1.

find . -name Makefile -exec perl -pi -e ‘s/ -brtl$//’ {} ;

This basically just removes any -b settings at the end of lines. The
-brtl is in there twice for some reason, so this doesn’t affect
functionality, just compilability.

And you might need this:

perl -pi -e ‘s/^.+RSTRING.+$//’ ext/syck/emitter.c

I had some strange behaviour, getting an error on a commented line (!),
and this removes that line, thus allowing emmitter to be compiled.

Good luck.

Luke

···

On Tue, 23 Dec 2003, Don wrote:


It’s a small world, but I wouldn’t want to paint it.
– Stephen Wright

Latest stable ruby, as well as 1.8.1 preview 4, does not build on AIX
5L using gcc (xlc not an option for me right now).

Anyone have manual steps required to compile with gcc on 5.2? Willing
to use older release of ruby, so long as it builds.

FYI, here is the build error:

gcc -g -O2 -I. -I. -c dmyext.c
ar rcu libruby-static.a array.o bignum.o class.o compar.o
dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o
io.o marshal.o math.o numeric.o object.o pack.o parse.o
process.o prec.o random.o range.o re.o regex.o ruby.o signal.o
sprintf.o st.o string.o struct.o time.o util.o variable.o
version.o flock.o dmyext.o
gcc -g -O2 -I. -I. -c main.c
gcc -g -O2 -brtl main.o dmyext.o libruby-static.a -ldl
-lcrypt -lm -o miniruby

-brtl is an option for the binder/linker. So in gcc you should
rite -Wl,-brtl.

Philippe Lucas.

···

----- Original Message -----
From: “Don” don_feliciano@mailblocks.com
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, December 22, 2003 6:36 PM
Subject: Ruby for AIX 5.2?

Luke’s changes work, plus one more (which he sent me in a mail):

Add -liconv to DLDFLAGS in ext/iconv/Makefile.

Without that flag, you will get (with -bnoquiet):

ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR
Import-File{Shared-object}
RLD: Address Section Rld-type
Referencing Symbol

···

.iconv_open [40] ER PR iconv.c(iconv.o)
00000200 .text R_RBR [556]
<.iconv_create>
00000258 .text R_RBR [556]
<.iconv_create>
.iconv_close [52] ER PR iconv.c(iconv.o)
000002f8 .text R_RBR [574]
<.iconv_dfree>
00000350 .text R_RBR [583]
<.iconv_free>
.iconv [72] ER PR iconv.c(iconv.o)
0000049c .text R_RBR [605]
<.iconv_try>
ER: The return code is 8.
make: 1254-004 The error code from the last command is 8.

Thanks for the work-arounds, Luke!

“Luke A. Kanies” luke@madstop.com wrote in message news:Pine.GSO.4.51.0312221209190.26884@pixie

On Tue, 23 Dec 2003, Don wrote:

dfelicia → oslevel -r
5200-02

The solution I’m providing works on AIX 5.1, and I expect on 5.2, also.

I promised matz a bug report, but I have not yet filed it (bad luke!).

gcc: `-b’ must come at the start of the command line
make: 1254-004 The error code from the last command is 1.

find . -name Makefile -exec perl -pi -e ‘s/ -brtl$//’ {} ;

This basically just removes any -b settings at the end of lines. The
-brtl is in there twice for some reason, so this doesn’t affect
functionality, just compilability.

And you might need this:

perl -pi -e ‘s/^.+RSTRING.+$//’ ext/syck/emitter.c

I had some strange behaviour, getting an error on a commented line (!),
and this removes that line, thus allowing emmitter to be compiled.

Good luck.

Luke

Hi,

The solution I’m providing works on AIX 5.1, and I expect on 5.2, also.

I promised matz a bug report, but I have not yet filed it (bad luke!).

I have no way to confirm, but does this patch fix the problem?

— /tmp/ruby-1.8.1/configure 2003-12-22 18:27:43.000000000 +0900
+++ configure 2003-12-23 17:35:50.000000000 +0900
@@ -13615,3 +13615,3 @@
DLDFLAGS="$DLDFLAGS "‘-brtl -eInit_$(TARGET) -bI:$(topdir)/ruby.imp -bM:SRE -T512 -H512 -lc’

  •   	LDFLAGS="$LDFLAGS -brtl"
    
  •   	: LDFLAGS="$LDFLAGS -brtl"
      	: ${ARCHFILE="ruby.imp"}
    
···

In message “Re: Ruby for AIX 5.2?” on 03/12/23, “Luke A. Kanies” luke@madstop.com writes:

Hello,

I have no way to confirm, but does this patch fix the problem?

— /tmp/ruby-1.8.1/configure 2003-12-22 18:27:43.000000000 +0900
+++ configure 2003-12-23 17:35:50.000000000 +0900
@@ -13615,3 +13615,3 @@
DLDFLAGS="$DLDFLAGS "‘-brtl -eInit_$(TARGET) -bI:$(topdir)/ruby.imp -bM:SRE -T512 -H512 -lc’

  • 	LDFLAGS="$LDFLAGS -brtl"
    
  • 	: LDFLAGS="$LDFLAGS -brtl"
    	: ${ARCHFILE="ruby.imp"}
    

No, that patch does not appear to fix the problem. It’s much closer, but
-brtl is still not at the very beginning of the command:

/usr/local/bin/gcc -Wall -I/usr/local/include -L/usr/local/lib
-Wl,-bE:ruby.imp -L. -L"/usr/local/lib" -brtl …

I can’t really find how this is happening, so I can’t try out different
fixes.

I’ve also attached a log of the config and make sessions, as I get a lot
of warnings. This is all with gcc 3.3.1 on AIX 5.1 (5.2 seems to be
pretty darn similar, for these purposes).

BTW, it appears that that the paths for ar and nm are hardcoded to
/usr/local/bin, but ranlib is not. I know AIX’s ar is kinda broken, so
this may be a good thing, but AIX’s ranlib does not work with GNU ar,
apparently, so these should probably be made consistent.

I’m also going to try the compile with AIX’s compiler and see how that
works.

I’m leaving in an hour for my Xmas holiday, but I’m willing to try any
tests you want when I get back.

Luke

make.log.gz (4.79 KB)

config.log.gz (14.6 KB)

···

On Tue, 23 Dec 2003, Yukihiro Matsumoto wrote:


Health is merely the slowest possible rate at which one can die.

Hi,

···

In message “Re: Ruby for AIX 5.2?” on 03/12/24, “Luke A. Kanies” luke@madstop.com writes:

No, that patch does not appear to fix the problem. It’s much closer, but
-brtl is still not at the very beginning of the command:

That’s too bad. From the attached information, at least
-with-static-linked-ext is broken on AIX. Can anybody try without
-with-static-linked-ext?

						matz.

When I try it without static, I cannot get past bigdecimal. It fails to
compile because it is missing many symbols, all of the ruby symbols,
presumably contained in the ruby library.

AFAIK (which is not much, in this case), AIX uses .a for static and
dynamic libraries, so maybe that is causing a problem.

I actually think that the --with-static-linked-ext is working; I forgot
that I had configured with that, and prior to using it I could not get
past some of the ext modules (in addition to the fore-mentioned
bigdecimal, I’ve also had problems with ext/iconv needing to have -liconv
added to the Makefile).

I won’t have access to an AIX box again for a week, and I won’t have
regular access again until 1/12, but maybe Don Feliciano can do testing
until I get back. I don’t currently have a 5.2 host for building, but
I’ll be glad to post bug reports et al when I get back on 5.1 and 4.3
(although 4.3 is no longer supported, so I could just skip that), and I’ll
join the ruby-core list so I can post them directly instead of to
ruby-talk.

I would certainly like to see ruby compile with no modifications on AIX;
if we can get IBM to start liking ruby, that could help. They’re
certainly supporting cfengine, and that helps immeasurably when convincing
large companies that they should use it.

I’ll still have access to email this week, though, if it matters.

Luke

···

On Wed, 24 Dec 2003, Yukihiro Matsumoto wrote:

Hi,

In message “Re: Ruby for AIX 5.2?” > on 03/12/24, “Luke A. Kanies” luke@madstop.com writes:

No, that patch does not appear to fix the problem. It’s much closer, but
-brtl is still not at the very beginning of the command:

That’s too bad. From the attached information, at least
-with-static-linked-ext is broken on AIX. Can anybody try without
-with-static-linked-ext?


“Wouldn’t the sentence ‘I want to put a hyphen between the words Fish
and And and And and Chips in my Fish-And-Chips sign’ have been clearer
if quotation marks had been placed before Fish, and between Fish and
and, and and and And, and And and and, and and and And, and And and
and, and and and Chips, as well as after Chips?”

Well, I’m currently working on a contract at IBM in Boulder and I’m doing
what I can to promote Ruby in my group. I think the “Teach Yourself Ruby
in 21 Days” book that I picked up at the Ruby Conference will help.

– Matt
Experience: That which allows you to recognize a mistake when you make it
again.

···

On Wed, 24 Dec 2003, Luke A. Kanies wrote:

I would certainly like to see ruby compile with no modifications on AIX;
if we can get IBM to start liking ruby, that could help. They’re
certainly supporting cfengine, and that helps immeasurably when convincing
large companies that they should use it.

Hi,

That’s too bad. From the attached information, at least
-with-static-linked-ext is broken on AIX. Can anybody try without
-with-static-linked-ext?

When I try it without static, I cannot get past bigdecimal. It fails to
compile because it is missing many symbols, all of the ruby symbols,
presumably contained in the ruby library.

Hmm, I have never compiled Ruby on AIX, but the patch was submitted to
make dynamic loading possible. AIX might have changed since then, or
maybe I made some bad change for the AIX port.

Perhaps we are running out of time. 1.8.1 will not be compiled on
AIX. Unless somebody port Ruby to AIX again, or give me AIX box
access, the problem will remain. I’m awfully sorry.

						matz.
···

In message “Re: Ruby for AIX 5.2?” on 03/12/24, “Luke A. Kanies” luke@madstop.com writes:

Hi,

When I try it without static, I cannot get past bigdecimal. It fails to
compile because it is missing many symbols, all of the ruby symbols,
presumably contained in the ruby library.

AFAIK (which is not much, in this case), AIX uses .a for static and
dynamic libraries, so maybe that is causing a problem.

Is ruby.imp file for that purpose? It isn’t created?

bigdecimal, I’ve also had problems with ext/iconv needing to have -liconv
added to the Makefile).

It means have_library(“iconv”) couldn’t detect iconv library.
Can you show ext/iconv/mkmf.log?

···

At Wed, 24 Dec 2003 05:19:14 +0900, Luke A. Kanies wrote:


Nobu Nakada

You are welcome to an account on my AIX box. However, it is running
4.3.3 and can’t be upgraded to 5.2. IBM has dropped support for many of
the older RS/6000s.

– Matt
Experience: That which allows you to recognize a mistake when you make it
again.

···

On Wed, 24 Dec 2003, Yukihiro Matsumoto wrote:

Perhaps we are running out of time. 1.8.1 will not be compiled on
AIX. Unless somebody port Ruby to AIX again, or give me AIX box
access, the problem will remain. I’m awfully sorry.