Find libssl on linux using paths of loaded libraries
authorShane Kearns <ext-shane.2.kearns@nokia.com>
Wed, 28 Mar 2012 15:06:57 +0000 (16:06 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 5 Apr 2012 13:37:53 +0000 (15:37 +0200)
commite5337ad1b1fb02873ce7b5ca8db45f6fd8063352
tree8930aa63dad6ee7eef85b08137b8e16f1373c65f
parent76ae64abb54581a9bae27745d28aaf4dfb23a00c
Find libssl on linux using paths of loaded libraries

The installed path of libssl may include an element describing the
architecture, e.g. x86_64-linux-gnu or i386-linux-gnu.
In most cases, the libraries already loaded (static dependencies of
Qt, such as libc) will include the path where libssl is installed.

Use dl_iterate_phdr to find the paths. This is a linux specific
function, but it does provide "/lib/<arch>" and "/usr/lib/<arch>"
at the point ssl symbols are being resolved when running the
qsslsocket autotest (which has less dependencies than a typical
Qt app).

Task-number: QTBUG-24694
Change-Id: I9af8081f41bb85c2fcff450a2acda5672a7f7518
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
src/network/ssl/qsslsocket_openssl_symbols.cpp