静态编译 openssl 二进制文件 [英] Compiling the openssl binary statically

查看:105
本文介绍了静态编译 openssl 二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

config & 生成的 openssl 二进制文件从源 tarball 构建时的 make 命令动态链接到这些库:

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)

我的猜测是,如果我可以静态链接到 lib gcc,对其他共享库的依赖也会消失.

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?

在 Windows 上构建的过程是否也一样?

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

推荐答案

对我有用的是通过 -static --static./config 步骤.--no-shared 似乎记录在 INSTALL 中,但导致构建失败.-static 本身也会导致构建失败.

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

这篇关于静态编译 openssl 二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