openssl交叉编译

  1. 下载源代码

有外网可以去github上下载,这里贴一个下载好的 openssl-3.3.0

  1. 在根目录下建一个build文件夹,切换到里面,再建一个install文件夹
bash 复制代码
openssl-3.3.0$ mkdir build/install -p
openssl-3.3.0$ cd build/
openssl-3.3.0/build$
  1. 自己的编译工具链路径导入PATH
bash 复制代码
openssl-3.3.0/build$ export PATH=$PATH:/path/to/cross_comiler_tool/bin #注意一定到到bin,建议采用绝对路径,以免出问题
  1. 执行config,注意修改--cross-compile-prefix为自己的工具链指令前缀
bash 复制代码
openssl-3.3.0/build$ ../config no-asm --prefix=./install --cross-compile-prefix=aarch64-buildroot-linux-gnu- #这个是编译工具链指令前面那部分
Configuring OpenSSL version 3.3.0 for target linux-x86_64
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
...
  1. 删除Makefile中的-m64

执行完config后,会在build下生成很多文件,打开其中的Makefile,找到"-m64"并删除,否则下一步会遇到错误:

bash 复制代码
aarch64-buildroot-linux-gnu-gcc.br_real: error: unrecognized command line option '-m64'
  1. 执行make & main install
bash 复制代码
openssl-3.3.0/build$ make & make install
  1. install路径下就是我们编译完的结果
bash 复制代码
openssl-3.3.0/build$ tree -L 2 install
install
├── bin
│   ├── c_rehash
│   └── openssl
├── include
│   └── openssl
├── lib64
│   ├── cmake
│   ├── engines-3
│   ├── libcrypto.a
│   ├── libcrypto.so -> libcrypto.so.3
│   ├── libcrypto.so.3
│   ├── libssl.a
│   ├── libssl.so -> libssl.so.3
│   ├── libssl.so.3
│   ├── ossl-modules
│   └── pkgconfig
├── share
│   ├── doc
│   └── man
└── ssl
    ├── certs
    ├── ct_log_list.cnf
    ├── ct_log_list.cnf.dist
    ├── misc
    ├── openssl.cnf
    ├── openssl.cnf.dist
    └── private

15 directories, 12 files
相关推荐
一个人旅程~2 天前
如何用命令行把win10/win11设置为长期暂停更新?
linux·windows·经验分享·电脑
Factory_Audit3 天前
亚马逊社会责任验厂审核标准及注意事项
大数据·经验分享
江南小书生3 天前
制造业系统赋能成熟度自测表(实操版)
经验分享·非标制造
三流架构师3 天前
述职报告资源合集
经验分享
徐先生 @_@|||3 天前
时间序列异常检测框架CrossAD论文阅读
经验分享·python·机器学习
LaughingZhu3 天前
Product Hunt 每日热榜 | 2026-02-25
数据库·人工智能·经验分享·神经网络·chatgpt
中屹指纹浏览器3 天前
2026 硬核技术实践:浏览器指纹生成算法与风控逆向对抗
经验分享·笔记
给老吕螺丝3 天前
提升国内访问GitHub稳定性的解决方案:Steamcommunity 302工具详解 (Ver.13.0.05+)
经验分享·github
智者知已应修善业3 天前
【查找指定字符串首位置与数量不区分大小写完整匹配】2025-5-3
c语言·c++·经验分享·笔记·算法
三水不滴3 天前
利用SpringCloud Gateway 重试 + 降级解决第三方接口频繁超时问题,提升性能
经验分享·笔记·后端·spring·spring cloud·gateway