Ubuntu18.04交叉编译openssl-1.0.1f

目录

源码下载地址:

openssl

解压:

执行配置生成Makefile:

修改Makefile文件

编译

安装


源码下载地址:

openssl

此处使用的是openssl-1.0.1f.tar.gz

解压:

$tar -zxvf openssl-1.0.1f.tar.gz 
$cd openssl-1.0.1f/

执行配置生成Makefile:

$./config no-asm shared --prefix=$PWD/__install
或者
$./config no-asm shared no-async --prefix=$PWD/__install

参数说明:

no-asm:在交叉编译过程中,不使用汇编代码代码加速编译过程,因为其汇编代码对arm格式是不支持的
shared:生成动态连接库
no-async:交叉编译工具链没有提供GNC C的ucontext库
--prefix=:安装路径

修改Makefile文件

修改生成的Makefile,并且找到有-m64的地方,删除(2处)。

Makefile新加这一行:

CROSS_COMPILE= /opt/ext-toolchain/bin/arm-linux-gnueabihf-


定位到以下行

CC= cc
改成
CC= $(CROSS_COMPILE)gcc

AR=ar $(ARFLAGS) r
RANLIB= /usr/bin/ranlib
改成
AR=$(CROSS_COMPILE)ar $(ARFLAGS) r
RANLIB= $(CROSS_COMPILE)ranlib

编译

make -j4

安装

在执行make install时如果出现下面的错误

cms.pod around line 457: Expected text after =item, not a number

cms.pod around line 461: Expected text after =item, not a number
cms.pod around line 465: Expected text after =item, not a number
cms.pod around line 470: Expected text after =item, not a number
cms.pod around line 474: Expected text after =item, not a number
POD document had syntax errors at /usr/bin/pod2man line 69.

则在root权限下,执行rm -f /usr/bin/pod2man  然后重新make install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值