Runpath definition missing for libssl.so

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Runpath definition missing for libssl.so

Laurent Blume
Hello all,

I've got a relatively minor problem with OpenSSL linking, it may be a
flaw in the configure script, or just me not finding the right option.

Here is is: I want to build OpenSSL with an integrated linker runpath,
so I don't need LD_LIBRARY_PATH or crle hacks.

Since some OpenSSL binaries depend on the library itself, I built it
this way:

./config --prefix=/usr/local/openssl-0.9.7g shared \
   -R/usr/local/openssl-0.9.7g/lib

However, it seems it's not using my -R parameter when linking libssl.so:

$ ldd lib/libssl.so
         libcrypto.so.0.9.7 =>    (file not found)
         libsocket.so.1 =>        /usr/lib/libsocket.so.1

It does work for the openssl binary, though:

$ ldd bin/openssl
         libssl.so.0.9.7 =>
/usr/local/openssl-0.9.7g/lib/libssl.so.0.9.7
         libcrypto.so.0.9.7 =>
/usr/local/openssl-0.9.7g/lib/libcrypto.so.0.9.7

I did a very small hack to my Makefile:

$ diff Makefile.bak Makefile
268c268
<               $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
---
 >               $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto
-R/usr/local/openssl-0.9.7g/lib' build-shared; \

And now that works:

$ ldd lib/libssl.so
         libcrypto.so.0.9.7 =>
/usr/local/openssl-0.9.7g/lib/libcrypto.so.0.9.7

Any idea on what would be the Right Way to do it? Is there another
parameter I could give to ./config?

This on a Solaris 9 box, using SunCC.

Laurent
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Runpath definition missing for libssl.so

prakash babu
Hi,
 
I would suggest you two solutions
 
Solution 1 :
Create a symbolic link in the system directory for libcrypto.so and libssl.so
ln -s /usr/local/openssl-0.9.7g/lib/libcrypto.so /usr/lib/libcrypto.so
ln -s /usr/local/openssl-0.9.7g/lib/libssl.so /usr/lib/libssl.so
 
Solution 2
Specify  a embedded  path for  the library using the flag -Wl,+b /usr/local/openssl-0.9.7g/lib (not sure for SunCC)
 
--Prakash,
 
Laurent Blume <[hidden email]> wrote:
Hello all,

I've got a relatively minor problem with OpenSSL linking, it may be a
flaw in the configure script, or just me not finding the right option.

Here is is: I want to build OpenSSL with an integrated linker runpath,
so I don't need LD_LIBRARY_PATH or crle hacks.

Since some OpenSSL binaries depend on the library itself, I built it
this way:

./config --prefix=/usr/local/openssl-0.9.7g shared \
-R/usr/local/openssl-0.9.7g/lib

However, it seems it's not using my -R parameter when linking libssl.so:

$ ldd lib/libssl.so
libcrypto.so.0.9.7 => (file not found)
libsocket.so.1 => /usr/lib/libsocket.so.1

It does work for the openssl binary, though:

$ ldd bin/openssl
libssl.so.0.9.7 =>
/usr/local/openssl-0.9.7g/lib/libssl.so.0.9.7
libcrypto.so.0.9.7 =>
/usr/local/openssl-0.9.7g/lib/libcrypto.so.0.9.7

I did a very small hack to my Makefile:

$ diff Makefile.bak Makefile
268c268
< $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
---
> $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto
-R/usr/local/openssl-0.9.7g/lib' build-shared; \

And now that works:

$ ldd lib/libssl.so
libcrypto.so.0.9.7 =>
/usr/local/openssl-0.9.7g/lib/libcrypto.so.0.9.7

Any idea on what would be the Right Way to do it? Is there another
parameter I could give to ./config?

This on a Solaris 9 box, using SunCC.

Laurent
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [hidden email]
Automated List Manager [hidden email]

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Reply | Threaded
Open this post in threaded view
|

Re: Runpath definition missing for libssl.so

Laurent Blume
prakash babu wrote:
> *Solution 1 :*
> Create a symbolic link in the system directory for libcrypto.so and
> libssl.so
> ln -s /usr/local/openssl-0.9.7g/lib/libcrypto.so /usr/lib/libcrypto.so
> ln -s /usr/local/openssl-0.9.7g/lib/libssl.so /usr/lib/libssl.so

Evil. This is a sure road to troubles at some point (I know, some dumb
sysadmins have messed with a few boxes in such ways before I arrived,
they're a real PITA to update now).

> *Solution 2*
> Specify  a embedded  path for  the library using the flag* -Wl,+b
> /usr/local/openssl-0.9.7g/lib* (not sure for SunCC)

Yes, but how do I pass it along using the config script?
-R should have done it.

Thanks for answering!

Laurent
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Runpath definition missing for libssl.so

Andreas Almroth
Laurent Blume wrote:

> prakash babu wrote:
>
>> *Solution 1 :*
>> Create a symbolic link in the system directory for libcrypto.so and
>> libssl.so
>> ln -s /usr/local/openssl-0.9.7g/lib/libcrypto.so /usr/lib/libcrypto.so
>> ln -s /usr/local/openssl-0.9.7g/lib/libssl.so /usr/lib/libssl.so
>
>
> Evil. This is a sure road to troubles at some point (I know, some dumb
> sysadmins have messed with a few boxes in such ways before I arrived,
> they're a real PITA to update now).
>
>> *Solution 2*
>> Specify  a embedded  path for  the library using the flag* -Wl,+b
>> /usr/local/openssl-0.9.7g/lib* (not sure for SunCC)
>
>
> Yes, but how do I pass it along using the config script?
> -R should have done it.
>
> Thanks for answering!
>

As it is Solaris, use export LD_OPTIONS='-R/usr/local/openssl-0.9.7g/lib
-L/usr/local/openssl-0.9.7g/lib'
The linker will take that into consideration, and if you do a dump -Lv
on the output file, the RUNPATH should be included.

/Andreas




______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Runpath definition missing for libssl.so

Laurent Blume
Andreas Almroth wrote:
> As it is Solaris, use export LD_OPTIONS='-R/usr/local/openssl-0.9.7g/lib
> -L/usr/local/openssl-0.9.7g/lib'
> The linker will take that into consideration, and if you do a dump -Lv
> on the output file, the RUNPATH should be included.

*smacks head*
Ok, I wonder how I managed to never notice that in the man...

Thanks a *lot*!
Definitely sounds like a clean solution, that'll avoid a lot of hassle, there
and for other, more broken Makefiles as well. I'll add that to my notes tomorrow.

Laurent
--
A hundred thousand lemmings can't be wrong!
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Runpath definition missing for libssl.so

Laurent Blume
In reply to this post by Andreas Almroth
Andreas Almroth wrote:
> As it is Solaris, use export LD_OPTIONS='-R/usr/local/openssl-0.9.7g/lib
> -L/usr/local/openssl-0.9.7g/lib'
> The linker will take that into consideration, and if you do a dump -Lv
> on the output file, the RUNPATH should be included.

I confirm that that fix is perfect for me.

I still thinks it's probably a flaw in the Makefile that my -R parameter
was used for bin/openssl, and not lib/libssl.so.

Anyway, looks good now, thanks again!

Laurent
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]