Hi,

At Wed, 21 Jul 2010 20:16:58 +0900,
Luis Lavena wrote in [ruby-core:31401]:
> The problem seems to be cross compilation, where the def file is not
> created and the shared libraries generated do not export the needed
> symbols.

How do you cross-compile extension libraries?


$ cd ~/tmp/testext

$ cat extconf.rb
create_makefile("testext")

$ cat testext.c 
#include <ruby.h>
void Init_testext(void)
{
    rb_p(ID2SYM(rb_intern("ok")));
}

$ ruby -r ~/src/ruby/trunk/i386-mingw32/i386-mingw32-fake.rb -rmkmf extconf.rb 
creating Makefile

$ make
ruby -e "puts 'EXPORTS', 'Init_testext'"  > testext-i386-mingw32.def
i386-mingw32-gcc -I. -I/Users/nobu/src/ruby/trunk/ext/include/i386-mingw32 -I/Users/nobu/src/ruby/trunk/src/include/ruby/backward -I/Users/nobu/src/ruby/trunk/src/include -I.   -O3 -g0 -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings  -o testext.o -c testext.c
i386-mingw32-gcc -shared -s -o testext.so testext.o -L. -L/Users/nobu/src/ruby/trunk/i386-mingw32 -L.  -Wl,--enable-auto-image-base,--enable-auto-import testext-i386-mingw32.def  -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp

> This happened with nokogiri (which is cross-compiled for 1.8 and 1.9 versions)

Nokogiri is bad for cross-compile example.  It's quite tricky.

-- 
Nobu Nakada