Compiling AIX 4.3.3 ruby 1.8.4

When trying to compile I received the following error(s). Could someone
please point me to a current reading on AIX 4.3 install …

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
cc -g -DRUBY_EXPORT -I. -I. -c main.c
cc main.o libruby-static.a -ldl -lcrypt -lm -o miniruby -g
-DRUBY_EXPORT -brtl
rbconfig.rb updated
compiling Win32API
compiling bigdecimal
./ext/extmk.rb:168: warning: Insecure world writable dir /tmp, mode
0241777
mkdir -p …/…/.ext/powerpc-aix4.3.3.0
cc -g -I. -I…/… -I…/…/. -I…/…/./ext/bigdecimal -c
bigdecimal.c
“…/…/config.h”, line 8.9: 1506-236 (W) Macro name _ALL_SOURCE has been
redefined.
“…/…/config.h”, line 8.9: 1506-358 (I) “_ALL_SOURCE” is defined on
line 111 of /usr/include/standards.h.
“bigdecimal.c”, line 98.28: 1506-068 (W) Operation between types
“void()(void)” and “void*” is not allowed.
/usr/ccs/bin/ld -brtl -eInit_bigdecimal -bI:…/…/ruby.imp
-bM:SRE -T512 -H512 -L"…/…" -o
…/…/.ext/powerpc-aix4.3.3.0/bigdecimal.so bigdecimal.o -ldl -lcrypt
-lm -lc
ld: 0706-003 Cannot find or read import file: …/…/ruby.imp
ld:accessx(): A file or directory in the path name does not
exist.
make: 1254-004 The error code from the last command is 255.

Stop.
make: 1254-004 The error code from the last command is 1.

Lanny R. wrote:

When trying to compile I received the following error(s). Could someone
please point me to a current reading on AIX 4.3 install …

ld: 0706-003 Cannot find or read import file: …/…/ruby.imp
ld:accessx(): A file or directory in the path name does not
exist.
make: 1254-004 The error code from the last command is 255.

Stop.
make: 1254-004 The error code from the last command is 1.

SORRY, I found the answer elsewhere. I have to make ruby.imp manually

Lanny

Hi,

At Sun, 18 Jun 2006 00:46:37 +0900,
Lanny R. wrote in [ruby-talk:197829]:

When trying to compile I received the following error(s). Could someone
please point me to a current reading on AIX 4.3 install …

ld: 0706-003 Cannot find or read import file: …/…/ruby.imp
ld:accessx(): A file or directory in the path name does not
exist.

SORRY, I found the answer elsewhere. I have to make ruby.imp manually

Manually? The rule for `all’ should have $(ARCHFILE), which is
set to ruby.imp on AIX. Can’t you show the result of this
command?

grep ARCHFILE Makefile

unknown wrote:

SORRY, I found the answer elsewhere. I have to make ruby.imp manually

Manually? The rule for `all’ should have $(ARCHFILE), which is
set to ruby.imp on AIX. Can’t you show the result of this
command?

grep ARCHFILE Makefile

Thank you for responding

Here is the output
ARCHFILE = ruby.imp
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(ARCHFILE)
@$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT)
$(ARCHFILE)

However, it did not seem to do it. I entered
make ruby.imp and got past the error message.

Now I am struggling with
./ext/extmk.rb:168: warning: Insecure world writable dir /tmp, mode
0241777
/usr/ccs/bin/ld -brtl -eInit_socket -bI:…/…/ruby.imp -bM:SRE
-T512 -H512 -L"…/…" -o …/…/.ext/powerpc-aix4.3.3.0/socket.so
socket.o -ldl -lcrypt -lm -lc
ld: 0711-317 ERROR: Undefined symbol: .CMSG_SPACE
ld: 0711-317 ERROR: Undefined symbol: .CMSG_LEN
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
make: 1254-004 The error code from the last command is 8.

The suggestion was to include -D_LINUX_SOURCE_COMPAT in the CPPFLAGS of
the Makefile in ext/socket but either I am doing it wrong or it does not
help in AIX 4.3 (the advice was for AIX 5). Any help would be
appreciated.

On 6/17/06, Lanny R. [email protected] wrote:

Now I am struggling with
./ext/extmk.rb:168: warning: Insecure world writable dir /tmp, mode
0241777

Aside: you might want to alter your setting for PATH to avoid
any references to /tmp, assuming that won’t cause problems
for you. That will get rid of the above warning that you will
keep seeing…

    /usr/ccs/bin/ld -brtl -eInit_socket -bI:../../ruby.imp -bM:SRE

-T512 -H512 -L"…/…" -o …/…/.ext/powerpc-aix4.3.3.0/socket.so
socket.o -ldl -lcrypt -lm -lc
ld: 0711-317 ERROR: Undefined symbol: .CMSG_SPACE
ld: 0711-317 ERROR: Undefined symbol: .CMSG_LEN
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
make: 1254-004 The error code from the last command is 8.

I built ruby 1.8.4 on our version of AIX 4.3 here at RPI, which
could very well be different than the real AIX 4.3… :slight_smile:

First off, make sure you have the latest version of zlib installed
(version 1.2.3 or better), and that you are certain to pick up that
new version instead of some ancient version that might be
lying around. I forget what problem comes up if you get the
wrong version, but I do know that I couldn’t get ruby to build
when I had the wrong version.

And as the error message says, you can use “-bloadmap” or
“-bnoquiet” on the command that failed, to get a more detailed
error message for whatever is failing.

