Problem building Ruby 1.9.3 patchlevel 385 under AIX 7.1

Hello World!

I am trying to build Ruby 1.9.3 patchlevel 385 under AIX 7.1. The
./configure phase goes OK. The make part did not go well and end up with
the errors listed below.
Any help will be really appreciated.

[nim]:root:/export/software/other_software/ruby-1.9.3-p385 # make
CC = gcc
LD = ld
LDSHARED = gcc -Wl,-G
CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter
-Wno-parentheses -Wno-long-long -Wno-missing-field-initializers
-Werror=pointer-arith -Werror=write-strings
-Werror=declaration-after-statement
-Werror=implicit-function-declaration
XCFLAGS = -include ruby/config.h -include ruby/missing.h
-DRUBY_EXPORT
CPPFLAGS = -I. -I.ext/include/rs6000-aix -I./include -I.
DLDFLAGS = -eInit_
SOLIBS =
linking miniruby
rbconfig.rb unchanged
generating enc.mk
generating prelude.c
compiling prelude.c
linking static-library libruby-static.a
generating encdb.h
encdb.h unchanged
making enc
Target “enc” is up to date.
making srcs under enc
Target “srcs” is up to date.
generating transdb.h
transdb.h unchanged
making ./enc/trans
Target “./enc/trans” is up to date.
making encs
Target “encs” is up to date.
installing default resize libraries
Target “all” is up to date.
installing default bug libraries
Target “all” is up to date.
installing default bug libraries
Target “all” is up to date.
installing default funcall libraries
Target “all” is up to date.
linking shared-object -test-/load/dot.dot/dot.dot.so
ld: 0711-327 WARNING: Entry point not found: Init_dot.dot
ld: 0711-244 ERROR: No csects or exported symbols have been saved.
collect2: error: ld returned 8 exit status
make: 1254-004 The error code from the last command is 1.

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

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

Stop.

Thank you

Anybody there? Anybody at all!

Subject: Re: Problem building Ruby 1.9.3 patchlevel 385 under AIX 7.1
Date: gio 28 feb 13 02:52:11 +0900

Quoting Ruby S. ([email protected]):

Anybody there? Anybody at all!

Probably there’s nobody who dabbles with AIX. I myself know nothing
about it.

The only thing I see is that you are compiling over a previous
compilation - maybe you should start from a clean source. At this
point, you can experiment with 2.0:

http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz

But if that error of yours pops up again, there is little I can
say. You may try asking in an AIX forum…

Carlo

Ruby S. wrote in post #1095594:

Hello World!

I am trying to build Ruby 1.9.3 patchlevel 385 under AIX 7.1. The
./configure phase goes OK. The make part did not go well and end up with
the errors listed below.
Any help will be really appreciated.

Have you considered using JRuby?

On Thu, 28 Feb 2013, Claus Folke B. wrote:

Ruby S. wrote in post #1095594:

Hello World!

I am trying to build Ruby 1.9.3 patchlevel 385 under AIX 7.1. The
./configure phase goes OK. The make part did not go well and end up with
the errors listed below.
Any help will be really appreciated.

Have you considered using JRuby?

When I was working with AIX a year ago, that’s what I did. There is an
issue with the IBM version of Java not accepting a command line flag
that
the script that invokes JRuby uses. You can find it easily with a
search.

– Matt
It’s not what I know that counts.
It’s what I can remember in time to use.

On Feb 27, 2013, at 09:52 , Ruby S. [email protected] wrote:

    LD = ld

compiling prelude.c
Target “./enc/trans” is up to date.
linking shared-object -test-/load/dot.dot/dot.dot.so
ld: 0711-327 WARNING: Entry point not found: Init_dot.dot
ld: 0711-244 ERROR: No csects or exported symbols have been saved.
collect2: error: ld returned 8 exit status
make: 1254-004 The error code from the last command is 1.

This problem is probably better posed to ruby-core@ instead of here…
but to start, let’s look at your problem:

10003 % more ext/-test-/load/dot.dot/dot.dot.c
void Init_dot(void) {}

Nothing really in there BUT the one function you’re having problems
with.

10004 % nm ext/-test-/load/dot.dot/dot.dot.o
0000000000000ef0 s EH_frame1
0000000000000000 T _Init_dot
0000000000000f08 S _Init_dot.eh

10013 % nm .ext//-test-/load/dot.dot/dot.dot.
0000000000000f60 T _Init_dot
U dyld_stub_binder

You can see the T entry for _Init_dot. I’m guessing you have that. Why
you’re trying to pick up Init_dot.dot instead of Init_dot is strange and
points at the loader not assembling the right name to begin with. I’m
not familiar with that code and someone else on ruby-core@ will have to
help. Please provide your equivalents to my commands above when you mail
them. You can also use http://bugs.ruby-lang.org/ to file the ticket
directly.

On Thu, Feb 28, 2013 at 6:43 AM, Ryan D. [email protected]
wrote:

You can see the T entry for _Init_dot. I’m guessing you have that. Why you’re
trying to pick up Init_dot.dot instead of Init_dot is strange and points at the
loader not assembling the right name to begin with.

That’s because the configure script set “DLDFLAGS=‘-eInit_$(TARGET)’” on
AIX
and mkmf.rb creates Makefile which contains “TARGET = dot.dot”.

IMO, one line in configure.in should be changed as follows:

    [aix*], [  : ${LDSHARED='$(CC)'}
  LDSHARED="$LDSHARED ${linker_flag}-G"
  DLDFLAGS='-e$(ENTRY_POINT)'        # CHANGE THIS LINE
  XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl"

and two lines in lib/mkmf.rb should be added as follows:

dllib = target ? “$(TARGET).#{CONFIG[‘DLEXT’]}” : “”
entry_point = target ? “Init_#{target}”.sub(/..*\z/,‘’) : “” # ADD
THIS LINE (1)
staticlib = target ? “$(TARGET).#$LIBEXT” : “”

TARGET = #{target}
DLLIB = #{dllib}
ENTRY_POINT = #{entry_point} # ADD THIS LINE (2)
EXTSTATIC = #{$static || “”}
STATIC_LIB = #{staticlib unless $static.nil?}

I have not tested this because I don’t have AIX.

On Feb 27, 2013, at 14:21 , Kubo T. [email protected] wrote:

On Thu, Feb 28, 2013 at 6:43 AM, Ryan D. [email protected] wrote:

You can see the T entry for _Init_dot. I’m guessing you have that. Why you’re
trying to pick up Init_dot.dot instead of Init_dot is strange and points at the
loader not assembling the right name to begin with.

That’s because the configure script set “DLDFLAGS=‘-eInit_$(TARGET)’” on AIX
and mkmf.rb creates Makefile which contains “TARGET = dot.dot”.

IMO, one line in configure.in should be changed as follows: […]

can you provide that in unified diff format so we can more cleanly apply
it?

On Thu, Feb 28, 2013 at 9:09 AM, Ryan D. [email protected]
wrote:

can you provide that in unified diff format so we can more cleanly apply it?

I found that it had already fixed in ruby 2.0.0.
http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/36338
http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/36432
http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/36502
Backporting them to ruby_1_9_3 branch will be better than applying my
change.

OK. I made the suggested changes and I got the following errors. Please
note that I am displaying only the last few records:
socket.c: In function ‘socket_s_ip_address_list’:
socket.c:1507:5: warning: implicit declaration of function ‘getifaddrs’
[-Wimplicit-function-declaration]
socket.c:1513:27: error: dereferencing pointer to incomplete type
socket.c:1514:14: error: dereferencing pointer to incomplete type
socket.c:1514:36: error: dereferencing pointer to incomplete type
socket.c:1514:36: error: dereferencing pointer to incomplete type
socket.c:1515:45: error: dereferencing pointer to incomplete type
socket.c:1519:5: warning: implicit declaration of function ‘freeifaddrs’
[-Wimplicit-function-declaration]
make: 1254-004 The error code from the last command is 1.

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

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

Stop.

ALSO:
I try Ruby 2.0.0-p0 and got the following error:
[nim]:root:/export/software/other_software/ruby_2.0.0_p0/ruby-2.0.0-p0 #
./configure
./configure[2783]: syntax error at line 19075 : `(’ unexpected

Thank you

Takehiro Kubo wrote in post #1099550:

I found that it had already fixed in ruby 2.0.0.
http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/36338
http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/36432
http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/36502
Backporting them to ruby_1_9_3 branch will be better than applying my
change.

Thank you! I found the first of these changes are already in
ruby-1.9.3-p448, the last is not but got me building and functional on
aix-5.3. In patch form:

diff -ur ruby-1.9.3-p448/enc/Makefile.in
ruby-1.9.3-p448-patched/enc/Makefile.in
— ruby-1.9.3-p448/enc/Makefile.in 2011-07-31 09:59:04.000000000 -0400
+++ ruby-1.9.3-p448-patched/enc/Makefile.in 2013-09-10
14:59:36.000000000 -0400
@@ -48,9 +48,13 @@
LDSHARED = @LDSHARED@
ldflags = $(LDFLAGS)
dldflags = @DLDFLAGS@
+extdldflags = @EXTDLDFLAGS@
archflag = @ARCH_FLAG@
-DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
+DLDFLAGS = $(ldflags) $(dldflags) $(extdldflags) $(archflag)
RUBY = $(MINIRUBY)
+TARGET_NAME_ = $(@F) # BSD make seems unable to deal with @F with
substitution
+TARGET_NAME = $(TARGET_NAME_:.@DLEXT@=)
+TARGET_ENTRY = @EXPORT_PREFIX@Init_$(TARGET_NAME)

WORKDIRS = @WORKDIRS@

diff -ur ruby-1.9.3-p448/enc/depend ruby-1.9.3-p448-patched/enc/depend
— ruby-1.9.3-p448/enc/depend 2011-06-15 20:10:10.000000000 -0400
+++ ruby-1.9.3-p448-patched/enc/depend 2013-09-10 14:59:36.000000000
-0400
@@ -1,8 +1,6 @@
% inplace = File.identical?($srcdir, “.”)
% workdirs = %w"$(ENCSODIR) $(TRANSSODIR) enc enc/trans"
% CONFIG[“WORKDIRS”] = workdirs.join(’ ')
-% CONFIG[“DLDFLAGS”].sub!(/(\A|\s)(-\S+(?:\s*\w*)?$(TARGET)\S*)/,
‘\1’)
-% dldflags = $2
% enable_shared = CONFIG[‘ENABLE_SHARED’] == ‘yes’
% deffile = (true if /$(DEFFILE)/ =~ CONFIG[“LINK_SO”])
% encs = Dir.open($srcdir) {|d| d.grep(/.+.c\z/)} - BUILTIN_ENCS
@@ -119,7 +117,6 @@
$(ECHO) linking <%=mesg%> $(@F)
% cmd = link_so.sub(/$(OBJS)/) {obj}
% base = File.basename(e)
-% cmd.sub!(/(?=$(DLDFLAGS))/) {dldflags.sub(/$(TARGET)/) {base}

  • " "} if dldflags
    % if df
    $(Q)echo> <%=df%> EXPORTS
    $(Q)echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=base%>
    diff -ur ruby-1.9.3-p448/win32/Makefile.sub
    ruby-1.9.3-p448-patched/win32/Makefile.sub
    — ruby-1.9.3-p448/win32/Makefile.sub 2013-03-28 06:10:00.000000000
    -0400
    +++ ruby-1.9.3-p448-patched/win32/Makefile.sub 2013-09-10
    14:59:36.000000000 -0400
    @@ -761,6 +761,7 @@
    s,@XCFLAGS@,$(XCFLAGS),;t t
    s,@XLDFLAGS@,$(XLDFLAGS),;t t
    s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH),;t t
    +s,@EXTDLDFLAGS@,$(EXTDLDFLAGS),;t t
    s,@ARCH_FLAG@,$(ARCH_FLAG),;t t
    s,@STATIC@,$(STATIC),;t t
    s,@CCDLFLAGS@,;t t