cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problems linking ssl when cross-compiling curl

From: Anders Palm <anders.palm_at_swarco.com>
Date: Tue, 26 Aug 2014 09:38:46 +0200

On 26/08/14 00:49, Dan Fandrich wrote:
> This is more a development question, so curl-library is a better place to ask.
No problem, moved it here.
> The path given to the --with-ssl option might be confusing the build system, as
> it's also finding pkg-config. You could try it again dropping the
> /usr/local/ssl and making sure the PKG_CONFIG_PATH variable is set correctly
> instead (as documented in docs/INSTALL).

This is where it gets hairy. When i supply a path in --with-ssl, it
finds the pkgconfig paths, when i set PKG_CONFIG_PATH it doesn't find
ssl at all.

env PKG_CONFIG_PATH=${ARM_TOOLS_DIR}/usr/local/ssl/lib/pkgconfig
./configure --host=arm-none-linux --with-ssl

The path is correct, and it holds *.pc files with the correct paths to
the libraries, yet:

configure: WARNING: the previous check could not be made default was used
checking if SPNEGO support is requested... no
checking if GSS-API support is requested... no
checking whether to enable Windows native SSL/TLS (Windows native builds
only)... no
checking whether to enable iOS/Mac OS X native SSL/TLS... no
checking for CRYPTO_lock in -lcrypto... no
checking for CRYPTO_add_lock in -lcrypto... no
checking for ssl_version in -laxtls... no
configure: WARNING: SSL disabled, you will not be able to use HTTPS,
FTPS, NTLM and more.
configure: WARNING: Use --with-ssl, --with-gnutls, --with-polarssl,
--with-cyassl, --with-nss, --with-axtls, --with-winssl, or
--with-darwinssl to address this.

>> Correctly identifies where openssl is:
>>
>> checking whether to enable Windows native SSL/TLS (Windows native
>> builds only)... no
>> checking whether to enable iOS/Mac OS X native SSL/TLS... no
>> configure: PKG_CONFIG_LIBDIR will be set to "/home/palm/projects/build_tools/build/sys-roots/install-arm-dir/usr/local/ssl/lib/pkgconfig"
>> checking for arm-none-linux-pkg-config... no
>> checking for pkg-config... /usr/bin/pkg-config
>> checking for openssl options with pkg-config... found
>> configure: pkg-config: SSL_LIBS: "-lssl -lcrypto -ldl "
>> configure: pkg-config: SSL_LDFLAGS: "-L/home/palm/projects/build_tools/build/sys-roots/install-arm-dir/usr/local/ssl/lib
>> "
>> configure: pkg-config: SSL_CPPFLAGS: "-I/home/palm/projects/build_tools/build/sys-roots/install-arm-dir/usr/local/ssl/include
> Are these the correct locations?
Yes, these are correct.
>
> [...]
>> -L/home/palm/projects/build_tools/build/sys-roots/install-arm-dir/usr/local/ssl/lib
> It's not clear whether the line breaks are supposed to be in this log, but are
> there libcrypto.so and libssl.so files in that last directory? Are they
> pointing to the right locations? Are there .la files in that directory and are
> they correct?
>
Yes. although only static library .a files, not .la, would this perhaps
give libtool problems?
>> ../lib/.libs/libcurl.so -lrt

I just noticed, it's not linking against the libraries! No wonder its
complaining about missing symbols. It seems like it's missing -lssl and
-lcrypto

If i try linking manually with these included then it works. Bug in the
build system?

// Anders
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-08-26