1.8.7-p72 on AIX 5.3 with IBM compiler


#1

$ gtar zxf ruby-1.8.7-p72.tar.gz
$ cd ruby-1.8.7-p72
$ ./configure CC=xlc_r CFLAGS="-g" --enable-shared --enable-pthread
$ gmake

xlc_r -g -DRUBY_EXPORT -I. -I. -c eval.c
“eval.c”, line 12093.12: 1506-343 (S) Redeclaration of thread_init
differs from previous declaration on line 920 of
“/usr/include/sys/thread.h”.
“eval.c”, line 12093.12: 1506-382 (I) The type “int” of identifier
thread_init differs from previous type “void(unsigned long long,unsigned
long long)”.
gmake: *** [eval.o] Error 1
[fixed]

$ gmake

xlc_r -g -DRUBY_EXPORT -I. -I. -c parse.c
“intern.h”, line 28.7: 1506-166 (S) Definition of function rb_ary_new3
requires parentheses.
“intern.h”, line 28.19: 1506-276 (S) Syntax error: possible missing ‘{’?
“node.h”, line 21.5: 1506-045 (S) Undeclared identifier NODE_METHOD.

[fixed]

$ gmake

xlc_r -g -DRUBY_EXPORT -L. -bE:ruby.imp -brtl main.o
libruby-static.a -lpthread -ldl -lcrypt -lm -o miniruby
gmake: *** [.rbconfig.time] IOT/Abort trap (core dumped)

$ dbx miniruby core
(/usr/ccs/bin/dbx) where
_p_raise(??) at 0xd01242a4
raise.raise(??) at 0xd0359c70
abort.abort() at 0xd03b7f78
rb_jump_context(env = 0x2ff20d30, val = 2), line 97 in “eval.c”
rb_iterate(it_proc = 0x2001bd28, data1 = 537241180, bl_proc =
0x2001d5f4, data2 = 804381664), line 5417 in “eval.c”
enum_each_with_index(obj = 537241180), line 1508 in “enum.c”
call_cfunc(func = 0x2001bca4, recv = 537241180, len = 0, argc = 0, argv
= (nil)), line 5752 in “eval.c”
unnamed block in rb_call0(klass = 537274880, recv = 537241180, id =
3929, oid = 3929, argc = 0, argv = (nil), body = 0x200686a8, flags = 0),
line 5904 in “eval.c”
unnamed block in rb_call0(klass = 537274880, recv = 537241180, id =
3929, oid = 3929, argc = 0, argv = (nil), body = 0x200686a8, flags = 0),
line 5904 in “eval.c”
unnamed block in rb_call0(klass = 537274880, recv = 537241180, id =
3929, oid = 3929, argc = 0, argv = (nil), body = 0x200686a8, flags = 0),
line 5904 in “eval.c”
rb_call0(klass = 537274880, recv = 537241180, id = 3929, oid = 3929,
argc = 0, argv = (nil), body = 0x200686a8, flags = 0), line 5904 in
“eval.c”
rb_call(klass = 537274880, recv = 537241180, mid = 3929, argc = 0, argv
= (nil), scope = 0, self = 537300680), line 6151 in “eval.c”
unnamed block in rb_eval(self = 537300680, n = 0x20058870), line 3492 in
“eval.c”
unnamed block in rb_eval(self = 537300680, n = 0x20058870), line 3492 in
“eval.c”
rb_eval(self = 537300680, n = 0x20058870), line 3492 in “eval.c”
unnamed block in rb_eval(self = 537300680, n = 0x20058618), line 3222 in
“eval.c”
unnamed block in rb_eval(self = 537300680, n = 0x20058618), line 3222 in
“eval.c”
unnamed block in rb_eval(self = 537300680, n = 0x20058618), line 3222 in
“eval.c”
rb_eval(self = 537300680, n = 0x20058618), line 3222 in “eval.c”
eval_node(self = 537300680, node = 0x20058618), line 1436 in “eval.c”
unnamed block in rb_load(fname = 537233720, wrap = 0), line 7032 in
“eval.c”
unnamed block in rb_load(fname = 537233720, wrap = 0), line 7032 in
“eval.c”
unnamed block in rb_load(fname = 537233720, wrap = 0), line 7032 in
“eval.c”
unnamed block in rb_load(fname = 537233720, wrap = 0), line 7032 in
“eval.c”
unnamed block in rb_load(fname = 537233720, wrap = 0), line 7032 in
“eval.c”
unnamed block in rb_load(fname = 537233720, wrap = 0), line 7032 in
“eval.c”
unnamed block in rb_load(fname = 537233720, wrap = 0), line 7032 in
“eval.c”
rb_load(fname = 537233720, wrap = 0), line 7032 in “eval.c”
unnamed block in rb_require_safe(fname = 537233880, safe = 0), line 7389
in “eval.c”
unnamed block in rb_require_safe(fname = 537233880, safe = 0), line 7389
in “eval.c”
rb_require_safe(fname = 537233880, safe = 0), line 7389 in “eval.c”
rb_require(fname = “./ext/purelib.rb”), line 7429 in “eval.c”
unnamed block in rb_protect(proc = 0x2001e3bc, data = 537575944, state =
0x2ff22424), line 5526 in “eval.c”
rb_protect(proc = 0x2001e3bc, data = 537575944, state = 0x2ff22424),
line 5526 in “eval.c”
unnamed block in require_libraries(), line 387 in “ruby.c”
require_libraries(), line 387 in “ruby.c”
unnamed block in load_file(fname = “./mkconfig.rb”, script = 1), line
974 in “ruby.c”
load_file(fname = “./mkconfig.rb”, script = 1), line 974 in “ruby.c”
proc_options(argc = 4, argv = 0x2ff229c8), line 853 in “ruby.c”
ruby_process_options(argc = 10, argv = 0x2ff229b0), line 1246 in
“ruby.c”
unnamed block in ruby_options(argc = 10, argv = 0x2ff229b0), line 1532
in “eval.c”
ruby_options(argc = 10, argv = 0x2ff229b0), line 1532 in “eval.c”
unnamed block in main(argc = 10, argv = 0x2ff229b0, envp = 0x2ff229dc),
line 47 in “main.c”
main(argc = 10, argv = 0x2ff229b0, envp = 0x2ff229dc), line 47 in
“main.c”


albert chin (china @at@ thewrittenword .dot. com)

– snip snip
— eval.c.orig 2008-08-04 03:24:26.000000000 +0000
+++ eval.c 2008-10-16 15:52:27.000000000 +0000
@@ -12090,7 +12090,7 @@
return th;
}

-static int thread_init;
+static int rbthread_init;

#if defined(_THREAD_SAFE)
static void
@@ -12164,7 +12164,7 @@
{
struct itimerval tval;

  • if (!thread_init) return;
  • if (!rbthread_init) return;
    tval.it_interval.tv_sec = 0;
    tval.it_interval.tv_usec = 10000;
    tval.it_value = tval.it_interval;
    @@ -12176,7 +12176,7 @@
    {
    struct itimerval tval;
  • if (!thread_init) return;
  • if (!rbthread_init) return;
    tval.it_interval.tv_sec = 0;
    tval.it_interval.tv_usec = 0;
    tval.it_value = tval.it_interval;
    @@ -12203,8 +12203,8 @@
    “can’t start a new thread (frozen ThreadGroup)”);
    }
  • if (!thread_init) {
  • thread_init = 1;
  • if (!rbthread_init) {
  • rbthread_init = 1;
    #if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
    #if defined(POSIX_SIGNAL)
    posix_signal(SIGVTALRM, catch_timer);
    — intern.h.orig 2008-07-07 03:29:28.000000000 +0000
    +++ intern.h 2008-10-16 15:52:33.000000000 +0000
    @@ -25,7 +25,7 @@
    VALUE rb_check_array_type _((VALUE));
    VALUE rb_ary_new _((void));
    VALUE rb_ary_new2 _((long));
    -VALUE rb_ary_new3 __((long,…));
    +VALUE rb_ary_new3 _((long,…));
    VALUE rb_ary_new4 _((long, const VALUE ));
    VALUE rb_ary_freeze _((VALUE));
    VALUE rb_ary_aref _((int, VALUE
    , VALUE));
    @@ -141,11 +141,11 @@
    VALUE rb_exc_new _((VALUE, const char*, long));
    VALUE rb_exc_new2 _((VALUE, const char*));
    VALUE rb_exc_new3 _((VALUE, VALUE));
    -NORETURN(void rb_loaderror __((const char*, …)));
    -NORETURN(void rb_name_error __((ID, const char*, …)));
    +NORETURN(void rb_loaderror _((const char*, …)));
    +NORETURN(void rb_name_error _((ID, const char*, …)));
    NORETURN(void rb_invalid_str _((const char*, const char*)));
    -void rb_compile_error __((const char*, …));
    -void rb_compile_error_append __((const char*, …));
    +void rb_compile_error _((const char*, …));
    +void rb_compile_error_append _((const char*, …));
    NORETURN(void rb_load_fail _((const char*)));
    NORETURN(void rb_error_frozen _((const char*)));
    void rb_check_frozen _((VALUE));
    @@ -236,7 +236,7 @@
    VALUE rb_thread_local_aset _((VALUE, ID, VALUE));
    void rb_thread_atfork _((void));
    VALUE rb_exec_recursive _((VALUE()(VALUE, VALUE, int),VALUE,VALUE));
    -VALUE rb_funcall_rescue __((VALUE, ID, int, …));
    +VALUE rb_funcall_rescue _((VALUE, ID, int, …));
    /
    file.c /
    VALUE rb_file_s_expand_path _((int, VALUE ));
    VALUE rb_file_expand_path _((VALUE, VALUE));
    @@ -249,7 +249,7 @@
    char rb_path_end _((const char ));
    VALUE rb_file_directory_p _((VALUE,VALUE));
    /
    gc.c /
    -NORETURN(void rb_memerror __((void)));
    +NORETURN(void rb_memerror _((void)));
    int ruby_stack_check _((void));
    int ruby_stack_length _((VALUE
    ));
    int rb_during_gc _((void));
    @@ -463,8 +463,8 @@
    void rb_str_setter _((VALUE, ID, VALUE
    ));
    VALUE rb_str_intern _((VALUE));
    /
    struct.c /
    -VALUE rb_struct_new __((VALUE, …));
    -VALUE rb_struct_define __((const char
    , …));
    +VALUE rb_struct_new _((VALUE, …));
    +VALUE rb_struct_define _((const char*, …));
    VALUE rb_struct_alloc _((VALUE, VALUE));
    VALUE rb_struct_aref _((VALUE, VALUE));
    VALUE rb_struct_aset _((VALUE, VALUE, VALUE));