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

Can't install on Ubuntu 15.10 — recipe for target 'ossl_ssl.o' failed #3548

Closed
faelsoto opened this issue Nov 9, 2015 · 29 comments
Closed

Comments

@faelsoto
Copy link

faelsoto commented Nov 9, 2015

Hello, I'm trying to install rvm in a brand new Ubuntu installation, but I keep getting this error:

ossl_ssl.c:132:27: error: ‘SSLv3_method’ undeclared here (not in a function)
     OSSL_SSL_METHOD_ENTRY(SSLv3),
                           ^
ossl_ssl.c:110:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
 #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
                                                                     ^
ossl_ssl.c:133:27: error: ‘SSLv3_server_method’ undeclared here (not in a function)
     OSSL_SSL_METHOD_ENTRY(SSLv3_server),
                           ^
ossl_ssl.c:110:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
 #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
                                                                     ^
ossl_ssl.c:134:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)
     OSSL_SSL_METHOD_ENTRY(SSLv3_client),
                           ^
ossl_ssl.c:110:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
 #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
                                                                     ^
Makefile:278: recipe for target 'ossl_ssl.o' failed
make[2]: *** [ossl_ssl.o] Error 1
make[2]: Leaving directory '/home/rafael/.rvm/src/ruby-2.0.0-p247/ext/openssl'
exts.mk:170: recipe for target 'ext/openssl/all' failed
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
installing default callback libraries
linking shared-object dl/callback.so
make[2]: Leaving directory '/home/rafael/.rvm/src/ruby-2.0.0-p247/ext/dl/callback'
make[1]: Leaving directory '/home/rafael/.rvm/src/ruby-2.0.0-p247'
uncommon.mk:179: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2
++ return 2

(Full log)

I've searched everywhere, I have two other rvm installations with the same version number, I've tried installing different ruby versions, but nothing is working.

@Kagetsuki
Copy link

@faelsoto I was just about to report this. Can you confirm for me if you are compiling with --static? It only fails for me with --static. I checked and a regular static build by hand with flags --disable-shared --enable-static at configure works so I think this is an issue with some extra flags being passed that shouldn't be.

@faelsoto
Copy link
Author

faelsoto commented Nov 9, 2015

@Kagetsuki I'm not compiling with --static, it's a simple rvm install 2.2.3. I just tried with the --disable-shared and --enable-static flags (as in rvm install 2.2.3 -C --disable-shared,--enable-static), but I'm still getting the same error.

@Kagetsuki
Copy link

@faelsoto You certainly would get it with those flags - that's the issue we're seeing. A normal install runs fine for us though. What package are you using to provide SSL? Is libssl-dev installed? Did you happen to roll your own SSL?

@faelsoto
Copy link
Author

faelsoto commented Nov 9, 2015

I'm sorry, I'm really not sure about what package I'm using. I just tried to install it as I have done for several years, but this time something's wrong.

I tried a few times yesterday, and somewhere I got to install openssl via RVM. libssl-dev is installed and the latest version, and no, I'm not rolling my own SSL.

Thanks.

@Kagetsuki
Copy link

@faelsoto I think our problems are somewhat different then - but they would appear to be related. Let's hope a core RVM maintainer jumps in here.

@panudetjt
Copy link

I think i have same issue

vagrant@homestead:~$ sudo rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr
ruby-2.0.0-p643 - #removing src/ruby-2.0.0-p643..
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.0.0-p643, this may take a while depending on your cpu(s)...
ruby-2.0.0-p643 - #downloading ruby-2.0.0-p643, this may take a while depending on your connection...
ruby-2.0.0-p643 - #extracting ruby-2.0.0-p643 to /usr/local/rvm/src/ruby-2.0.0-p643....
ruby-2.0.0-p643 - #configuring..................................................
ruby-2.0.0-p643 - #post-configuration..
ruby-2.0.0-p643 - #compiling......................................................................
Error running '__rvm_make -j1',
showing last 15 lines of /usr/local/rvm/log/1447622128_ruby-2.0.0-p643/make.log
ossl_ssl.c:110:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
 #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
                                                                     ^
ossl_ssl.c:134:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)
     OSSL_SSL_METHOD_ENTRY(SSLv3_client),
                           ^
ossl_ssl.c:110:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
 #define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
                                                                     ^
make[2]: *** [ossl_ssl.o] Error 1
make[2]: Leaving directory `/usr/local/rvm/src/ruby-2.0.0-p643/ext/openssl'
make[1]: *** [ext/openssl/all] Error 2
make[1]: Leaving directory `/usr/local/rvm/src/ruby-2.0.0-p643'
make: *** [build-ext] Error 2
++ return 2
There has been an error while running make. Halting the installation.

on
Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic i686)

@jhass
Copy link

jhass commented Nov 15, 2015

Workaround for now:

wget https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff -O openssl.patch
rvm install --patch ./openssl.patch 2.2.3

@havenwood havenwood added this to the rvm-1.26.12 milestone Nov 15, 2015
@Kagetsuki
Copy link

@jhass Above patch does not work for static ruby (checked on two machines, Ubuntu 15.10 x86_64 and Debian x86_64).

Error was the same on both targets:

ruby-2.2.3 - #compiling - please wait
Error running '__rvm_make -j8',
showing last 15 lines of /home/zero/.rvm/log/1447657181_ruby-2.2.3/make.log
/usr/bin/ld: ossl_engine.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
ossl_engine.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:309: recipe for target '../../.ext/x86_64-linux/openssl.so' failed
make[2]: *** [../../.ext/x86_64-linux/openssl.so] Error 1
make[2]: Leaving directory '/home/zero/.rvm/src/ruby-2.2.3/ext/openssl'
exts.mk:73: recipe for target 'ext/openssl/all' failed
make[1]: *** [ext/openssl/all] Error 2
linking static-library openssl.a
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: Leaving directory '/home/zero/.rvm/src/ruby-2.2.3/ext/openssl'
make[1]: Leaving directory '/home/zero/.rvm/src/ruby-2.2.3'
uncommon.mk:189: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2
+__rvm_make:0> return 2
There has been an error while running make. Halting the installation.

I'm wondering if this has to do with static linking against libruby (libruby-static.a) - as the exact same R_X86_64_32 error is occurring with rice and we were unable to fix it without having a dynamic Ruby. If anyone has more detailed information maybe we should post an issue to Ruby core?

Note: -fPIC did not fix the issue.

@jhass
Copy link

jhass commented Nov 16, 2015

@Kagetsuki This isn't about compiling with static though, it's to remedy https://bugs.ruby-lang.org/issues/11376, which is necessary because SSLv3 support got disabled in Debian's latest OpenSSL package, which apparently landed in Ubuntu 15.10.

Your issue is something completely else.

@Kagetsuki
Copy link

@jhass Roger that - though I think they are somewhat related. Should I put up a separate issue?

@jhass
Copy link

jhass commented Nov 16, 2015

I can assure you they're not related.

@julesGoullee
Copy link

SSl error is patched, apply it for the moment....
wget https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff -O openssl.patch
rvm install --patch ./openssl.patch 2.2.3

@CodeKelly
Copy link

@julesGoullee It Works,Thank you very much!

@rafamanzo
Copy link

After Arch's latest update on openssl package yesterday (6 Mar), this also affects 2.2.3 compilation there (but not 2.3.0).

I can confirm also that the provided patch works there as well.

@mathieujobin
Copy link
Contributor

2.2.4 install fine, 2.2.3 is no big problem, easily replaceable.

what about 2.0.0 ?

@mathieujobin
Copy link
Contributor

woohoo, same patch works for 2.0.0

curl https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff > openssl.patch
rvm install --patch ./openssl.patch 2.0.0

2.2.4 install fine without patches, no need for 2.2.3
2.1.8 also installs fine without patches, so no need for 2.1.7 anymore

confirmed: 1.9.3 and 2.0.0 successfully installed with this method

@StragaSevera
Copy link

Thanks! What about 1.9.3? I really need it...

@mathieujobin
Copy link
Contributor

did you try out the same patch ? if it does not work, I'm afraid it will be complicated
downgrading the ssl package might be easier, I'm not sure where you prefer to spend the time.
upgrading your app to use ruby 2.2 might be better worth it

@StragaSevera
Copy link

Alas, app is not "mine" =-(
Nope. Will try to apply it...

@mathieujobin
Copy link
Contributor

works with 1.9.3

@fervisa
Copy link

fervisa commented Mar 14, 2016

The patch also works on 2.1.7

@v-sh
Copy link

v-sh commented Mar 15, 2016

And for 2.1.5 works too. Thank you!

@mathieujobin
Copy link
Contributor

the official fix is in 2.2.4 and 2.1.8, if it works with 2.2.3, 2.1.7 and 1.9.3, no need to precise any other versions in between....

now for the annoying part that I just discovered, you will need to reinstalled any patched ruby after an openssl software update. it does not happen so often on a mac, but on linux, we do regular updates. so this is an annoyance. usually servers are kept stable, but this is something to keep in mind anyway. should you upgrade openssl, you need to recompile your old ruby.

on ArchLinux, I've added openssl to the ignore list

$ grep IgnorePkg /etc/pacman.conf 
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
IgnorePkg   = postgresql  postgresql-libs lib32-openssl openssl

hope this helps someone
cheers,

@diqidoq
Copy link

diqidoq commented Mar 26, 2016

thanks to havenwood on IRC #rvm for the advice to firstly update to the very latest RVM: rvm get head which helped here on Debian stretch already to get out of the failed installation cycle with rvm and ruby, and what finally results in ruby -v 2.3.0 here, which is is fine for our purposes.

@oliveiraethales
Copy link

Patch by @julesGoullee also working on Arch x64 for 2.1.5 (: Thanks bro!

@waseem
Copy link

waseem commented Apr 28, 2016

This patch worked for me for 1.9.3-p484. https://gist.github.com/waseem/0e8607e443bcd0b3e60cfad56cd9999b

This is the source of the patch: https://bbs.archlinux.org/viewtopic.php?id=209970 cc: @ought

@webavant
Copy link

@julesGoullee's patch builds for 1.9.3-p551, although the final replacement in test/openssl/test_ssl.rb fails, which looks for a match near line 912. My test_ssl.rb is only 499 lines. I may not have followed instructions, so apologies if this is in error.

@cars10
Copy link

cars10 commented Jun 13, 2016

I do have the same problem on arch, ruby-2.1.1 does not compile.
What i tried

  • rvm get head
  • rvm install --patch ruby-2.1.1

still getting errors. Any ideas?

@pkuczynski
Copy link
Member

This has been fixed in #3748/#3752 and merged to latest master. Please switch and test: rvm get master

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

No branches or pull requests