Fails to compile openssl extension for ruby-187 latest…
I’m also having this problem. I’m trying to use gcc 4.2.2 to compile
Ruby
1.8.7-p174 on Fedora 12 Linux which includes OpenSSL 1.0.0 beta4. Here
is the
ouput of my attempt:
./configure && make
[snip]
compiling openssl
make[1]: Entering directory /usr/local/src/ruby/ruby-1.8.7-p174/ext/ openssl' gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H= \"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c ossl_pkey_rsa.c gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H= \"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c ossl_bio.c gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H= \"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c ossl_ns_spki.c ossl_ns_spki.c: In function ‘ossl_spki_initialize’: ossl_ns_spki.c:67: warning: passing argument 2 of ‘d2i_NETSCAPE_SPKI’ from incompatible pointer type /usr/include/openssl/x509.h:843: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’ gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H= \"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c ossl_x509req.c gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H= \"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c ossl_ssl.c ossl_ssl.c:101: warning: initialization from incompatible pointer type ossl_ssl.c:102: warning: initialization from incompatible pointer type ossl_ssl.c:103: warning: initialization from incompatible pointer type ossl_ssl.c:104: warning: initialization from incompatible pointer type ossl_ssl.c:105: warning: initialization from incompatible pointer type ossl_ssl.c:106: warning: initialization from incompatible pointer type ossl_ssl.c:107: warning: initialization from incompatible pointer type ossl_ssl.c:108: warning: initialization from incompatible pointer type ossl_ssl.c:109: warning: initialization from incompatible pointer type ossl_ssl.c:110: warning: initialization from incompatible pointer type ossl_ssl.c:111: warning: initialization from incompatible pointer type ossl_ssl.c:112: warning: initialization from incompatible pointer type ossl_ssl.c: In function ‘ossl_sslctx_get_ciphers’: ossl_ssl.c:626: error: ‘STACK’ undeclared (first use in this function) ossl_ssl.c:626: error: (Each undeclared identifier is reported only once ossl_ssl.c:626: error: for each function it appears in.) ossl_ssl.c:626: error: expected expression before ‘)’ token ossl_ssl.c:629: error: expected expression before ‘)’ token ossl_ssl.c:629: error: too few arguments to function ‘sk_value’ ossl_ssl.c: In function ‘ossl_ssl_get_peer_cert_chain’: ossl_ssl.c:1199: warning: passing argument 1 of ‘sk_num’ from incompatible pointer type /usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’ but argument is of type ‘struct stack_st_X509 *’ ossl_ssl.c:1202: warning: passing argument 1 of ‘sk_value’ from incompatible pointer type /usr/include/openssl/stack.h:80: note: expected ‘const struct _STACK *’ but argument is of type ‘struct stack_st_X509 *’ ossl_ssl.c: In function ‘ossl_ssl_get_cipher’: ossl_ssl.c:1224: warning: assignment discards qualifiers from pointer target type make[1]: *** [ossl_ssl.o] Error 1 make[1]: Leaving directory /usr/local/src/ruby/ruby-1.8.7-p174/ext/
openssl’
make: *** [all] Error 1
…
ossl_ssl.c: In function ‘ossl_sslctx_get_ciphers’:
ossl_ssl.c:626: error: ‘STACK’ undeclared (first use in this function)
…
I should note that I’ve attempted to replace “STACK” with “_STACK” (a
quick
hackish attempt at making this work after looking at some OpenSSL
headers),
but that just resulted in different errors.