cURL / Mailing Lists / curl-library / Single Mail

curl-library

Compilation issue: linking to openssl with absolute path?

From: Romain Rivière <lecoyote_at_lecoyote.org>
Date: Wed, 01 Oct 2014 19:07:41 +0200

Hello list,

I am having a hard time trying to build libcurl (7.24.0) as part of
Optware¹. The relevant section of the config log is:

-----8<-----
configure:4154: checking for C compiler default output file name
configure:4176:
/home/smokey/projects/optware-git/syno-x86_64/toolchain/gcc-4.7.3-glibc-2.17/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc
 -O2 -O2 -pipe
-I/home/smokey/projects/optware-git/syno-x86_64/staging/opt/include
-L/home/smokey/projects/optware-git/syno-x86_64/staging/opt/lib
-Wl,-rpath,/opt/lib
-Wl,-rpath-link,/home/smokey/projects/optware-git/syno-x86_64/staging/opt/lib
-lssl conftest.c >&5
configure:4180: $? = 0
configure:4217: result: a.out
configure:4233: checking whether the C compiler works
configure:4242: ./a.out
./a.out: error while loading shared libraries: libssl.so.0.9.8: cannot
open shared object file: No such file or directory
configure:4246: $? = 127
configure:4253: error: in
`/home/smokey/projects/optware-git/syno-x86_64/builds/libcurl':
configure:4257: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
-----8<-----

As you can see from the second line, the path to Openssl is not the
system path: it is Optware's staging dir, and libopenssl is there:

-rw-r--r-- 1 smokey smokey 391130 1 oct. 17:46
/home/smokey/projects/optware-git/syno-x86_64/staging/opt/lib/libssl.so.0.9.8

It was compiled only minutes before libcurl.

I am very new to the whole configure/make/building/linking magic, but
from what I've read here and there, it seems to me that the problem
comes from the fact that in this case, the compiled binary (a.out)
should be linked against libssl using an absolute path.
Instead, it's looking for it in the system, which has a different
version of it installed (1.0.0), hence the failure.

I suppose this could be solved with a proper flag somewhere, and Optware
would allow me to apply a patch to the configure script before building,
but I'm having a hard time finding out exactly where and how this a.out
is built. Also, I'm not sure whether or not it is a side-effect of
configure believing it is not cross-compiling (same target and host
arches) when actually, it kindof is (very different userland and lib path).

I would greatly appreciate some pointers :)
Thanks for your time, best regards.

-- 
Romain Rivière
[1] : www.nslu2-linux.org
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-10-01