# Two build issues with 1.8.4

**URL:** <https://www.ruby-forum.com/t/two-build-issues-with-1-8-4/55519>\
**Category:** Ruby\
**Created:** [March 21, 2006, 8:04pm UTC](https://www.ruby-forum.com/t/two-build-issues-with-1-8-4/55519 "2006-03-21T20:04:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgware](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sgware](https://www.ruby-forum.com/u/sgware)\
**Post date:** [March 21, 2006, 8:04pm UTC](https://www.ruby-forum.com/t/two-build-issues-with-1-8-4/55519/1 "2006-03-21T20:04:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sgware](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sgware](https://www.ruby-forum.com/u/sgware)\
**Post date:** [March 22, 2006, 8:03am UTC](https://www.ruby-forum.com/t/two-build-issues-with-1-8-4/55519/2 "2006-03-22T08:03:21Z")

</div>

Hi,

At Wed, 22 Mar 2006 04:04:12 +0900,  
Stephen W. 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.

---

<div class="post-metadata">

**Author:** ![sgware](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sgware](https://www.ruby-forum.com/u/sgware)\
**Post date:** [March 22, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/two-build-issues-with-1-8-4/55519/3 "2006-03-22T20:16:09Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid). 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.

---

<div class="post-metadata">

**Author:** ![sgware](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sgware](https://www.ruby-forum.com/u/sgware)\
**Post date:** [March 23, 2006, 4:13pm UTC](https://www.ruby-forum.com/t/two-build-issues-with-1-8-4/55519/4 "2006-03-23T16:13:14Z")

</div>

On Mar 22, 2006, at 10:15 PM, Logan C. 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

---

<div class="post-metadata">

**Author:** ![sgware](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sgware](https://www.ruby-forum.com/u/sgware)\
**Post date:** [March 23, 2006, 7:15am UTC](https://www.ruby-forum.com/t/two-build-issues-with-1-8-4/55519/5 "2006-03-23T07:15:05Z")

</div>

On Mar 21, 2006, at 2:04 PM, Stephen W. 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](http://www.erikveen.dds.nl/allinoneruby/index.html)
