curl-library
Re: Conflicting symbols in NSS and OpenSSL
Date: Sun, 13 Jan 2002 12:25:26 +0100 (MET)
On Fri, 11 Jan 2002, Pratibha Gupta wrote:
> I have compiled libcurl.so as a dynamic library that links statically to
> OpenSSL (libcrypto.a and libssl.a). My program links with libcurl.so. My
> program also has to link with another X.so which is linked dynamically to
> the NSS shared libraries. OpenSSL and NSS share some function names (the
> one which I am running into is SHA1_Update). I am not calling these
> conflicting functions directly, but both the libraries (curl and X) are. In
> the course of running the program, I get a core dump and on running the
> debugger I find that it's because X is calling the SHA1_Update in
> libcurl.so instead of the one in NSS.
Ouch.
> Is there any way to fix this problem apart from changing the code in one of
> these libraries?
I can't see any other way to fix this than to modify either the OpenSSL or
the NSS libraries. They're the ones using bad name spacing for their symbols.
> Would there be any way to compile curl with openssl in such a way that none
> of the openssl symbols are visible as globals?
>
> This is on Linux.
I don't think that's possible (or at least not easily). In Linux, as in many
unixes, all global symbols in libraries are visible to the outside when
linking.
You could possibly try to change the order you specify the libraries on the
link command line.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2002-01-13