My notes (to myself) for building on aix43 said:

 Add #ifndef to this definition in config.h...
      #ifndef _ALL_SOURCE
      #define _ALL_SOURCE 1
      #endif
 Apparently have to do the standard plain 'make', then do
 a 'make ruby.imp' and then redo the plain 'make'.  Weird.

I did get ruby itself built without too much trouble, although
I don’t seem to have readline hooked up right, so cursor
movements in `irb’ don’t work as well as I’d like. I never
looked into that problem, as I don’t really need to have irb
working on aix43.

Hi,

At Sun, 18 Jun 2006 04:25:49 +0900,
Lanny R. wrote in [ruby-talk:197853]:

Here is the output
ARCHFILE = ruby.imp
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(ARCHFILE)
@$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE)

However, it did not seem to do it. I entered
make ruby.imp and got past the error message.

Sorry, I added $(ARCHFILE) to the rule for all, but forgot to
commit it.

make: 1254-004 The error code from the last command is 8.
Does this patch work?

Index: common.mk

RCS file: /cvs/ruby/src/ruby/common.mk,v
retrieving revision 1.13.2.6
diff -p -U2 -r1.13.2.6 common.mk
— common.mk 13 Feb 2006 14:22:56 -0000 1.13.2.6
+++ common.mk 18 Jun 2006 05:35:05 -0000
@@ -59,5 +59,5 @@ SCRIPT_ARGS = --dest-dir="$(DESTDIR)"
EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS)
–extstatic $(EXTSTATIC) –

-all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
+all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY) $(ARCHFILE)
@$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS)
prog: $(PROGRAM) $(WPROGRAM)
Index: ext/socket/socket.c

RCS file: /cvs/ruby/src/ruby/ext/socket/socket.c,v
retrieving revision 1.108.2.51
diff -p -U2 -r1.108.2.51 socket.c
— ext/socket/socket.c 17 Jun 2006 15:53:27 -0000 1.108.2.51
+++ ext/socket/socket.c 18 Jun 2006 05:37:35 -0000
@@ -1897,4 +1897,14 @@ unix_recvfrom(argc, argv, sock)
#endif

+#if FD_PASSING_BY_MSG_CONTROL
+/* AIX 4.3 lacks these macros */
+# ifndef CMSG_SPACE
+# define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) +
_CMSG_ALIGN(len))
+# endif
+# ifndef CMSG_LEN
+# define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+# endif
+#endif
+
static VALUE
unix_send_io(sock, val)

Hi,

At Sun, 18 Jun 2006 15:54:49 +0900,
Lanny R. wrote in [ruby-talk:197912]:

I will try the ARCHIVE patch in common.mk later, now I am excited I have
compiled …

Note that it’s ARCHFILE, not ARCHIVE.

Nobuyoshi N. wrote:

Hi,

At Sun, 18 Jun 2006 04:25:49 +0900,
Lanny R. wrote in [ruby-talk:197853]:

Here is the output
ARCHFILE = ruby.imp
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(ARCHFILE)
@$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE)

However, it did not seem to do it. I entered
make ruby.imp and got past the error message.

Sorry, I added $(ARCHFILE) to the rule for all, but forgot to
commit it.

make: 1254-004 The error code from the last command is 8.
Does this patch work?

Index: common.mk

RCS file: /cvs/ruby/src/ruby/common.mk,v
retrieving revision 1.13.2.6
diff -p -U2 -r1.13.2.6 common.mk
— common.mk 13 Feb 2006 14:22:56 -0000 1.13.2.6
+++ common.mk 18 Jun 2006 05:35:05 -0000
@@ -59,5 +59,5 @@ SCRIPT_ARGS = --dest-dir="$(DESTDIR)"
EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS)
–extstatic $(EXTSTATIC) –

-all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
+all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY) $(ARCHFILE)
@$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS)
prog: $(PROGRAM) $(WPROGRAM)
Index: ext/socket/socket.c

RCS file: /cvs/ruby/src/ruby/ext/socket/socket.c,v
retrieving revision 1.108.2.51
diff -p -U2 -r1.108.2.51 socket.c
— ext/socket/socket.c 17 Jun 2006 15:53:27 -0000 1.108.2.51
+++ ext/socket/socket.c 18 Jun 2006 05:37:35 -0000
@@ -1897,4 +1897,14 @@ unix_recvfrom(argc, argv, sock)
#endif

+#if FD_PASSING_BY_MSG_CONTROL
+/* AIX 4.3 lacks these macros */
+# ifndef CMSG_SPACE
+# define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) +
_CMSG_ALIGN(len))
+# endif
+# ifndef CMSG_LEN
+# define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+# endif
+#endif
+
static VALUE
unix_send_io(sock, val)

Thank you for the response. The short answer is YES, it worked. The
longer is:

I do not know how to apply cvs/rcs to code installed from tar ball. So
what I did was to enter the code directly to socket.c.

I will try the ARCHIVE patch in common.mk later, now I am excited I have
compiled …

Thank you for your help

Lanny

Nobuyoshi N. wrote:

Hi,

At Sun, 18 Jun 2006 15:54:49 +0900,
Lanny R. wrote in [ruby-talk:197912]:

I will try the ARCHIVE patch in common.mk later, now I am excited I have
compiled …

Note that it’s ARCHFILE, not ARCHIVE.

Yes, off course, thank you.