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

Hint when compiling with another openssl library #2615

Closed
VARGA-Peter opened this issue May 28, 2018 · 8 comments
Closed

Hint when compiling with another openssl library #2615

VARGA-Peter opened this issue May 28, 2018 · 8 comments

Comments

@VARGA-Peter
Copy link

I would like to provide an information which could be published in the installation manual in order to help others.

When curl is compiled with another openssl version than the system default it is often not possible to set the library path from the new openssl version in /etc/ld.so.conf because this may break the system.

In this case the configure script fails running conftest when it is using the openssl libraries with ./conftest: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory.

The only way in this case is to use the rpath linker option.

Solution:
Before running ./configure execute export LDFLAGS="-Wl,--rpath=/<path-to-correct-openssl-libraries>"

@bagder
Copy link
Member

bagder commented May 28, 2018

Are you suggesting that as a change for docs/INSTALL ?

Personally I tend to just set LD_LIBRARY_PATH if this is more of a temporary thing/work-around.

@VARGA-Peter VARGA-Peter changed the title Hint for compiling with another openssl library Hint when compiling with another openssl library May 28, 2018
@VARGA-Peter
Copy link
Author

Not really a change - I suggest a note in how to install curl and libcurl.

There is the LDFLAGS note but this is not enough. When the openssl libraries are somewhere else which is not set in /etc/ld.so.conf then configure script fails.

Honestly, for me it doesn't matter, if you prefer LD_LIBRARY_PATH then it is of course also OK. I personally like the rpath linker option because in this case I don't depend on any external settings - the path is hard-coded into the executable.

Notice:
From the above mentioned page:
If you have shared SSL libs installed in a directory where your run-time linker doesn't find them (which usually causes configure failures), you can provide the -R option to ld on some operating systems to set a hard-coded path to the run-time linker:

LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl

This doesn't work for gcc 7.3.0. This is the output in config.log:

gcc: error: unrecognized command line option '-R'

This works:

LDFLAGS=-Wl,-R/usr/local/ssl/lib ./configure --with-ssl

Adding -Wl, doesn't break it. How ever, a small modification in the installation guide would help...

@bagder
Copy link
Member

bagder commented May 28, 2018

When the openssl libraries are somewhere else which is not set in /etc/ld.so.conf then configure script fails

No it doesn't. If it does, that's a bug! The configure script sets and uses LD_LIBRARY_PATH specifically to deal with this.

I would be very happy if you would provide your suggested phrasing as actual diffs to the source file. Also note that you're talking about linker options to a specific linker so any docs would need to clarify that this is system/linker specific. And as you say, possibly even version specific.

@VARGA-Peter
Copy link
Author

Wait, it must be a new bug because I tried it with curl 7.58 and there it works! So check the changes from 7.58 to 7.60! Thank you for mentioning it because I almost forgot. I had to solve it so I was working on it last weekend until I found the solution with the rpath linker option.

This is the command line:

./configure --prefix=/FaF/curl --with-ssl=/FaF/openssl --disable-ldap --without-zlib --disable-proxy --disable-ipv6 --disable-manual

With 7.58 it works without any additional LDFLAGS setting, with 7.60 it fails.

@bagder
Copy link
Member

bagder commented May 28, 2018

Yes, #2586 for example is a fix since 7.60.0 and is directly related to this. So please try a daily snapshot first.

@VARGA-Peter
Copy link
Author

Yep, I confirm, the latest daily snapshot works! I will check out periodically if a new version is available.


So, there would be more or less only the hint in the installation guide regarding the rpath linker option or preceding LDFLAGS with -Wl, so it works for gcc.

@bagder
Copy link
Member

bagder commented May 28, 2018

Thanks for confirming. The next release date is planned for July 11th.

bagder added a commit that referenced this issue May 28, 2018
... the older description doesn't work

Reported-by: Peter Varga
Fixes #2615
@bagder bagder closed this as completed in c10f3a1 May 29, 2018
@bagder
Copy link
Member

bagder commented May 29, 2018

Thanks @AlBundyLoves69, the updated description has now landed!

@lock lock bot locked as resolved and limited conversation to collaborators Aug 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants