=begin
I ported ruby-1.9.1-p0 to Android. It built fine with a few patches and a custom Android.mk with a target of "miniruby."
The executable crashed at an early stage. I succeeded in tracing the crash to a null pointer reference to ruby_current_thread in SET_STACK_END (through GET_THREAD()) called in ruby_get_stack_grow_direction() called in STACK_UPPER() called in ruby_init_stack() called in Init_stack().
Reversing the calling order of Init_BareVM() and Init_stack in eval.c:ruby_init() seems to fix the problem.
At Wed, 25 Feb 2009 09:37:32 +0900,
hiro sugawara wrote in [ruby-core:22439]:
The executable crashed at an early stage. I succeeded in
tracing the crash to a null pointer reference to
ruby_current_thread in SET_STACK_END (through GET_THREAD())
called in ruby_get_stack_grow_direction() called in
STACK_UPPER() called in ruby_init_stack() called in
Init_stack().
Isn't the stack direction on Android defined statically?
Reversing the calling order of Init_BareVM() and Init_stack
in eval.c:ruby_init() seems to fix the problem.