下载最新版本的openssl

git clone https://github.com/openssl/openssl.git

创建编译脚本文件:

#!/bin/bash

# git checkout OpenSSL_1_1_1-stable
# refer to NOTE.ANDROID
export ANDROID_NDK_ROOT=/home/hui/tools/android-ndk/android-ndk-r20b
export SYS_ROOT=${ANDROID_NDK_ROOT}/platforms/android-28/arch-arm/
export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$PATH

export ARCH_FLAGS="-march=armv8-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
export  ARCH_LINK="-march=armv8-a -Wl,--fix-cortex-a8"
export   CPPFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -fdata-sections -fvisibility=hidden -funwind-tables \
                  -fstack-protector -fno-strict-aliasing -finline-limit=64 --sysroot=$SYS_ROOT "
export   CXXFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -fdata-sections -fvisibility=hidden -funwind-tables \
                  -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions --sysroot=$SYS_ROOT "
export     CFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -fdata-sections -fvisibility=hidden -funwind-tables \
                  -fstack-protector -fno-strict-aliasing"

./Configure android-arm64 -D__ANDROID_API__=28 no-shared -no-tests --prefix=`pwd`/install

make -j`nproc`

 

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