cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problems linking ssl when cross-compiling curl

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 26 Aug 2014 00:49:46 +0200

On Mon, Aug 25, 2014 at 08:04:01PM +0200, Anders Palm wrote:
> Hello curl-users!

This is more a development question, so curl-library is a better place to ask.

> I'm trying to cross-compile curl 7.37.0 with openssl for an arm target.
>
> Openssl is correctly build for the target with a custom prefix. It is
> installed in its collected usr/local/ssl fashion.
>
> ./configure --host=arm-none-linux --with-ssl=${ARM_TOOLS_DIR}/usr/local/ssl

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).

> 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?

[...]
> But when running make, i get the following errors:
>
> /bin/bash ../libtool --tag=CC --mode=link
> arm-none-linux-gnueabi-gcc -march=armv4t -O2 -Wno-system-headers -L/home/palm/projects/build_tools/build/sys-roots/install-arm-dir/usr/local/ssl/lib
> -o curl curl-tool_binmode.o curl-tool_bname.o curl-tool_cb_dbg.o
> curl-tool_cb_hdr.o curl-tool_cb_prg.o curl-tool_cb_rea.o
> curl-tool_cb_see.o curl-tool_cb_wrt.o curl-tool_cfgable.o
> curl-tool_convert.o curl-tool_dirhie.o curl-tool_doswin.o
> curl-tool_easysrc.o curl-tool_formparse.o curl-tool_getparam.o
> curl-tool_getpass.o curl-tool_help.o curl-tool_helpers.o
> curl-tool_homedir.o curl-tool_hugehelp.o curl-tool_libinfo.o
> curl-tool_main.o curl-tool_metalink.o curl-tool_mfiles.o
> curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o
> curl-tool_panykey.o curl-tool_paramhlp.o curl-tool_parsecfg.o
> curl-tool_setopt.o curl-tool_sleep.o curl-tool_urlglob.o
> curl-tool_util.o curl-tool_vms.o curl-tool_writeenv.o
> curl-tool_writeout.o curl-tool_xattr.o ../lib/curl-strtoofft.o
> ../lib/curl-strdup.o ../lib/curl-rawstr.o ../lib/curl-nonblock.o
> ../lib/curl-warnless.o ../lib/libcurl.la -lrt
> libtool: link: arm-none-linux-gnueabi-gcc -march=armv4t -O2
> -Wno-system-headers -o .libs/curl curl-tool_binmode.o
> curl-tool_bname.o curl-tool_cb_dbg.o curl-tool_cb_hdr.o
> curl-tool_cb_prg.o curl-tool_cb_rea.o curl-tool_cb_see.o
> curl-tool_cb_wrt.o curl-tool_cfgable.o curl-tool_convert.o
> curl-tool_dirhie.o curl-tool_doswin.o curl-tool_easysrc.o
> curl-tool_formparse.o curl-tool_getparam.o curl-tool_getpass.o
> curl-tool_help.o curl-tool_helpers.o curl-tool_homedir.o
> curl-tool_hugehelp.o curl-tool_libinfo.o curl-tool_main.o
> curl-tool_metalink.o curl-tool_mfiles.o curl-tool_msgs.o
> curl-tool_operate.o curl-tool_operhlp.o curl-tool_panykey.o
> curl-tool_paramhlp.o curl-tool_parsecfg.o curl-tool_setopt.o
> curl-tool_sleep.o curl-tool_urlglob.o curl-tool_util.o
> curl-tool_vms.o curl-tool_writeenv.o curl-tool_writeout.o
> curl-tool_xattr.o ../lib/curl-strtoofft.o ../lib/curl-strdup.o
> ../lib/curl-rawstr.o ../lib/curl-nonblock.o ../lib/curl-warnless.o -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?

> ../lib/.libs/libcurl.so -lrt
> /home/palm/projects/build_tools/build/sys-roots/install-arm-dir/packages/arm_toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld:
> warning: libssl.so.0.9.8, needed by ../lib/.libs/libcurl.so, not
> found (try using -rpath or -rpath-link)
> /home/palm/projects/build_tools/build/sys-roots/install-arm-dir/packages/arm_toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/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 `SSL_connect'
> ../lib/.libs/libcurl.so: undefined reference to `X509_check_issued'
> ../lib/.libs/libcurl.so: undefined reference to `BIO_free'
> ../lib/.libs/libcurl.so: undefined reference to `BIO_s_mem'
> ../lib/.libs/libcurl.so: undefined reference to `UI_method_get_reader'
> ../lib/.libs/libcurl.so: undefined reference to `SSL_get_session'
> ../lib/.libs/libcurl.so: undefined reference to `UI_get_string_type'
> ../lib/.libs/libcurl.so: undefined reference to `sk_pop_free'
> ../lib/.libs/libcurl.so: undefined reference to `BIO_ctrl'
> ....
>
> I've tried searching the mailing list for similar problems, but not
> found anyone with this exact issue. Any help is very much appreciated

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-08-26