Ruby for AIX 5.2?

D

Don

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 (C) 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.
 
L

Luke A. Kanies

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
 
D

Don

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!
 
P

Philippe Lucas

----- Original Message -----
From: "Don" <[email protected]>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <[email protected]>
Sent: Monday, December 22, 2003 6:36 PM
Subject: 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.

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.
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: Ruby for AIX 5.2?"

|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"}
 
Y

Yukihiro Matsumoto

Hi,


In message "Re: Ruby for AIX 5.2?"

|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.
 
L

Luke A. Kanies

Hi,


In message "Re: Ruby for AIX 5.2?"

|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?

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

--
"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?"
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: Ruby for AIX 5.2?"

|> 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.
 
N

nobu.nokada

Hi,

At Wed, 24 Dec 2003 05:19:14 +0900,
Luke said:
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?
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top