Source build fails to link properly against OpenSSL

Description

Building opensaml from source fails at the ./configure stage due to a failure to link against the OpenSSL libraries during the "checking XML-Security version" step in configure.ac:

Regardless of whether you specify the OpenSSL path using --with-openssl or whether you let pkg-config find it, the ./configure invocation fails with the following error.

Example:

./configure --prefix=/home/vmuser/build/install/opensaml --with-xmltooling=/home/vmuser/build/install/xmltooling --with-xmlsec=/home/vmuser/build/install/xmlsecurityc --with-log4cpp=/usr {{... checking xercesc/dom/DOM.hpp usability... yes checking xercesc/dom/DOM.hpp presence... yes checking for xercesc/dom/DOM.hpp... yes checking Xerces version... OK checking whether Xerces XMLString::release(XMLByte**) exists... no checking xsec/utils/XSECPlatformUtils.hpp usability... yes checking xsec/utils/XSECPlatformUtils.hpp presence... yes checking for xsec/utils/XSECPlatformUtils.hpp... yes checking XML-Security version... OK configure: error: unable to link with XML-Security

The contents of config.log show that this happens because the "checking XML-Security version" step tries to link a program against xml-security-c, which requires OpenSSL to be linked in, but the configure.ac scripts never adds them to the LIBS variable, it only adds SSLFLAGS.

configure:20198: checking for xsec/utils/XSECPlatformUtils.hpp configure:20198: result: yes configure:20206: checking XML-Security version configure:20223: g++ -E -I/home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic conftest.cpp configure:20223: $? = 0 configure:20224: result: OK configure:20244: g++ -o conftest -pthread -Wall -O2 -DNDEBUG -I/home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic conftest.cpp -L/home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib -lxml-security-c -lxerces-c -L/usr/lib64 -llog4cpp -lnsl -lz >&5 In file included from /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include/xsec/enc/XSECCryptoProvider.hpp:42:0, from /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include/xsec/utils/XSECPlatformUtils.hpp:39, from conftest.cpp:42: /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include/xsec/enc/XSECCryptoSymmetricKey.hpp:188:52: warning: converting to non-pointer type 'unsigned int' from NULL [-Wconversion-null] unsigned int taglen = NULL) = 0; ^ /usr/bin/ld: warning: libcrypto.so.1.0.0, needed by /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib/libxml-security-c.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libssl.so.1.0.0, needed by /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib/libxml-security-c.so, not found (try using -rpath or -rpath-link) /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib/libxml-security-c.so: undefined reference to `EC_KEY_free' /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib/libxml-security-c.so: undefined reference to `PKCS1_MGF1' ... ...

Updating configure.ac to correctly update LIBS either with a path from --with-openssl or with the output of pkg-config --libs openssl solves the issue.

Environment

CentOS 7 x64

Activity

Scott Cantor June 2, 2016 at 7:51 PM

a88ee5939824ba8eb2982d0bbae6c73626a30649

voetsjoeba+protectnetwork@gmail.com March 10, 2016 at 8:16 PM

Would edit to fix formatting but I can't ...

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Created March 10, 2016 at 8:13 PM
Updated June 29, 2016 at 4:22 PM
Resolved June 2, 2016 at 7:51 PM