From: Luis Lavena Date: 2010-07-22T05:44:32+09:00 Subject: [ruby-core:31424] Re: --export-all revisited On Wed, Jul 21, 2010 at 3:44 PM, Nobuyoshi Nakada wrote: > 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? > Ruby installed using rake-compiler: # using 1.9.2-rc2 gem install rake-compiler rake-compiler cross-ruby VERSION=1.9.2-rc2 [ruby-1.9.2-rc2] luis@ubuntu86:~/testext$ ruby -I/home/luis/.rake-compiler/builds/ruby-1.9.2-rc2 -ri386-mingw32-fake.rb -rmkmf extconf.rb creating Makefile [ruby-1.9.2-rc2] luis@ubuntu86:~/testext$ make ruby -e "puts 'EXPORTS', 'Init_testext'" > testext-i386-mingw32.def i586-mingw32msvc-gcc -I. -I/home/luis/.rake-compiler/builds/ruby-1.9.2-rc2/.ext/include/i386-mingw32 -I/home/luis/.rake-compiler/sources/ruby-1.9.2-rc2/include/ruby/backward -I/home/luis/.rake-compiler/sources/ruby-1.9.2-rc2/include -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o testext.o -c testext.c i586-mingw32msvc-gcc -shared -s -o testext.so testext.o -L. -L/home/luis/.rake-compiler/builds/ruby-1.9.2-rc2 -L. -Wl,--enable-auto-image-base,--enable-auto-import testext-i386-mingw32.def -lmsvcrt-ruby191 -lshell32 -lws2_32 Seems it generates the export file... $ cat testext-i386-mingw32.def EXPORTS Init_testext OT: since which version "#{RUBY_PLATFORM}-fake.rb" is generated? I remember only "fake" was generated before, I will need to adjust rake-compiler to properly copy it after installation, as right now is faking it: http://github.com/luislavena/rake-compiler/blob/master/lib/rake/extensiontask.rb#L364-373 > > Nokogiri is bad for cross-compile example. �It's quite tricky. > Indeed, but the normal usage cases for cross-compilation are gem developers wanting to provide native gems for projects like nokogiri, sqlite3-ruby, DataMapper, etc. Thank you for your time. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup�ry