How to cross-compile OpenSSL for ARM

In a nutshell:
/opt/arm% wget http://www.openssl.org/source/ openssl-0.9.7d.tar.gz && tar xvzf openssl-0.9.7d.tar.gz && cd openssl-0.9.7d
/opt/arm/openssl-0.9.7d% ./Configure linux-elf- arm --prefix=/usr
Then set your environment so a gcc 3.3-based ARM crosscompiler (OpenZaurus 3.3.1 in /usr/local/ arm/3.3 will be fine) is in your $PATH, and patch your Makefile to use this cross-compiler (the patch also contains a linking instruction to libdl, needed to get the openssl binary):
/opt/arm/openssl-0.9.7d% export PATH=/usr/local/ arm/3.3/bin:$PATH
/opt/arm/openssl-0.9.7d% wget -N http://people.via.ecp.fr/~clem/nist/opensslForARM.Makefile.patch && patch -p1 < opensslFor ARM.Makefile.patch
You can compile it now! (after setting DISTCC to /usr/bin/distcc, DISTCC_HOSTS to your distcc hosts, and using make -j DISTCC_HOSTS*2, for example, instead of make to distribute compiling if you want and can):
/opt/arm/openssl-0.9.7d% make && make build-shared
You can do the following if you want (that way /opt/arm/openssl will be your local OpenSSL dir, its includes will be in include and its libs in lib):
/opt/arm/openssl-0.9.7d% mkdir lib && cd lib && ln -s ../libcrypto* ../libssl* . && cd ../.. && ln -s openssl-0.9.7d openssl
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值