简体   繁体   English

为Android ARMV7编译OpenSSL 1.1.0

[英]Compile OpenSSL 1.1.0 for Android ARMV7

I am trying to compile OpenSSL 1.1.0(k) for Android ARMV7 on an Ubuntu machine. 我正在尝试在Ubuntu机器上为Android ARMV7编译OpenSSL 1.1.0(k)。 But I can only compile for targets android, android-armabi, android64(-aarch64). 但我只能编译目标android,android-armabi,android64(-aarch64)。

What I was trying (in openssl-1.1.0k Folder): 我在尝试(在openssl-1.1.0k文件夹中):

export AR=~/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc-ar
export CC=~/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
export LD=~/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
export RANLIB=~/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc-ranlib
export ANDROIDNDKVER=r11c
export ANDROIDAPI=24
export CROSS_SYSROOT=~/android-ndk-r11c/platforms/android-24/arch-arm64
export ANDROID_DEV=~/android-ndk-r11c/platforms/android-24/arch-arm64/usr/
export SYSROOT=~/android-ndk-r11c/platforms/android-24/arch-arm64/usr/
export PATH=$PATH:~/android-ndk-r11c/platforms/android-24/arch-arm64/usr/

Now when I list targets with 现在当我列出目标时

./Configure LIST

Armv7 is not mentioned. 没有提到Armv7。 I expected a target named android-armv7 like it is when I enter the same commands in a openssl-1.0.2l Directory. 我期待一个名为android-armv7的目标,就像我在openssl-1.0.2l目录中输入相同的命令一样。

What am I missing ? 我错过了什么? Or how can I compile Openssl-1.1.0 in a compatible Version for armv7 Android mobiles ? 或者我如何在armv7 Android手机的兼容版本中编译Openssl-1.1.0?

Also using NDK r18b or android-28 did not do the trick or even to use arch-arm instead of arch-arm64. 使用NDK r18b或android-28也没有做到这一点,甚至没有使用拱臂而不是arch-arm64。

Background: OpenSSL 1.1.0 is required by the Framework I am using (Qt 5.13) now and it works on some mobiles. 背景:我正在使用的框架(Qt 5.13)需要OpenSSL 1.1.0,它适用于某些手机。 Like the HTC 10 (armv8 64-bit) but on LG K7 (armv7 32-bit) and an Amazon Fire Tablet it is not working. 像HTC 10(armv8 64位),但在LG K7(armv7 32位)和亚马逊Fire平板电脑上,它不起作用。

Thanks, 谢谢,

I didn't try with OpenSSL 1.1.0 but I did the same thing with 1.1.1c for Qt 5.12.4 . 我没有尝试使用OpenSSL 1.1.0但我使用1.1.1cQt 5.12.4做了同样的事情。 I used a guide I found to compile it for android, both 32 and 64 bit. 我使用了一个我发现为Android编译它的指南 ,32位和64位。

Also the 32bit is basically android-armeabi so use that for architecture type. 另外32bit基本上是android-armeabi所以用于架构类型。 Also you can find some more info and already compiled libs here . 您还可以在此处找到更多信息和已编译的库。

I tested both 32 and 64bit libs that I compiled using the linked guide and I can say they are working. 我测试了使用链接指南编译的32位和64位库,我可以说它们正在工作。

Also make sure to use newer NDK , based on the code you are using r11c that's a bit too old. 还要确保使用更新的NDK ,基于您使用的r11c代码有点太旧了。 For Qt 5.13.0 you would need at least 19c , so use the same to compile. 对于Qt 5.13.0您至少需要19c ,因此请使用相同的编译。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM