Errors with "make" step, while compiling ruby under AIX 5.2

I am wanted to install ruby 1.8.1 under AIX 5.2. During the installation, while doing the “make” part of it, the process abruptily ended with the following errors:

Can anyone help?

Thank you

compiling digest/rmd160

/usr/ccs/bin/ld -brtl -eInit_rmd160 -bI:/installfs/ruby181/ruby-1.8.1/ruby.imp -bM:SRE -T512 -

H512 -lc -L"/installfs/ruby181/ruby-1.8.1" -L"/usr/local/lib" -o rmd160.so rmd160init.o rmd160.o rmd1

60hl.o -ldl -lcrypt -lm -lc

ld: 0711-317 ERROR: Undefined symbol: .__eprintf

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.

Stop.

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

Stop.

···

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Hi,

At Fri, 26 Mar 2004 05:25:42 +0900,
Ruby Ruby wrote in [ruby-talk:95875]:

ld: 0711-317 ERROR: Undefined symbol: .__eprintf

Seems to be used by assert() macro. This patch will disable it.

Index: ext/digest/rmd160/extconf.rb

···

===================================================================
RCS file: /pub/cvs/ruby/src/ruby/ext/digest/rmd160/extconf.rb,v
retrieving revision 1.4.2.1
diff -u -2 -p -r1.4.2.1 extconf.rb
— ext/digest/rmd160/extconf.rb 21 Jan 2004 07:01:43 -0000 1.4.2.1
+++ ext/digest/rmd160/extconf.rb 26 Mar 2004 00:50:01 -0000
@@ -4,5 +4,5 @@
require “mkmf”

-$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"
+$CPPFLAGS << " -DNDEBUG -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"

