编译环境说明
系统: deepin 15.11
平台: x86_64
交叉编译器:swgcc530-sw6-cross_2018-7-4
交叉编译环境搭建
交叉编译环境搭建见在x86_64平台上搭建申威alpha交叉编译环境
下载openssl源代码
安装git
sudo apt install git
签出openssl
源代码
git clone https://github.com/openssl/openssl.git
交叉编译openssl
以OpenSSL_1_1_1-stable
版示例交叉编译openssl
。
# 进入源代码目录
cd /path/to/openssl
# 切换到稳定版分支
git checkout OpenSSL_1_1_1-stable
# 设置编译环境变量
export LD_LIBRARY_PATH=/usr/sw/swgcc530-sw6-cross/usr/lib:$LD_LIBRARY_PATH
export CROSS_COMPILE=sw_64sw6-sunway-linux-gnu-
# 配置安装目录及编译参数
./Configure linux-alpha-gcc no-asm --prefix=/opt/sw/openssl/openssl-1.1.1-stable --openssldir=/opt/sw/openssl/openssl-1.1.1-stable/ssl
# 编译、安装
make CROSS_COMPILE=sw_64sw6-sunway-linux-gnu- -j4
make install