4

Failing to build OpenSSL for 64bit Android. Here are the steps I've taken:

  1. Downloaded the setenv_android.sh from https://wiki.openssl.org/images/7/70/Setenv-android.sh
  2. Downloaded OpenSSL 1.1.1 from https://www.openssl.org/source/old/1.1.1/openssl-1.1.1.tar.gz
  3. Unpacked the tar file
  4. Modified 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 
  5. Configured the openssl with: ./Configure no-rc5 no-idea no-md2 no-cast linux-aarch64

  6. 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).

2
  • 1
    This build script does not support arm64. Try github.com/noloader/Android-PRNG/blob/master/setenv-android.sh Commented Feb 6, 2019 at 8:21
  • 1
    @AlexCohn thank you so much. Using your script I was able to build correctly. If you'd like to submit as an answer I will accept it. Commented Feb 7, 2019 at 15:29

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

4 Comments

When i execute this script i am getting following error: ERROR: AOSP_STL_LIB is not valid. Please edit this script. And my Path looks like following: AOSP_STL_LIB: /Users/dad/Library/Android/sdk/ndk-bundle/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so Do you know what i have to change to make it work?
@Dariusch, with the current NDK release you can only use llvm-static or llvm-shared, other STL variants have been dropped from NDK. Note that mips and armeabi have been dropped, too.
The link you provided is outdated, is there copy of that?
@support_ms I hope you don't really want to build OpenSSL with an 4-years-old NDK 17. Please see a more up-to-date answer. You can also try ndk-pkg.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.