64-bit Ruby on Solaris?

Discussion in 'Ruby' started by Daniel Berger, Oct 31, 2003.

  1. Hi all,

    Solaris 9
    gcc 3.3.1
    Ruby 1.8.1 p2
    Sunblade 100, UltraSparc IIe

    As usual, I'm playing with things I don't truly understand. Anyway, I
    thought I'd try building 1.8.1 p2 as 64 bit since I've upgraded my
    compiler since last time.

    After running configure, I manually added "-m64 -mcpu=ultrasparc" into
    the CC line of the Makefile. I seemed to get further this time, and
    died with a different error:

    gcc -m64 -mcpu=ultrasparc -g -O2 -I. -I. -c io.c
    io.c: In function `rb_read_pending':
    io.c:259: error: structure has no member named `_cnt'
    io.c: In function `rb_read_check':
    io.c:266: error: structure has no member named `_cnt'
    io.c: In function `rb_io_eof':
    io.c:564: error: structure has no member named `_cnt'
    io.c:565: error: structure has no member named `_cnt'
    io.c: In function `rb_io_fread':
    io.c:683: error: structure has no member named `_cnt'
    io.c:686: error: structure has no member named `_cnt'
    io.c: In function `read_all':
    io.c:780: error: structure has no member named `_cnt'
    io.c: In function `io_read':
    io.c:842: error: structure has no member named `_cnt'
    io.c: In function `appendline':
    io.c:873: error: structure has no member named `_cnt'
    io.c:875: error: structure has no member named `_ptr'
    io.c: In function `swallow':
    io.c:963: error: structure has no member named `_cnt'
    io.c:965: error: structure has no member named `_ptr'
    io.c: In function `rb_io_each_byte':
    io.c:1222: error: structure has no member named `_cnt'
    io.c: In function `rb_io_getc':
    io.c:1254: error: structure has no member named `_cnt'
    io.c: In function `rb_getc':
    io.c:1277: error: structure has no member named `_cnt'
    io.c: In function `rb_io_sysseek':
    io.c:1515: error: structure has no member named `_cnt'
    io.c: In function `rb_io_sysread':
    io.c:1572: error: structure has no member named `_cnt'
    io.c: In function `rb_f_select':
    io.c:3256: error: structure has no member named `_cnt'
    make: *** [io.o] Error 1

    Here's my config.h file:
    #define PACKAGE_NAME ""
    #define PACKAGE_TARNAME ""
    #define PACKAGE_VERSION ""
    #define PACKAGE_STRING ""
    #define PACKAGE_BUGREPORT ""
    #define STDC_HEADERS 1
    #define HAVE_SYS_TYPES_H 1
    #define HAVE_SYS_STAT_H 1
    #define HAVE_STDLIB_H 1
    #define HAVE_STRING_H 1
    #define HAVE_MEMORY_H 1
    #define HAVE_STRINGS_H 1
    #define HAVE_INTTYPES_H 1
    #define HAVE_UNISTD_H 1
    #define _FILE_OFFSET_BITS 64
    #define HAVE_LONG_LONG 1
    #define HAVE_OFF_T 1
    #define SIZEOF_INT 4
    #define SIZEOF_SHORT 2
    #define SIZEOF_LONG 4
    #define SIZEOF_LONG_LONG 8
    #define SIZEOF___INT64 0
    #define SIZEOF_OFF_T 8
    #define SIZEOF_VOIDP 4
    #define SIZEOF_FLOAT 4
    #define SIZEOF_DOUBLE 8
    #define HAVE_PROTOTYPES 1
    #define TOKEN_PASTE(x,y) x##y
    #define HAVE_STDARG_PROTOTYPES 1
    #define NORETURN(x) x __attribute__ ((noreturn))
    #define HAVE_DECL_SYS_NERR 0
    #define HAVE_LIBCRYPT 1
    #define HAVE_LIBDL 1
    #define HAVE_DIRENT_H 1
    #define STDC_HEADERS 1
    #define HAVE_SYS_WAIT_H 1
    #define HAVE_STDLIB_H 1
    #define HAVE_STRING_H 1
    #define HAVE_UNISTD_H 1
    #define HAVE_LIMITS_H 1
    #define HAVE_SYS_FILE_H 1
    #define HAVE_SYS_IOCTL_H 1
    #define HAVE_FCNTL_H 1
    #define HAVE_SYS_FCNTL_H 1
    #define HAVE_SYS_SELECT_H 1
    #define HAVE_SYS_TIME_H 1
    #define HAVE_SYS_TIMES_H 1
    #define HAVE_SYS_PARAM_H 1
    #define HAVE_PWD_H 1
    #define HAVE_GRP_H 1
    #define HAVE_UTIME_H 1
    #define HAVE_MEMORY_H 1
    #define HAVE_SYS_RESOURCE_H 1
    #define HAVE_SYS_MKDEV_H 1
    #define HAVE_SYS_UTIME_H 1
    #define HAVE_FLOAT_H 1
    #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
    #define HAVE_ST_BLKSIZE 1
    #define HAVE_STRUCT_STAT_ST_BLOCKS 1
    #define HAVE_ST_BLOCKS 1
    #define HAVE_STRUCT_STAT_ST_RDEV 1
    #define HAVE_ST_RDEV 1
    #define GETGROUPS_T gid_t
    #define RETSIGTYPE void
    #define HAVE_ALLOCA_H 1
    #define HAVE_ALLOCA 1
    #define HAVE_FSEEKO 1
    #define HAVE_FTELLO 1
    #define HAVE_DUP2 1
    #define HAVE_MEMMOVE 1
    #define HAVE_MKDIR 1
    #define HAVE_STRCASECMP 1
    #define HAVE_STRNCASECMP 1
    #define HAVE_STRERROR 1
    #define HAVE_STRFTIME 1
    #define HAVE_STRCHR 1
    #define HAVE_STRSTR 1
    #define HAVE_STRTOUL 1
    #define HAVE_CRYPT 1
    #define HAVE_VSNPRINTF 1
    #define HAVE_ISNAN 1
    #define HAVE_FINITE 1
    #define HAVE_HYPOT 1
    #define HAVE_ACOSH 1
    #define HAVE_ERF 1
    #define HAVE_FMOD 1
    #define HAVE_KILLPG 1
    #define HAVE_WAIT4 1
    #define HAVE_WAITPID 1
    #define HAVE_SYSCALL 1
    #define HAVE_CHROOT 1
    #define HAVE_FSYNC 1
    #define HAVE_TRUNCATE 1
    #define HAVE_TIMES 1
    #define HAVE_UTIMES 1
    #define HAVE_FCNTL 1
    #define HAVE_LOCKF 1
    #define HAVE_LSTAT 1
    #define HAVE_SYMLINK 1
    #define HAVE_READLINK 1
    #define HAVE_SETITIMER 1
    #define HAVE_SETEUID 1
    #define HAVE_SETREUID 1
    #define HAVE_SETEGID 1
    #define HAVE_SETREGID 1
    #define HAVE_ISSETUGID 1
    #define HAVE_PAUSE 1
    #define HAVE_LCHOWN 1
    #define HAVE_GETPGRP 1
    #define HAVE_SETPGRP 1
    #define HAVE_GETPGID 1
    #define HAVE_SETPGID 1
    #define HAVE_INITGROUPS 1
    #define HAVE_GETGROUPS 1
    #define HAVE_SETGROUPS 1
    #define HAVE_GETPRIORITY 1
    #define HAVE_GETRLIMIT 1
    #define HAVE_DLOPEN 1
    #define HAVE_SIGPROCMASK 1
    #define HAVE_SIGACTION 1
    #define HAVE__SETJMP 1
    #define HAVE_SETSID 1
    #define HAVE_TELLDIR 1
    #define HAVE_SEEKDIR 1
    #define HAVE_FCHMOD 1
    #define HAVE_MKTIME 1
    #define HAVE_COSH 1
    #define HAVE_SINH 1
    #define HAVE_TANH 1
    #define HAVE_SETUID 1
    #define HAVE_SETGID 1
    #define HAVE_TZNAME 1
    #define HAVE_DAYLIGHT 1
    #define NEGATIVE_TIME_T 1
    #define POSIX_SIGNAL 1
    #define GETPGRP_VOID 1
    #define SETPGRP_VOID 1
    #define WORDS_BIGENDIAN 1
    #define RSHIFT(x,y) ((x)>>(int)y)
    #define FILE_COUNT _cnt
    #define FILE_READPTR _ptr
    #define NEED_IO_SEEK_BETWEEN_RW 1
    #define HUGE_ST_INO 1
    #define STACK_GROW_DIRECTION -1
    #define DEFAULT_KCODE KCODE_NONE
    #define USE_ELF 1
    #define DLEXT ".so"
    #define RUBY_LIB "/opt/lib/ruby/1.8"
    #define RUBY_SITE_LIB "/opt/lib/ruby/site_ruby"
    #define RUBY_SITE_LIB2 "/opt/lib/ruby/site_ruby/1.8"
    #define RUBY_PLATFORM "sparc-solaris2.9"
    #define RUBY_ARCHLIB "/opt/lib/ruby/1.8/sparc-solaris2.9"
    #define RUBY_SITE_ARCHLIB "/opt/lib/ruby/site_ruby/1.8/sparc-solaris2.9"

    I tried messing with the LDFLAGS and CFLAGS settings as well but no
    luck. Any ideas?

    Regards,

    Dan
     
    Daniel Berger, Oct 31, 2003
    #1
    1. Advertising

  2. Hi,

    In message "64-bit Ruby on Solaris?"
    on 03/10/31, Daniel Berger <> writes:

    |Solaris 9
    |gcc 3.3.1
    |Ruby 1.8.1 p2
    |Sunblade 100, UltraSparc IIe
    |
    |As usual, I'm playing with things I don't truly understand. Anyway, I
    |thought I'd try building 1.8.1 p2 as 64 bit since I've upgraded my
    |compiler since last time.
    |
    |After running configure, I manually added "-m64 -mcpu=ultrasparc" into
    |the CC line of the Makefile. I seemed to get further this time, and
    |died with a different error:

    Seems like configure failed to detect platform stdio information. I
    hope you (or others) can help me to support newer Solaris.

    matz.
     
    Yukihiro Matsumoto, Oct 31, 2003
    #2
    1. Advertising

  3. ts wrote:
    >
    > >>>>> "D" == Daniel Berger <> writes:

    >
    > Here the reason, why it don't find _cnt and _ptr
    >
    > D> #ifdef _LP64
    > D> #ifndef _FILE64_H
    > D> struct __FILE_TAG {
    > D> long __pad[16];
    > D> };
    > D> #endif /* _FILE64_H */
    >
    > Guy Decoux


    Sorry if the attachment on that last post didn't come through properly -
    ack.

    In any case, I tried setting CFLAGS to '-m64 -mcpu=ultrasparc' (which I
    thought I had done but apparently not) and then re-running configure.
    The good news is that configure seems to work properly, i.e. I got past
    io.c without incident. However, it died when I got here:

    gcc -fPIC -m64 -mcpu=ultrasparc -I. -I/usr/local/src/ruby-1.8.1
    -I/usr/local/src/ruby-1.8.1 -I/usr/local/src/ruby-1.8.1/ext/bigdecimal
    -c bigdecimal.c
    gcc -Wl,-G -L"/usr/local/src/ruby-1.8.1" -L"/opt/lib" -o bigdecimal.so
    bigdecimal.o -ldl -lcrypt -lm -lc
    ld: fatal: file bigdecimal.o: wrong ELF class: ELFCLASS64
    ld: fatal: File processing errors. No output written to bigdecimal.so
    collect2: ld returned 1 exit status
    make[1]: *** [bigdecimal.so] Error 1
    make[1]: Leaving directory `/usr/local/src/ruby-1.8.1/ext/bigdecimal'
    make: *** [all] Error 1

    I tried setting LDFLAGS to '-m64' but that didn't seem to help. Is
    there some other env variable I need to set?

    Regards,

    Dan
     
    Daniel Berger, Oct 31, 2003
    #3
  4. Daniel Berger

    ts Guest

    >>>>> "D" == Daniel Berger <> writes:

    D> ld: fatal: file bigdecimal.o: wrong ELF class: ELFCLASS64

    What say file bigdecimal.o and what loader do you use (/usr/ccs/bin/ld
    or ? )


    Guy Decoux
     
    ts, Nov 1, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,860
    Timothy Bendfelt
    Jan 19, 2007
  2. Replies:
    9
    Views:
    1,056
    Juha Nieminen
    Aug 22, 2007
  3. Berger, Daniel

    64-bit Ruby on Solaris - solved

    Berger, Daniel, Nov 3, 2003, in forum: Ruby
    Replies:
    1
    Views:
    141
    Hugh Sasse Staff Elec Eng
    Nov 3, 2003
  4. Tony Arcieri
    Replies:
    8
    Views:
    243
    nobuyoshi nakada
    Sep 29, 2005
  5. Jeff.M
    Replies:
    6
    Views:
    204
    Lasse Reichstein Nielsen
    May 4, 2009
Loading...

Share This Page