In attempting to build a completely static ruby, I've discovered a few issues. The setup.. =========== I've built static versions of readline, zlib, iconv, dbm, and openssl. My intention is to build a completely static ruby, including all possible extensions. Issue #1 ======== Problem ------- If you build openssl with zlib support, then Ruby's ext/openssl extension will not build. This is because the extconf.rb needs to include "-lz". Note, if your libssl.a is build *without* zlib, Ruby does attempt to build ext/openssl. This only happens when you build libssl.a *with* zlib support. Resolution ---------- In the openssl extension, I suggest adding a test to see if "-lz" (zlib) exists. If it does, then include "-lz" on all of the subsequent openssl specific tests. I don't exactly know how to do this due to unfamiliarity with Ruby's extension build system. Issue #2 ======== Problem ------- When using a static openssl library (libssl.a), and all static extensions (--with-static-linked-ext), the openssl digest functions (SHA) conflict with the same named symbols in ext/digest. I imagine this works fine under the *non-static* case because the symbols are resolved at runtime; however, in the *static* case, the symbols must be unique at link time -- and they are not. Resolution ---------- I don't know about this one either - because Ruby's build system is already somewhat of a magical mystery to me. However, it seems that we need a mechanism to automagically choose which lib to link. In the case of a static libssl.a, the ext/digest functions should be considered "weak". Closing Notes ============= If *anyone* knows *anything* about this, or has had similar experience, please let me know. Furthermore, if there's a more appropriate place to send this kind of thing than ruby-talk, let me know that too. Thanks, Steve
on 2006-03-21 20:04
on 2006-03-22 08:03
Hi, At Wed, 22 Mar 2006 04:04:12 +0900, Stephen Waits wrote in [ruby-talk:185160]: > I've built static versions of readline, zlib, iconv, dbm, and openssl. > My intention is to build a completely static ruby, including all > possible extensions. Can you show the mkmf.log. It is important for build issues.
on 2006-03-22 20:16
WARNING: This e-mail has been altered by MIMEDefang. Following this paragraph are indications of the actual changes made. For more information about your site's MIMEDefang policy, contact SCEA PD Postmaster <email@example.com>. For more information about MIMEDefang, see: http://www.roaringpenguin.com/mimedefang/enduser.php3 An attachment named go.sh was removed from this document as it constituted a security hazard. If you require this document, please contact the sender and arrange an alternate means of receiving it.
on 2006-03-23 07:15
On Mar 21, 2006, at 2:04 PM, Stephen Waits wrote: > Issue #1 > Resolution > Problem > I don't know about this one either - because Ruby's build system is > appropriate place to send this kind of thing than ruby-talk, let me > know that too. > > > Thanks, > Steve > > Have you looked at AllInOneRuby? It may have solved some of your problems already. Technically its _not_ a static build of ruby though. http://www.erikveen.dds.nl/allinoneruby/index.html
on 2006-03-23 16:13
On Mar 22, 2006, at 10:15 PM, Logan Capaldo wrote: > Have you looked at AllInOneRuby? It may have solved some of your > problems already. Technically its _not_ a static build of ruby though. Thanks for the reply; however, I need an entirely static Ruby. --Steve