Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 304427 - dev-lang/ruby fails to compile with openssl 1.0.0
Summary: dev-lang/ruby fails to compile with openssl 1.0.0
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Ruby Team
URL: http://redmine.ruby-lang.org/issues/s...
Whiteboard:
Keywords:
Depends on:
Blocks: openssl-1
  Show dependency tree
 
Reported: 2010-02-10 22:24 UTC by Hanno Böck
Modified: 2010-07-21 17:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for ruby-1.8 from 1.8 branch (ruby-1.8.7-openssl1.patch,5.50 KB, patch)
2010-05-10 22:59 UTC, Maciej Mrozowski
Details | Diff
missing bits for openssl 1.0.0 compatibility (ruby-openssl.diff,5.11 KB, patch)
2010-06-17 23:22 UTC, Hanno Böck
Details | Diff
ruby-1.9.1_p376-openssl1.patch (ruby-1.9.1_p376-openssl1.patch,8.99 KB, patch)
2010-06-18 07:22 UTC, Lars Wendler (Polynomial-C)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Böck gentoo-dev 2010-02-10 22:24:37 UTC
All ruby versions currently don't compile with openssl 1.0.0. Upstream bugtracker has patches (see URL).
Comment 1 Alex Legler (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2010-02-11 12:50:16 UTC
I will consider the patches for inclusion once they are actually in the ruby trunk.
Comment 2 Daniel Black (RETIRED) gentoo-dev 2010-04-05 10:50:20 UTC
upstream has merged patches: http://redmine.ruby-lang.org/issues/show/2022#note-15
Comment 3 Maciej Mrozowski gentoo-dev 2010-05-09 21:53:54 UTC
Any progress on this bug? Thanks in advance.
Comment 4 Maciej Mrozowski gentoo-dev 2010-05-10 22:59:07 UTC
Created attachment 231019 [details, diff]
Patch for ruby-1.8 from 1.8 branch
Comment 5 Maciej Mrozowski gentoo-dev 2010-05-10 23:14:51 UTC
1.8.7 patch doesn't work with 1.9.1 ebuild although it applies cleanly.
Strangely enough, openssl-1.0.0 patch from ruby 1.9.2 branch does not apply to 1.9.1 at all - they must have refactored the code a bit deeper in the process.
Someone more oriented would need to take a look or just wait for 1.9.2 to be released.
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-05-18 23:10:18 UTC
Fixed for 1.8… but 1.9 is likely to have similar trouble, I guess?
Comment 7 Hanno Böck gentoo-dev 2010-05-19 17:29:31 UTC
It seems the fix is incomplete:

x86_64-pc-linux-gnu-gcc -shared -o ../../.ext/x86_64-linux/openssl.so ossl_ocsp.o ossl_cipher.o openssl_missing.o ossl_x509req.o ossl_pkey.o ossl_engine.o ossl_x509ext.o ossl_pkcs12.o ossl_x509attr.o ossl_config.o ossl_ssl_session.o ossl_pkey_dh.o ossl_x509name.o ossl_pkey_ec.o ossl_x509crl.o ossl_x509cert.o ossl_bn.o ossl_ns_spki.o ossl_pkcs7.o ossl_x509store.o ossl_hmac.o ossl_bio.o ossl_asn1.o ossl_digest.o ossl_pkey_dsa.o ossl_ssl.o ossl_x509.o ossl_pkey_rsa.o ossl_pkcs5.o ossl.o ossl_x509revoked.o ossl_rand.o -L. -L../.. -L. -Wl,-O1,--as-needed,--sort-common,--hash-style=gnu -rdynamic -Wl,-export-dynamic -Wl,--no-undefined    -Wl,-R -Wl,/usr/lib64 -L/usr/lib64 -lruby18 -lssl -lcrypto  -lrt -ldl -lcrypt -lm   -lc
cp ../.././ext/openssl/lib/openssl/cipher.rb ../../.ext/common/openssl
cp ../.././ext/openssl/lib/openssl/x509.rb ../../.ext/common/openssl
cp ../.././ext/openssl/lib/openssl/digest.rb ../../.ext/common/openssl
cp ../.././ext/openssl/lib/openssl/buffering.rb ../../.ext/common/openssl
cp ../.././ext/openssl/lib/openssl/ssl.rb ../../.ext/common/openssl
cp ../.././ext/openssl/lib/openssl/pkcs7.rb ../../.ext/common/openssl
cp ../.././ext/openssl/lib/openssl/bn.rb ../../.ext/common/openssl
cp ../.././ext/openssl/lib/net/ftptls.rb ../../.ext/common/net
cp ../.././ext/openssl/lib/net/telnets.rb ../../.ext/common/net
ossl_config.o: In function `each_conf_value_LHASH_DOALL_ARG':
ossl_config.c:(.text+0x53): undefined reference to `each_conf_value_doall_arg'
ossl_config.o: In function `dump_conf_value_LHASH_DOALL_ARG':
ossl_config.c:(.text+0xd3): undefined reference to `dump_conf_value_doall_arg'
ossl_config.o: In function `get_conf_section_LHASH_DOALL_ARG':
ossl_config.c:(.text+0x1f3): undefined reference to `get_conf_section_doall_arg'
ossl_ssl_session.o: In function `ossl_ssl_session_eq':
ossl_ssl_session.c:(.text+0x560): undefined reference to `SSL_SESSION_cmp'
Comment 8 Maciej Mrozowski gentoo-dev 2010-06-11 04:42:43 UTC
Fix worked fine when I applied it locally to previous ebuild version (with epatch directives in src_prepare). Then patches were reintegrated into tarball and it fails since then. Maybe something broke in the process (like 1.9 patches mixed with 1.8 ones that would make my patch not applicable anymore).
I know there are people who like to think I post untested stuff however.
Comment 9 Hanno Böck gentoo-dev 2010-06-17 23:22:45 UTC
Created attachment 235805 [details, diff]
missing bits for openssl 1.0.0 compatibility

I've attached a patch containing the missing bits for openssl 1.0 support.

Part one is from netbsd (1.8 svn is too different to take it from there):
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/39053

Part two is from upstream svn:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/openssl/ossl_ssl_session.c?r1=26850&r2=26861
Comment 10 Lars Wendler (Polynomial-C) gentoo-dev 2010-06-18 07:22:06 UTC
Created attachment 235815 [details, diff]
ruby-1.9.1_p376-openssl1.patch

That's the patch I am using for a while now. Don't know if it's better than Hanno's patch but now you ruby guys have the pain of choice ;)
Comment 11 Hanno Böck gentoo-dev 2010-06-30 23:29:55 UTC
1.8.7_p299, which has been added to the tree recently, works fine with openssl 1.0.0a.
Comment 12 Samuli Suominen gentoo-dev 2010-07-14 08:06:01 UTC
http://repos.archlinux.org/wsvn/packages/ruby/trunk/openssl-1.0.patch

