Project

General

Profile

Bug #10099

Compiling Ruby 2.1.2 with OpenSSL "recipe for target 'openssl_missing.o' failed"

Added by yb601 (Iain Barnett) about 5 years ago. Updated about 5 years ago.

Status:
Rejected
Priority:
Normal
Target version:
-
ruby -v:
2.1.2
[ruby-core:64119]

Description

Hi,

I compile Ruby 2.1.2 from source but "get recipe for target 'openssl_missing.o' failed". I don't understand why it's using openssl_missing as my copy of OpenSSL works and is passed to configure. Any help with this would be much appreciated. More info below.

Ruby downloaded from http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz

Configure line: (I've got things in non standard places, but that's why I'm passing them as options in variables)

../ruby-2.1.2/configure --prefix=$MY_RUBY_INSTALL_DIR --with-openssl-dir=$MY_OPENSSL --with-gcc=$(which gcc) --with-readline-dir=$MY_READLINE

I added in the Readline option after reading somewhere that it helped, but it didn't, so you can probably ignore it.

The error that comes up on make:

make[2]: Entering directory '/Users/iainuser/Downloads/build-ruby/ext/openssl'
compiling ../../../ruby-2.1.2/ext/openssl/openssl_missing.c
In file included from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:22:0:
../../../ruby-2.1.2/ext/openssl/openssl_missing.h:71:6: error: conflicting types for ‘HMAC_CTX_copy’
 void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
      ^
In file included from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:20:0:
/Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/hmac.h:102:5: note: previous declaration of ‘HMAC_CTX_copy’ was here
 int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
     ^
In file included from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:22:0:
../../../ruby-2.1.2/ext/openssl/openssl_missing.h:95:5: error: conflicting types for ‘EVP_CIPHER_CTX_copy’
 int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
     ^
In file included from /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/x509.h:73:0,
                 from /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/engine.h:98,
                 from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:14:
/Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/evp.h:502:5: note: previous declaration of ‘EVP_CIPHER_CTX_copy’ was here
 int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
     ^
../../../ruby-2.1.2/ext/openssl/openssl_missing.c:26:1: error: conflicting types for ‘HMAC_CTX_copy’
 HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
 ^
In file included from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:20:0:
/Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/hmac.h:102:5: note: previous declaration of ‘HMAC_CTX_copy’ was here
 int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
     ^
../../../ruby-2.1.2/ext/openssl/openssl_missing.c:121:1: error: conflicting types for ‘EVP_CIPHER_CTX_copy’
 EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in)
 ^
In file included from /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/x509.h:73:0,
                 from /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/engine.h:98,
                 from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:14:
/Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/evp.h:502:5: note: previous declaration of ‘EVP_CIPHER_CTX_copy’ was here
 int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
     ^
Makefile:280: recipe for target 'openssl_missing.o' failed
make[2]: *** [openssl_missing.o] Error 1
make[2]: Leaving directory '/Users/iainuser/Downloads/build-ruby/ext/openssl'
exts.mk:186: recipe for target 'ext/openssl/all' failed
make[1]: *** [ext/openssl/all] Error 2
make[1]: Leaving directory '/Users/iainuser/Downloads/build-ruby'
uncommon.mk:180: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2

My version of OpenSSL:

$ openssl version
OpenSSL 1.0.1g 7 Apr 2014

GCC:

$ gcc --version
gcc (GCC) 4.9.0

System:

It's an OSX 10.6.8 system. (Yes, that's old, don't hold it against me! :)

$ uname -a
Darwin iainb-2.lan 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

If you need any other info or need me to try anything, just let me know.

Regards,
Iain

History

Updated by naruse (Yui NARUSE) about 5 years ago

  • Status changed from Open to Rejected

Use homebrew's openssl instead of OpenSSL.framework.

Updated by yb601 (Iain Barnett) about 5 years ago

Yui NARUSE wrote:

Use homebrew's openssl instead of OpenSSL.framework.

I don't use homebrew as it removes anything that wasn't using its own recipes, which doesn't suit my needs here. Add to that, it seems it's a problem elsewhere too http://code.activestate.com/lists/ruby-talk/47204/

I'd either like this reopened or given a different reason to close, reliance on a 3rd party package manager isn't an adequate reason to me.

Regards,
Iain

Also available in: Atom PDF