$objs = [ “rmd160init.#{$OBJEXT}” ]


Nobu Nakada

Nobu, thank you for your reply. However, now I have a new problem after implementing the patch. Below I am adding the new error and the actual patch file.

root@s19 # make

compiling Win32API

Target “all” is up to date.

Target “install” is up to date.

compiling bigdecimal

Target “all” is up to date.

compiling curses

Target “all” is up to date.

Target “install” is up to date.

compiling dbm

Target “all” is up to date.

Target “install” is up to date.

compiling digest

Target “all” is up to date.

compiling digest/md5

Target “all” is up to date.

compiling digest/rmd160

/installfs/ruby181/ruby-1.8.1/ext/digest/rmd160/extconf.rb:6: undefined method `-@’ for “-g -O2”:String (NoMethodError)

from ./ext/extmk.rb:77:in `load’

from ./ext/extmk.rb:77:in `extmake’

from ./ext/extmk.rb:224

from ./ext/extmk.rb:221:in `glob’

from ./ext/extmk.rb:221

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

Stop.

···

Here is the extconf.rb


$RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $

$Id: extconf.rb,v 1.4 2002/09/26 17:26:46 knu Exp $

require “mkmf”

-$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"

+$CPPFLAGS << " -DNDEBUG -DHAVE_CONFIG_H

-I#{File.dirname(FILE)}/…"

$objs = [ “rmd160init.#{$OBJEXT}” ]

dir_config(“openssl”)

if !with_config(“bundled-rmd160”) &&

have_library(“crypto”) && have_header(“openssl/ripemd.h”)

$objs << “rmd160ossl.#{$OBJEXT}”

$libs << " -lcrypto"

else

$objs << “rmd160.#{$OBJEXT}” << “rmd160hl.#{$OBJEXT}”

end

have_header(“sys/cdefs.h”)

have_header(“inttypes.h”)

have_header(“unistd.h”)

create_makefile(“digest/rmd160”)

Thank you for your help

nobu.nokada@softhome.net wrote:
Hi,

At Fri, 26 Mar 2004 05:25:42 +0900,
Ruby Ruby wrote in [ruby-talk:95875]:

ld: 0711-317 ERROR: Undefined symbol: .__eprintf

Seems to be used by assert() macro. This patch will disable it.

Index: ext/digest/rmd160/extconf.rb

RCS file: /pub/cvs/ruby/src/ruby/ext/digest/rmd160/extconf.rb,v
retrieving revision 1.4.2.1
diff -u -2 -p -r1.4.2.1 extconf.rb
— ext/digest/rmd160/extconf.rb 21 Jan 2004 07:01:43 -0000 1.4.2.1
+++ ext/digest/rmd160/extconf.rb 26 Mar 2004 00:50:01 -0000
@@ -4,5 +4,5 @@
require “mkmf”

-$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"
+$CPPFLAGS << " -DNDEBUG -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"

$objs = [ “rmd160init.#{$OBJEXT}” ]


Nobu Nakada


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

I am sorry to insist but this is important to me.
I’ve never applied a patch to Ruby. Please forgive my ignorance.
I was under the impression that I only had to replace segment of codes from extconf.rb with the code segment that you provided, and retry the “make” again.
I guess I am wrong!
If you or anyone else do have some instructions as to how to apply a patch or if you could point me to a place where I can get that information, I will truly appreciate it.

Thank you

Hi,

At Fri, 26 Mar 2004 05:25:42 +0900,
Ruby Ruby wrote in [ruby-talk:95875]:

ld: 0711-317 ERROR: Undefined symbol: .__eprintf

Seems to be used by assert() macro. This patch will disable it.

Index: ext/digest/rmd160/extconf.rb

···

nobu.nokada@softhome.net wrote:

RCS file: /pub/cvs/ruby/src/ruby/ext/digest/rmd160/extconf.rb,v
retrieving revision 1.4.2.1
diff -u -2 -p -r1.4.2.1 extconf.rb
— ext/digest/rmd160/extconf.rb 21 Jan 2004 07:01:43 -0000 1.4.2.1
+++ ext/digest/rmd160/extconf.rb 26 Mar 2004 00:50:01 -0000
@@ -4,5 +4,5 @@
require “mkmf”

-$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"
+$CPPFLAGS << " -DNDEBUG -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"

$objs = [ “rmd160init.#{$OBJEXT}” ]


Nobu Nakada


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Hi,

At Fri, 26 Mar 2004 12:11:54 +0900,
Ruby Ruby wrote in [ruby-talk:95888]:

compiling digest/rmd160

/installfs/ruby181/ruby-1.8.1/ext/digest/rmd160/extconf.rb:6: undefined method `-@’ for “-g -O2”:String (NoMethodError)

You miss to apply the patch.

BTW, why do you put empty lines per each lines?

This is the whole ext/digest/rmd160/extconf.rb.

$RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $

$Id: extconf.rb,v 1.6 2004/01/21 07:01:31 nobu Exp $

require “mkmf”

$CPPFLAGS << " -DNDEBUG -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"

$objs = [ “rmd160init.#{$OBJEXT}” ]

dir_config(“openssl”)

if !with_config(“bundled-rmd160”) &&
have_library(“crypto”) && have_header(“openssl/ripemd.h”)
$objs << “rmd160ossl.#{$OBJEXT}”
else
$objs << “rmd160.#{$OBJEXT}” << “rmd160hl.#{$OBJEXT}”
end

have_header(“sys/cdefs.h”)

have_header(“inttypes.h”)

have_header(“unistd.h”)

$preload = %w[digest]

create_makefile(“digest/rmd160”)

···


Nobu Nakada

Hi,

At Fri, 26 Mar 2004 23:21:23 +0900,
Ruby Ruby wrote in [ruby-talk:95918]:

I was under the impression that I only had to replace segment
of codes from extconf.rb with the code segment that you
provided, and retry the “make” again.

The patch is in the format called “unified diff”.
The lines begin with @@ start each hunks, and following lines
started with ‘-’ mean to be removed from original file and with
‘+’ mean to be added to.

If you or anyone else do have some instructions as to how to
apply a patch or if you could point me to a place where I can
get that information, I will truly appreciate it.

Use “patch” command.
http://www.gnu.org/software/patch/patch.html

$ cd /path/to/ruby/source
$ patch -p0 < ruby-talk.95883.patch

···


Nobu Nakada

Thank you for the patch information.
I was able to run the process. However, I got a new error.
Here is what I now get:

/opt/freeware/bin/patch -p0 extconf.rb < ruby-talk.95883.patch

patching file extconf.rb

patch: **** malformed patch at line 15: $objs = [ “rmd160init.#{$OBJEXT}” ]

Just for information, here is the patch:

Index: ext/digest/rmd160/extconf.rb

···

===================================================================

RCS file: /pub/cvs/ruby/src/ruby/ext/digest/rmd160/extconf.rb,v

retrieving revision 1.4.2.1

diff -u -2 -p -r1.4.2.1 extconf.rb

— ext/digest/rmd160/extconf.rb 21 Jan 2004 07:01:43 -0000 1.4.2.1

+++ ext/digest/rmd160/extconf.rb 26 Mar 2004 00:50:01 -0000

@@ -4,5 +4,5 @@

require “mkmf”

-$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"

+$CPPFLAGS << " -DNDEBUG -DHAVE_CONFIG_H

-I#{File.dirname(FILE)}/…"

$objs = [ “rmd160init.#{$OBJEXT}” ]

Again, Thank you for your help.

nobu.nokada@softhome.net wrote:
Hi,

At Fri, 26 Mar 2004 23:21:23 +0900,
Ruby Ruby wrote in [ruby-talk:95918]:

I was under the impression that I only had to replace segment
of codes from extconf.rb with the code segment that you
provided, and retry the “make” again.

The patch is in the format called “unified diff”.
The lines begin with @@ start each hunks, and following lines
started with ‘-’ mean to be removed from original file and with
‘+’ mean to be added to.

If you or anyone else do have some instructions as to how to
apply a patch or if you could point me to a place where I can
get that information, I will truly appreciate it.

Use “patch” command.
http://www.gnu.org/software/patch/patch.html

$ cd /path/to/ruby/source
$ patch -p0 < ruby-talk.95883.patch


Nobu Nakada


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Hi,

At Tue, 30 Mar 2004 01:16:15 +0900,
Ruby Ruby wrote in [ruby-talk:96043]:

patching file extconf.rb

patch: **** malformed patch at line 15: $objs = [ \223rmd160init.#{$OBJEXT}\224 ]

Seems your mail client issue. If you use a web mailer, save
the patch from ML archive instead.

http://blade.nagaokaut.ac.jp/ruby/ruby-talk/95883

Index: ext/digest/rmd160/extconf.rb

===================================================================

RCS file: /pub/cvs/ruby/src/ruby/ext/digest/rmd160/extconf.rb,v

retrieving revision 1.4.2.1

diff -u -2 -p -r1.4.2.1 extconf.rb

— ext/digest/rmd160/extconf.rb 21 Jan 2004 07:01:43 -0000 1.4.2.1

+++ ext/digest/rmd160/extconf.rb 26 Mar 2004 00:50:01 -0000

@@ -4,5 +4,5 @@

require “mkmf”

-$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"

Why extra empty lines? And following lines are really one
line.

···

+$CPPFLAGS << " -DNDEBUG -DHAVE_CONFIG_H

-I#{File.dirname(FILE)}/…"


Nobu Nakada

Well, Well I was finally able to apply the patch. My mail server was changing the patch file. However, I got the original problem back even with the new patch.
I am truly sorry that I insist with this issue. But this is important to me. I am in the process of deploying 90 RS/6000 running AIX 5.2, and I would like to make ruby perhaps the secondary language behind the Korn Shell, although I would prefer to have ruby as the primary language.

Thank you so much for your help,

Here is the error:

Target “all” is up to date.
compiling digest/rmd160 /usr/ccs/bin/ld -brtl -eInit_rmd160 -bI:/installfs/ruby181/ruby-1.8.1/ruby.imp -bM:SRE -T512 -H512 -lc -L"/installfs/ruby181/ruby-1.8.1" -L"/usr/local/lib" -o rmd160.so rmd160init.o rmd160.o rmd1 60hl.o -ldl -lcrypt -lm -lc

ld: 0711-317 ERROR: Undefined symbol: .__eprintf
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.

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

Stop.

Again, thank you for all your help.

Hi,

At Tue, 30 Mar 2004 01:16:15 +0900,
Ruby Ruby wrote in [ruby-talk:96043]:

patching file extconf.rb

patch: **** malformed patch at line 15: $objs = [ \223rmd160init.#{$OBJEXT}\224 ]

Seems your mail client issue. If you use a web mailer, save
the patch from ML archive instead.

http://blade.nagaokaut.ac.jp/ruby/ruby-talk/95883

Index: ext/digest/rmd160/extconf.rb

===================================================================

RCS file: /pub/cvs/ruby/src/ruby/ext/digest/rmd160/extconf.rb,v

retrieving revision 1.4.2.1

diff -u -2 -p -r1.4.2.1 extconf.rb

— ext/digest/rmd160/extconf.rb 21 Jan 2004 07:01:43 -0000 1.4.2.1

+++ ext/digest/rmd160/extconf.rb 26 Mar 2004 00:50:01 -0000

@@ -4,5 +4,5 @@

require “mkmf”

-$CFLAGS << " -DHAVE_CONFIG_H -I#{File.dirname(FILE)}/…"

Why extra empty lines? And following lines are really one
line.

···

nobu.nokada@softhome.net wrote:

+$CPPFLAGS << " -DNDEBUG -DHAVE_CONFIG_H

-I#{File.dirname(FILE)}/…"


Nobu Nakada


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Hi,

At Tue, 30 Mar 2004 04:18:01 +0900,
Ruby Ruby wrote in [ruby-talk:96057]:

Target “all” is up to date.
compiling digest/rmd160
/usr/ccs/bin/ld -brtl -eInit_rmd160 -bI:/installfs/ruby181/ruby-1.8.1/ruby.imp -bM:SRE -T512 -H512 -lc -L"/installfs/ruby181/ruby-1.8.1" -L"/usr/local/lib" -o rmd160.so rmd160init.o rmd160.o rmd1 60hl.o -ldl -lcrypt -lm -lc

Since the patch is to change compile flags, so you have to
remove these object files once.

$ cd ext/digest/rmd160 && make clean

···


Nobu Nakada

Hello there!
The “make clean” executed without any problems. However, I still get the same error.
As a matter of fact, I started the process from the begining with the new patch, but I still get the same problem.

I am attaching a copy of the output from the make process.

Thank you for your help

Hi,

At Tue, 30 Mar 2004 04:18:01 +0900,
Ruby Ruby wrote in [ruby-talk:96057]:

Target “all” is up to date.
compiling digest/rmd160
/usr/ccs/bin/ld -brtl -eInit_rmd160 -bI:/installfs/ruby181/ruby-1.8.1/ruby.imp -bM:SRE -T512 -H512 -lc -L"/installfs/ruby181/ruby-1.8.1" -L"/usr/local/lib" -o rmd160.so rmd160init.o rmd160.o rmd1 60hl.o -ldl -lcrypt -lm -lc

Since the patch is to change compile flags, so you have to
remove these object files once.

$ cd ext/digest/rmd160 && make clean

make_errors3 (5.58 KB)

···

nobu.nokada@softhome.net wrote:


Nobu Nakada


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Hi,

At Tue, 30 Mar 2004 04:18:01 +0900,
Ruby Ruby wrote in [ruby-talk:96057]:

Target “all” is up to date.
compiling digest/rmd160
/usr/ccs/bin/ld -brtl -eInit_rmd160 -bI:/installfs/ruby181/ruby-1.8.1/ruby.imp -bM:SRE -T512 -H512 -lc -L"/installfs/ruby181/ruby-1.8.1" -L"/usr/local/lib" -o rmd160.so rmd160init.o rmd160.o rmd1 60hl.o -ldl -lcrypt -lm -lc

Since the patch is to change compile flags, so you have to
remove these object files once.

$ cd ext/digest/rmd160 && make clean

make_errors2b (537 Bytes)

···

On my previous note I missed the part of the make with the error msg. Here it goes as an attachment. Thank you nobu.nokada@softhome.net wrote:


Nobu Nakada


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Hi,

At Tue, 30 Mar 2004 23:11:19 +0900,
Ruby Ruby wrote in [ruby-talk:96140]:

compiling digest/sha1
gcc -g -O2 -DHAVE_CONFIG_H -I/installfs/ruby181/ruby-1.8.1/ext/digest/sha1/… -I. -I/installfs/ruby181/ruby-1.8.1 -I/installfs/ruby181/ruby-1.8.1 -I/installfs/ruby181/ruby-1.8.1/ext/digest/sha1 -DHAVE_SYS_CDEFS_H -DHAVE_INTTYPES_H -DHAVE_UNISTD_H -c sha1init.c

Sorry, the patch has no effect until Makefile is re-made, you
have to do distclean not just clean.

$ cd ext/digest/rmd160 && make distclean

···


Nobu Nakada

Hello,
I ran the make distclean and tried the make again. However, I got the same error msg.
Got the same …Undefined symbol: .__eprintf.

Again, thank you for your help.

Hi,

At Tue, 30 Mar 2004 23:11:19 +0900,
Ruby Ruby wrote in [ruby-talk:96140]:

compiling digest/sha1
gcc -g -O2 -DHAVE_CONFIG_H -I/installfs/ruby181/ruby-1.8.1/ext/digest/sha1/… -I. -I/installfs/ruby181/ruby-1.8.1 -I/installfs/ruby181/ruby-1.8.1 -I/installfs/ruby181/ruby-1.8.1/ext/digest/sha1 -DHAVE_SYS_CDEFS_H -DHAVE_INTTYPES_H -DHAVE_UNISTD_H -c sha1init.c

Sorry, the patch has no effect until Makefile is re-made, you
have to do distclean not just clean.

$ cd ext/digest/rmd160 && make distclean

···

nobu.nokada@softhome.net wrote:


Nobu Nakada


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Nobu,
SUCESS, at last!
Patching …/rmd160/extconf.rb and …/sha1/extconf.rb, followed by the make distclean, followed by make, did the trick.

I thank you very much for your help.

Hi,

At Tue, 30 Mar 2004 23:11:19 +0900,
Ruby Ruby wrote in [ruby-talk:96140]:

compiling digest/sha1
gcc -g -O2 -DHAVE_CONFIG_H -I/installfs/ruby181/ruby-1.8.1/ext/digest/sha1/… -I. -I/installfs/ruby181/ruby-1.8.1 -I/installfs/ruby181/ruby-1.8.1 -I/installfs/ruby181/ruby-1.8.1/ext/digest/sha1 -DHAVE_SYS_CDEFS_H -DHAVE_INTTYPES_H -DHAVE_UNISTD_H -c sha1init.c

Sorry, the patch has no effect until Makefile is re-made, you
have to do distclean not just clean.

$ cd ext/digest/rmd160 && make distclean

···

nobu.nokada@softhome.net wrote:


Nobu Nakada


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.