^ This is the patch Arch Linux is applying on top of 1.9.1_p429, same as we have now. 

Can we get this applied, please?
Comment 13 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-07-14 13:01:46 UTC
I'm testing an update to 1.9.2_rc2 that should work out of the box.
Comment 14 Samuli Suominen gentoo-dev 2010-07-15 13:57:30 UTC
(In reply to comment #13)
> I'm testing an update to 1.9.2_rc2 that should work out of the box.
> 

Confirmed. Works with OpenSSL 1.x, fails with DB 5.0... sigh
Comment 15 Vasilis Lourdas 2010-07-21 15:56:11 UTC
ruby-1.8.7_p249 build fails here with openssl-1.0.0a:

ossl_ocsp.c: In function ‘ossl_ocspreq_initialize’:
ossl_ocsp.c:114: warning: passing argument 2 of ‘d2i_OCSP_REQUEST’ from incompatible pointer type
/usr/include/openssl/ocsp.h:543: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
ossl_ocsp.c: In function ‘ossl_ocspres_initialize’:
ossl_ocsp.c:321: warning: passing argument 2 of ‘d2i_OCSP_RESPONSE’ from incompatible pointer type
/usr/include/openssl/ocsp.h:539: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -march=core2 -O2 -pipe -msse4.1 -fno-strict-aliasing  -fPIC   -c ossl_x509ext.c
x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -march=core2 -O2 -pipe -msse4.1 -fno-strict-aliasing  -fPIC   -c ossl_x509crl.c
x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -march=core2 -O2 -pipe -msse4.1 -fno-strict-aliasing  -fPIC   -c ossl_hmac.c
ossl_x509crl.c: In function ‘ossl_x509crl_get_revoked’:
ossl_x509crl.c:265: warning: pointer type mismatch in conditional expression
ossl_x509crl.c:273: warning: pointer type mismatch in conditional expression
x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -march=core2 -O2 -pipe -msse4.1 -fno-strict-aliasing  -fPIC   -c ossl.c
ossl_x509ext.c: In function ‘ossl_x509ext_initialize’:
ossl_x509ext.c:285: warning: passing argument 2 of ‘d2i_X509_EXTENSION’ from incompatible pointer type
/usr/include/openssl/x509.h:822: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -march=core2 -O2 -pipe -msse4.1 -fno-strict-aliasing  -fPIC   -c ossl_ssl.c
x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -march=core2 -O2 -pipe -msse4.1 -fno-strict-aliasing  -fPIC   -c ossl_bio.c
x86_64-pc-linux-gnu-gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -march=core2 -O2 -pipe -msse4.1 -fno-strict-aliasing  -fPIC   -c ossl_asn1.c
ossl.c:118: error: expected ‘)’ before ‘*’ token
ossl.c:119: error: expected ‘)’ before ‘*’ token
make[1]: *** [ossl.o] Error 1
make[1]: *** Waiting for unfinished jobs....
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
ossl_asn1.c: In function ‘decode_bool’:
ossl_asn1.c:313: warning: passing argument 2 of ‘d2i_ASN1_BOOLEAN’ from incompatible pointer type
/usr/include/openssl/asn1.h:830: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
ossl_asn1.c: In function ‘decode_int’:
ossl_asn1.c:328: warning: passing argument 2 of ‘d2i_ASN1_INTEGER’ from incompatible pointer type
/usr/include/openssl/asn1.h:832: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
ossl_asn1.c: In function ‘decode_bstr’:
ossl_asn1.c:347: warning: passing argument 2 of ‘d2i_ASN1_BIT_STRING’ from incompatible pointer type
/usr/include/openssl/asn1.h:810: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
ossl_asn1.c: In function ‘decode_enum’:
ossl_asn1.c:373: warning: passing argument 2 of ‘d2i_ASN1_ENUMERATED’ from incompatible pointer type
/usr/include/openssl/asn1.h:841: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
ossl_asn1.c: In function ‘decode_null’:
ossl_asn1.c:390: warning: passing argument 2 of ‘d2i_ASN1_NULL’ from incompatible pointer type
/usr/include/openssl/asn1.h:867: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
ossl_asn1.c: In function ‘decode_obj’:
ossl_asn1.c:407: warning: passing argument 2 of ‘d2i_ASN1_OBJECT’ from incompatible pointer type
/usr/include/openssl/asn1.h:787: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
ossl_asn1.c: In function ‘decode_time’:
ossl_asn1.c:435: warning: passing argument 2 of ‘d2i_ASN1_TIME’ from incompatible pointer type
/usr/include/openssl/asn1.h:883: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
ossl_asn1.c: In function ‘ossl_asn1_get_asn1type’:
ossl_asn1.c:503: warning: cast to pointer from integer of different size
ossl_asn1.c: In function ‘ossl_asn1_decode0’:
ossl_asn1.c:727: warning: passing argument 1 of ‘ASN1_get_object’ from incompatible pointer type
/usr/include/openssl/asn1.h:945: note: expected ‘const unsigned char **’ but argument is of type ‘unsigned char **’
make[1]: Leaving directory `/var/tmp/portage/dev-lang/ruby-1.8.7_p249/work/ruby-1.8.7-p249/ext/openssl'
make: *** [all] Error 1
 * ERROR: dev-lang/ruby-1.8.7_p249 failed:
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line  54:  Called src_compile
 *   environment, line 3529:  Called die
 * The specific snippet of code:
 *       emake EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
 * 
 * If you need support, post the output of 'emerge --info =dev-lang/ruby-1.8.7_p249',
 * the complete build log and the output of 'emerge -pqv =dev-lang/ruby-1.8.7_p249'.
 * The complete build log is located at '/var/tmp/portage/dev-lang/ruby-1.8.7_p249/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/ruby-1.8.7_p249/temp/environment'.
 * S: '/var/tmp/portage/dev-lang/ruby-1.8.7_p249/work/ruby-1.8.7-p249'

>>> Failed to emerge dev-lang/ruby-1.8.7_p249, Log file:

>>>  '/var/tmp/portage/dev-lang/ruby-1.8.7_p249/temp/build.log'
Comment 16 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-07-21 17:48:50 UTC
(In reply to comment #11)
> 1.8.7_p299, which has been added to the tree recently, works fine with openssl
> 1.0.0a.

Which should be read as "anything lower than that won't work".