Bug #1116: Compilation error for Solaris 10 sparc
http://redmine.ruby-lang.org/issues/show/1116

Author: Luke McOmber
Status: Open, Priority: Normal
ruby -v: ruby 1.9.1p0 (2009-01-20 revision 21700) [sparc-solaris2.10]

I configured with "./configure --prefix=/usr/local --enable-pthread"

I have tried to compile both ruby-1.9.1-p0 and ruby-1.9.1-rc2. I receive the same error with both.

The error I get is:

make[1]: Entering directory `/export/tools/ruby/ruby-1.9.1-rc2/ext/pty'
cc -I. -I../../.ext/include/sparc-solaris2.10 -I../.././include -I../.././ext/pty -DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -KPIC  -g  -o pty.o -c pty.c
"pty.c", line 425: void function cannot return value
cc: acomp failed for pty.c
make[1]: *** [pty.o] Error 2
make[1]: Leaving directory `/export/tools/ruby/ruby-1.9.1-rc2/ext/pty'
make: *** [exts] Error 1

I solved this by making the following changes:
===================================================================
--- pty.c.orig  Thu Feb  5 19:36:51 2009
+++ pty.c       Thu Feb  5 19:37:16 2009
@@ -175,7 +175,7 @@
     }
 }

-static void getDevice(int*, int*, char [DEVICELEN]);
+static VALUE getDevice(int*, int*, char [DEVICELEN]);

 struct exec_info {
     int argc;
@@ -415,7 +415,7 @@
 #endif
 }

-static void
+static VALUE
 getDevice(int *master, int *slave, char SlaveName[DEVICELEN])
 {
     if (get_device_once(master, slave, SlaveName, 0)) {
==========================================================================

Afterwords, everything finished compiling fine.

make test finished with:

PASS 928 tests
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb  "./bootstraptest/runner.rb" --ruby="ruby"  ./KNOWNBUGS.rb
2009-02-05 19:45:37 +0000
Driver is ruby 1.9.1 (2009-01-20 patchlevel 0) [sparc-solaris2.10]
Target is ruby 1.9.1p0 (2009-01-20 revision 21700) [sparc-solaris2.10]


KNOWNBUGS.rb
PASS 0 tests



Please let me know if you need any information regarding configure logs or version numbers.

Thanks.


----------------------------------------
http://redmine.ruby-lang.org