openssl cmake module

matthias sweertvaegher matthias.sweertvaegher at gmail.com
Mon Apr 4 23:14:06 CEST 2011


On Mon, Apr 4, 2011 at 8:24 PM, Raphael Kubo da Costa <kubito at gmail.com> wrote:

>>> By taking a quick look at the diff output between KDE's
>>> FindOpenSSL.cmake and CMake's FindOpenSSL.cmake, the only relevant
>>> difference I can see is that CMake's FindOpenSSL.cmake also looks for
>>> libcrypto besides libssl.
>>
>> that's indeed what I found out but I'm puzzled how you can build my
>> plasmoid without having the libcrypto linked in.. actually i make
>> cmake output the openssl libraries like this:
>> ssl libs = /usr/lib64/libssl.so;/usr/lib64/libcrypto.so
>>
>> Can you check if it outputs both libraries in your build environment?
>> When I use the KDE FindOpenSSL module I only get the libssl and not
>> libcrypto. That explains why it does not build on my (suse) system
>> unless I remove the KDE version.
>
> I get "ssl libs = /usr/lib/libssl.so", with no mention to libcrypto.so
> in it.
>
> ldd does show that libssl.so depends on libcrypto.so here, and readelf
> tells me functions such as BIO_read are defined in libcrypto and
> referenced in libssl.
>
> From your build log, it looks like OBS uses a lot of linking flags which
> are not used here, perhaps that's where the issue lies.
>
> In any case, I think it might make sense to sync KDE's FindOpenSSL.cmake
> with CMake's, or at least fetch this part of it from CMake.
>
> I'd like neundorf to have a final say on this, though, as he's the
> buildsystem demigod.

thanks for all your help. Yes, it would be nice if KDE could adopt the
cmake version.

In the meanwhile I followed your clue about the linker flags and
you're right. -Wl,--no-undefined seems to be the culprit. This forces
all external symbols to be found in an explicitly listed dependency. I
tried adding the --allow-shlib-undefined flag. However, this does not
seem to override the no-undefined flag. Only thing left seemed to
remove the no-undefined flag. The only way I found using cmake:
 SET (CMAKE_MODULE_LINKER_FLAGS)
This works on my local box but not on the build service (i verified
that it was using my modified build file). So then I tried:
 STRING(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS
${CMAKE_MODULE_LINKER_FLAGS})

This works. Or is there a better way to remove a linker flag?


matthias


More information about the Kde-buildsystem mailing list