# Compiling AIX 4.3.3 ruby 1.8.4

**URL:** <https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689>\
**Category:** Ruby\
**Created:** [June 17, 2006, 5:39pm UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689 "2006-06-17T17:39:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 17, 2006, 5:39pm UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/1 "2006-06-17T17:39:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 17, 2006, 5:46pm UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/2 "2006-06-17T17:46:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 17, 2006, 6:51pm UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/3 "2006-06-17T18:51:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 17, 2006, 9:25pm UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/4 "2006-06-17T21:25:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 18, 2006, 6:26am UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/5 "2006-06-18T06:26:09Z")

</div>

On 6/17/06, Lanny R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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… 🙂

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.

---

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 18, 2006, 7:40am UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/6 "2006-06-18T07:40:27Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 18, 2006, 6:50pm UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/7 "2006-06-18T18:50:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 18, 2006, 8:54am UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/8 "2006-06-18T08:54:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lanny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/cc9497/32.png) [@lanny](https://www.ruby-forum.com/u/lanny)\
**Post date:** [June 18, 2006, 10:48pm UTC](https://www.ruby-forum.com/t/compiling-aix-4-3-3-ruby-1-8-4/63689/9 "2006-06-18T22:48:09Z")

</div>

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.
