Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.3.1 build issues on freebsd11.0-release #1009

Closed
cod3 opened this issue Oct 17, 2016 · 6 comments
Closed

Ruby 2.3.1 build issues on freebsd11.0-release #1009

cod3 opened this issue Oct 17, 2016 · 6 comments
Assignees

Comments

@cod3
Copy link

cod3 commented Oct 17, 2016

When I upgraded the freebsd to 11 from 10, ruby ​​is no longer able to build.

generating x86_64-freebsd11.0-fake.rb
x86_64-freebsd11.0-fake.rb updated
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems -r./x86_64-freebsd11.0-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags=" " --make-flags=" .MAKE.LEVEL.ENV=MAKELEVEL" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --install=all --rdoc-output=".ext/rdoc"
/tmp/ruby-build.20161017164820.14002/ruby-2.3.1/lib/rubygems/core_ext/kernel_require.rb:55:in `require': /tmp/ruby-build.20161017164820.14002/ruby-2.3.1/.ext/x86_64-freebsd11.0/openssl.so: Undefined symbol "SSLv2_method" - /tmp/ruby-build.20161017164820.14002/ruby-2.3.1/.ext/x86_64-freebsd11.0/openssl.so (LoadError)

$uname -a
FreeBSD localhost 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 01:43:23 UTC 2016 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64

@hsbt hsbt self-assigned this Oct 17, 2016
@hsbt
Copy link
Member

hsbt commented Oct 17, 2016

It caused SSLv2_method was removed at FreeBSD 11.

I'm going to investigate this on ruby core repository.

@hsbt
Copy link
Member

hsbt commented Oct 18, 2016

addressed https://bugs.ruby-lang.org/issues/12849

@rhenium
Copy link

rhenium commented Oct 18, 2016

I have no idea why it occurs as it must not happen (see https://bugs.ruby-lang.org/issues/4556).

Could you show me mkmf.log and extconf.h generated by the compile time? They should be in /tmp/ruby-build.20161017164820.14002/ruby-2.3.1/ext/openssl.

@cod3
Copy link
Author

cod3 commented Oct 18, 2016

I have uploaded this file
/tmp/ruby-build.20161017164820.14002/ruby-2.3.1/ext/openssl/mkmf.log

https://raw.githubusercontent.com/cod3/test/master/mkmf.log

@rhenium
Copy link

rhenium commented Oct 19, 2016

Thank you. I could reproduce on my FreeBSD 11.0-RELEASE-p1 with pkgconf and openssl installed using pkg(8).

It looks like the configuration and compilation is done against the libssl installed by the openssl package (that is, /usr/local/lib/libssl.so.8) which indeed has SSLv2_*method, but at runtime, it is incorrectly linked against the libssl of the base system (/usr/lib/libssl.so.8) which does not enable SSLv2 ssl methods.

mkmf uses pkg-config if available which returns the path for that installed by the package. But in FreeBSD, /lib and /usr/lib seem to appear earlier in the library search path. This resulted in the incorrect linking.

If I force rpath by adding --with-openssl-dir=/usr/local (or --with-opt-dir) to the configure options, everything seems to work as expected.

@cod3
Copy link
Author

cod3 commented Oct 19, 2016

First, I set configure options below, but ruby can not build. Because of any other extentions.
$ export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local"

So , I set configure options below, ruby is able to build. Thank you.

$ export RUBY_CONFIGURE_OPTS="--with-opt-dir=/usr/local"
$ rbenv install 2.3.1
Downloading ruby-2.3.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
Installing ruby-2.3.1...
Installed ruby-2.3.1 to /home/username/.rbenv/versions/2.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants