Openssl binary with statically linked libssl and libcrypto

K Lengauer kevin.lengauer at adnovum.ch
Tue Jul 23 09:02:30 UTC 2019


Hi all,

I am trying to build the 'openssl' binary with libssl and libcrypto linked
statically because the end product may be used on a system where they are
not available. I recently upgraded to OpenSSL v1.1.1c and previously used
1.0.2s which allowed me to get the 'openssl' binary with statically linked
libssl and libcrypto.

I went through several questions and boards already and tried different
things:
1) Using "no-shared" and "-static" for that matter with ./config is not an
option as I still require the libcrypto.so and libssl.so for some other
tests that are part of the whole component to which OpenSSL belongs in my
use-case.
2) My "solution" so far is to change the "build.info" in /openssl/apps in
the following way:

source:       DEPEND[openssl]=libapps.a ../libssl  
changed to: DEPEND[openssl]=libapps.a ../libssl.a ../libcrypto.a

This way I am able to build both the openssl binary with statically linked
libraries as well as keep building the shared libraries.

However, here comes the catch. In doing so I break several of the OpenSSL
unit tests (notably all 70-* recipe tests such as 70-test_comp.t, etc.) and
they encounter a segmentation fault. I could provide a backtrace of the core
for such a segfault.
If I dont link the libraries statically and instead use the config to point
it to the built .so files the tests run just fine.

Is there a (better) way to achieve my goal to build the 'openssl' binary
with statically linked libcrypto and libssl? I read in a recent question
that statically linking is not recommended but still ask you kindly for any
advice you can give me on this matter.

I am sorry for this lengthy question but I tried to offer some insight in my
thought process so far. Furhter, I apologize if my error is obvious as I am
still learning the topics related to OpenSSL and especially the changes that
occured since OpenSSL v1.1.0.






--
Sent from: http://openssl.6102.n7.nabble.com/OpenSSL-User-f3.html


More information about the openssl-users mailing list