Failing to build OpenSSL for 64bit Android. Here are the steps I've taken:
setenv_android.sh
from https://wiki.openssl.org/images/7/70/Setenv-android.shModified the setenv_android script so that running it produced this output:
ANDROID_NDK_ROOT: /Users/spartygw/android-ndk-r17
ANDROID_ARCH: arch-arm64
ANDROID_EABI: aarch64-linux-android-4.9
ANDROID_API: android-22
ANDROID_SYSROOT: /Users/spartygw/android-ndk-r17/platforms/android-22/arch-arm64
ANDROID_TOOLCHAIN: /Users/spartygw/android-ndk-r17/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin
FIPS_SIG:
CROSS_COMPILE: aarch64-linux-android-
ANDROID_DEV: /Users/spartygw/android-ndk-r17/platforms/android-22/arch-arm64/usr
Configured the openssl with: ./Configure no-rc5 no-idea no-md2 no-cast linux-aarch64
Ran make depend; make
Output:
In file included from crypto/aes/aesv8-armx.S:1:
crypto/arm_arch.h:55:6: error: "unsupported ARM architecture"
# error "unsupported ARM architecture"
^
1 error generated.
make[1]: *** [crypto/aes/aesv8-armx.o] Error 1
make: *** [all] Error 2
This writeup makes it sound like I ran into this problem and stopped. I assure you I've spent a complete workday trying various things and googling to no avail. I don't want to litter the question with junk that I tried (passing in different ARM_ARCH values, trying other versions of openSSL, trying different NDKs).
The scripts and examples on OpenSSL Wiki are badly outdated. The specific build script does not support arm64.
Luckily, GitHub comes to rescue: try https://github.com/noloader/Android-PRNG/blob/master/setenv-android.sh.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With