Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling the openssl binary statically

Tags:

openssl

The openssl binary generated by the config & make commands when building from the source tarball is dynamically linked to these libraries:

    linux-vdso.so.1 =>  (0x00007fffa75fe000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff7f79ab000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff7f75e2000)
    /lib64/ld-linux-x86-64.so.2 (0x00007ff7f7bd2000)

My guess is if I can link statically to lib gcc, the dependencies on the other shared libraries will disappear too.

Question is how do I get the Configure script to generate a statically linked binary?

Will the process be the same for building on Windows as well?

like image 361
user2636538 Avatar asked Nov 22 '13 14:11

user2636538


1 Answers

What worked for me is to pass -static and --static to the ./config step. --no-shared seems documented in INSTALL but led to build failures. -static by itself also led to build failures.

./config --static -static

like image 162
mppf Avatar answered Sep 21 '22 07:09

mppf