编译环境
Ubuntu 16.04 x86_64
arm-xm-linux.tar.gz
下载openssl源码
$ wget https://www.openssl.org/source/openssl-1.1.0d.tar.gz
解压源码
$ tar xvf openssl-1.1.0d.tar.gz
执行Configure脚本
$ cd openssl
$ ./Configure linux-generic32 \
no-shared \
no-asm \
no-async \
--prefix=/your/install/path/xm/openssl_1.1.0d \
--cross-compile-prefix=arm-xm-linux-
-
linux-generic32 指定目标平台类型,
-
no-shared 生成静态库,如果要生成动态库,则使用
-shared
选项 -
no-asm 在交叉编译过程中不使用汇编代码代码加速编译过程
-
–prefix 指定安装目录
-
–cross-compile-prefix 指定交叉编译器名字前缀
-
no-async arm-xm-linux的machine定义
为arm-xm-linux-ulibcgnueabi
,没有提供GNU C的ucontext库所以需要添加此选项,否则编译会报错
./libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
./libcrypto.so: undefined reference to `getcontext'
./libcrypto.so: undefined reference to `setcontext'
./libcrypto.so: undefined reference to `makecontext'
编译安装
make
make install