Bug #6379

inconsistent configuration of core extensions linking against libssl and libcrypto (ext/openssl, ext/digest/*)

Added by drkaes (Stefan Kaes) over 8 years ago. Updated over 8 years ago.

Target version:
ruby -v:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10.8.0]


ext/openssl/extconf.rb was change some time ago to prefer compile settings via a pkconfig("openssl") directive.


However, ext/digest/{md5,rmd160,sha1,sha2}/extconf.rb have not been changed.

This can result in multiple versions of libcrypto and libssl being linked into ruby, which in turn can lead to strange behavior/crashes.

For example, on OS X, with macports installed and its pkg-config binary in the search path, you will get the following list of libraries:

/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 152.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.44.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.7)
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.7)
/opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libffi.5.dylib (compatibility version 6.0.0, current version 6.10.0)
/opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/usr/lib/libutil.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/local/lib/libreadline.6.2.dylib (compatibility version 6.0.0, current version 6.2.0)
/usr/local/lib/libyaml-0.2.dylib (compatibility version 3.0.0, current version 3.2.0)

This happens with a plain ./configure (no arguments given).

If instead you pass --with-opt-dir=/opt/local to ./configure, you get a consistent set of libraries.

I think this is problematic, because it means rvm and ruby-build are broken out of the box for users of MacPorts.

There are two ways to fix this:

1) revert the commit, as it it seems to cause more problems than it fixes
2) add corresponding pkgconfig directives to all the mentioned extconf.rb files

I'm for reverting the patch.

What do you think?


I used
find . -name '*.bundle' -exec otool -L {} \; | sort | uniq | grep -v ':'
to create the list.

Also available in: Atom PDF