Find libssl on linux using paths of loaded libraries
author Shane Kearns
committer Qt by Nokia
commit ae3ba4e5c592e92718d81bd51305a0410fc2bd2f
tree 3669029129626d7ded2eb40218a18a403ebd041e
parent 84f1adde4fb6cadf57099bd8e6130ceee8ba533b
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 <>
(cherry picked from commit e5337ad1b1fb02873ce7b5ca8db45f6fd8063352)
Reviewed-by: Thiago Macieira <>