2

I've been trying to upgrade some programs on an old Linux box (Debian 7.5 wheezy). I'd like to keep default system libs untouched and to add some custom builds alongside them. It works fine for most libs, only OpenSSL gives me a hard time (libssl.so + libcrypt.so).

Here is my OpenSSL configure line:

# ./config --prefix=/usr/local --openssldir=/usr/local/openssl no-gost shared zlib no-ssl2 -fPIC

Then for other programs, for example cURL:

# ./configure LDFLAGS="-L/usr/local/ssl/lib -ldl" --with-ssl --enable-shared

But then I get the wrong OpenSSL version:

# curl --version
curl 7.44.0 (x86_64-unknown-linux-gnu) libcurl/7.44.0 OpenSSL/1.0.1e

I know libssl.so has copies in the following folders on this system:

/usr/lib/libssl.so
/usr/lib/x86_64-linux-gnu/libssl.so
/usr/local/lib/libssl.so
/usr/local/ssl/lib/libssl.so

All of them are the same custom-compiled version, except /usr/lib/x86_64-linux-gnu/libssl.so which appears to be my default system lib (v1.0.5e).

I'd like to know how I can instruct configure scripts to avoid looking inside /lib/x86_64-linux-gnu? Can I just change the /usr/lib/x86_64-linux-gnu/libssl.so symlink and point it to my builds? Is it safe?

Thanks,

0

One solution I found that was labelled "not the best way to do it" but worked for me, was to edit the LD_LIBRARY_PATH system variable, for example in <user>/.bashrc:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
0

I tried to do what you suggest, resulting in a segmentation fault! So, not safe!

/usr/lib/i686/cmov$ sudo ln -s /usr/lib/libssl.so.1.0.0 libssl.so.0.9.8
/usr/lib/i686/cmov$ ls -la
total 1684
drwxr-xr-x 2 root root    4096 Jun 16 14:15 .
drwxr-xr-x 3 root root    4096 Oct 22  2012 ..
-rw-r--r-- 1 root root 1393308 Feb 11  2013 libcrypto.so.0.9.8
lrwxrwxrwx 1 root root      24 Jun 16 14:15 libssl.so.0.9.8 -> /usr/lib/libssl.so.1.0.0
-rw-r--r-- 1 root root  310296 Feb 11  2013 libssl.so.0.9.8.bk
:/usr/lib/i686/cmov$ sudo /etc/init.d/nginx restart
Restarting nginx: nginx/usr/sbin/nginx: /usr/lib/i686/cmov/libssl.so.0.9.8: no version information available (required by /usr/sbin/nginx)
Segmentation fault
  • This is not what I was suggesting. In my setup, I modified one way the system loads the libs so as to make the compiled libs a priority over the system libs, but I kept both files separate. Also, this works if the other tools are built also on the system, or else they will surely fail. – Guillaume Rossolini Jun 18 '16 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.