From: Eric Wong Date: 2014-03-01T02:26:02+00:00 Subject: [ruby-core:61158] RFC: some --with-static-linked-ext fixes (going on a tangent from https://bugs.ruby-lang.org/issues/9579) git://80x24.org/ruby.git static-ext http://bogomips.org/ruby.git/patch?id=a1c2758e2f742 * ext/extmk.rb: requires the .rb if the .rb and .so have the same prefix (e.g. socket.rb vs socket.so). Use rb_provide(feature) if feature.so is loaded and feature.rb does not exist * ext/openssl/extconf.rb: preload stringio.so * ext/psych/extconf.rb: preload stringio.so * load.c (ruby_init_ext): check rb_provided and use rb_provide Note: tests remain broken because mathn/complex and mathn/rational are loaded by default. I don't know what to do about this, define a new, special API for hooking `require' on static-linked-ext? Or define an internal (but accessible via Ruby) methods to call nurat_canonicalization and nucomp_canonicalization so there's no .so even in the dynamic case? Part of me wants to avoid adding more .so for Init_ things like this anyways (e.g. require "fiber").