cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: configure: error: OpenSSL libs and/or directories were not found where specified!

From: Weston C <westonc_at_gmail.com>
Date: Mon, 2 Jun 2008 14:37:11 -0700

Brian Dessent wrote:
[...]
> Why don't you have a shared openssl? It's normally considered quite a
> bad idea to statically link in security libs like openssl because when a
> vulnerability is discovered it can be patched in one place (the shared
> lib) instead of having to rebuild the hundreds of apps that it was
> linked into, as would be required if it was static.
[...]
> static openssl is not a very well tested
> configuration, for the above reasons.

This makes sense, and I'm convinced to try it, but I still see some issues
building against a shared openssl:

    make all-am
    make[2]: Entering directory `/usr/local/src/curl-7.18.1/src'
    /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2
                -L/usr/local/ssl/lib -o curl main.o hugehelp.o
                urlglob.o writeout.o writeenv.o getpass.o homedir.o
                curlutil.o strtoofft.o strdup.o ../lib/libcurl.la -lz
    gcc -g -O2 -o .libs/curl main.o hugehelp.o urlglob.o writeout.o
                writeenv.o getpass.o homedir.o curlutil.o strtoofft.o
                strdup.o -L/usr/local/ssl/lib ../lib/.libs/libcurl.so -lz
                -Wl,--rpath -Wl,/usr/local/curl/lib
    /usr/bin/ld: warning: libssl.so.0.9.8, needed by
                ../lib/.libs/libcurl.so, not found (try using -rpath or
                -rpath-link)
    /usr/bin/ld: warning: libcrypto.so.0.9.8, needed by
                ../lib/.libs/libcurl.so, not found (try using -rpath or -
                rpath-link)
    ../lib/.libs/libcurl.so: undefined reference to `RAND_load_file'
    ../lib/.libs/libcurl.so: undefined reference to `SSL_CTX_use_...'
        [etc, etc,...]

At least we're past the config stage. :)

Someone else had some similar errors a few months back:

http://curl.haxx.se/mail/archive-2007-12/0077.html

As that poster mentioned he'd done, I tried running that last
step manually and adding -lssl and -lcrypto. This seems to go,
but then when I hit "make", hoping the build will continue, it
still trips over that stage in the target.

I see some hints in the followups to that post:

    From: Dan Fandrich <dan_at_coneharvesters.com>
    Date: Tue, 18 Dec 2007 15:05:23 -0800
> [...]
> What should be happening is that the crypto libs should
> be linked into libcurl instead. What does the
> libcurl.so.4 link line look like?"

What indicates which line is the link line?

> You should also see the crypto libs references in
> the output of "objdump -p lib/.libs/libcurl.so.4"

I do: "NEEDED libcrypto.so.0.9.8"

        From: Daniel Stenberg <daniel_at_haxx.se>
        Date: Wed, 19 Dec 2007 00:07:14 +0100 (CET)

> On Tue, 18 Dec 2007, Calen Pennington wrote:
> > On 32-bit, the configure runs fine, and includes the
> > lines:
> > checking for CRYPTO_lock in -lcrypto... yes
> > checking for SSL_connect in -lssl... yes
> > [...]
> > /usr/dev_tools/170681/bin/ld: warning: libssl.so.0.9.8,
> > needed by ../lib/.libs/libcurl.so, not found (try using
> > -rpath or -rpath-link)
> > /usr/dev_tools/170681/bin/ld: warning: libcrypto.so.0.9.8,
> > needed by ../lib/.libs/libcurl.so, not found (try using
> > -rpath or -rpath-link)
> > ../lib/.libs/libcurl.so: undefined reference to
> > `RAND_load_file'

> As you can see, it tried to link with the crypto and ssl
> libs but didn't find them at link time.

True. So... how do I pass configure what it needs to know to build
a makefile that can give the linker the location info?

(Pennington also mentions 7.16.1 completes builds,
and I find this true ... but then when I go to invoke curl,
I get:

        ./curl: error while loading shared libraries:
                libssl.so.0.9.8: cannot open shared object file:
                No such file or directory

So, obviously, not a net gain for me. :)

Thanks,

Weston
Received on 2008-06-02