cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3537676 ] link errors on Suse SLES11 with openSSL 1.0.1c

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 26 Jun 2012 08:20:59 -0700

Bugs item #3537676, was opened at 2012-06-25 00:22
Message generated for change (Comment added) made by kdekker
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3537676&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: compile or build problem
Group: portability problem
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: kdekker (kdekker)
Assigned to: Daniel Stenberg (bagder)
Summary: link errors on Suse SLES11 with openSSL 1.0.1c

Initial Comment:
When using cURL 7.26.0, and buildiong with static libraries (both for cURL and OpenSSL) I get link errors when linking curl with OpenSSL:

{{{
libtool: link: gcc-4.3 -O2 -mtune=generic -m32 -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse -g0 -Wno-system-headers -o curl hugehelp.o tool_binmode.o tool_bname.o tool_cb_dbg.o tool_cb_hdr.o tool_cb_prg.o tool_cb_rea.o tool_cb_see.o tool_cb_wrt.o tool_cfgable.o tool_convert.o tool_dirhie.o tool_doswin.o tool_easysrc.o tool_formparse.o tool_getparam.o tool_getpass.o tool_help.o tool_helpers.o tool_homedir.o tool_libinfo.o tool_main.o tool_mfiles.o tool_msgs.o tool_operate.o tool_operhlp.o tool_panykey.o tool_paramhlp.o tool_parsecfg.o tool_setopt.o tool_sleep.o tool_urlglob.o tool_util.o tool_vms.o tool_writeenv.o tool_writeout.o tool_xattr.o strtoofft.o strdup.o rawstr.o nonblock.o -L/vobs/obj.SUSE10/thirdparty/OpenSSL/32bit/lib -L/vobs/obj.SUSE10/thirdparty/OpenSSL/32bit/openssl-1.0.1c/../lib ../lib/.libs/libcurl.a -lm -lnsl -lcrypto -lssl -ldl -lrt
/vobs/obj.SUSE10/thirdparty/OpenSSL/32bit/lib/libssl.a(s3_clnt.o): In function `ssl3_check_cert_and_algorithm':
s3_clnt.c:(.text+0x28b): undefined reference to `X509_certificate_type'
/vobs/obj.SUSE10/thirdparty/OpenSSL/32bit/lib/libssl.a(s3_enc.o): In function `ssl3_change_cipher_state':
s3_enc.c:(.text+0xb67): undefined reference to `COMP_CTX_free'
s3_enc.c:(.text+0xb81): undefined reference to `COMP_CTX_new'
s3_enc.c:(.text+0xc0f): undefined reference to `COMP_CTX_free'
s3_enc.c:(.text+0xc25): undefined reference to `COMP_CTX_new'
/vobs/obj.SUSE10/thirdparty/OpenSSL/32bit/lib/libssl.a(s3_pkt.o): In function `ssl3_do_compress':
s3_pkt.c:(.text+0x35d): undefined reference to `COMP_compress_block'
}}}

The cause is that pkg-config on Suse 10 (for a unknown reason for me) swaps -lssl and -lcrypto. Since libssl (static) depends on libcrypto.

The openssl.pc file contains:

{{{
prefix=/vobs/obj.SUSE10/thirdparty/OpenSSL/32bit/openssl-1.0.1c/..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: OpenSSL
Description: Secure Sockets Layer and cryptography libraries and tools
Version: 1.0.1c
Requires:
Libs: -L${libdir} -lssl -lcrypto
Libs.private: -ldl
Cflags: -I${includedir}
}}}

There are several possibilities to fix this:
1. modify pc file and awap -lss -lcrypto to -lcrypto -lssl to get (weird) -lssl -lcrypto link order
2. do not use pk-config but add libraries by hand to the cURL makefile.

Strange enough, pkg-config on other platforms (e.g. AIX) works well. The pc file is similar, but pkg-config does not swap the library order. I don't know why pkg-config swaps the library order.

----------------------------------------------------------------------

>Comment By: kdekker (kdekker)
Date: 2012-06-26 08:20

Message:
I asked the maintainer of pkg-config for information, and now tested with
pkg-config 0.26 (which had a dependency on glib2 too). That solved the
issue (i.e. swapping libraries is not performed anymore).

On AIX pkg-config 0.19 also did not suffer from the problem.

----------------------------------------------------------------------

Comment By: kdekker (kdekker)
Date: 2012-06-25 02:17

Message:
It is probably indeed not a curl bug... I agree with you that the
workaround is poor.
Strange enough: I don't understand why I never ran before into the same
issue. It is not for the first time that I build cURL with OpenSSL.

The reason that I filed this 'bug' is that cURL can use other ways for
linking with openSSL. E.g. similar to platforms where no pkg-config is
available.

What possible workaround do exist? Passing a value to LDFLAGS? Do you have
a suggestion for a better approach?

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2012-06-25 02:11

Message:
Sorry, but isn't this a bug in the pkg-config file for openssl on Suse? How
is it a curl bug?

"Hand-adding" libraries in curl's configure script is a very poor
work-around that is destined to break very soon and easily.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3537676&group_id=976
Received on 2012-06-26

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET