willyliu / build-openssl-android

Builds openssl 1.1.0h with android ndk r17.
25 stars 22 forks source link

Getting "clang80: error: unknown argument: '-mandroid'" when building with NDK 19 #5

Open david-hoze opened 5 years ago

david-hoze commented 5 years ago

Hi, great work! I'm trying to compile with the latest NDK, but getting this (including only last lines):

make depend && make _all
make[1]: Entering directory `/home/david/dev/android/App/build-openssl-android/openssl-1.1.0h'
make[1]: Leaving directory `/home/david/dev/android/App/build-openssl-android/openssl-1.1.0h'
make[1]: Entering directory `/home/david/dev/android/App/build-openssl-android/openssl-1.1.0h'
arm-linux-androideabi-gcc  -I. -Icrypto/include -Iinclude -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -D__ANDROID_API__=21 -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -Wall -O3 -pthread -mandroid -fPIC --sysroot=/tmp/android-toolchain/sysroot -Wa,--noexecstack  -fPIC -DOPENSSL_USE_NODELETE -c -o crypto/aes/aes_cbc.o crypto/aes/aes_cbc.c
clang80: error: unknown argument: '-mandroid'
make[1]: *** [crypto/aes/aes_cbc.o] Error 1
make[1]: Leaving directory `/home/david/dev/android/App/build-openssl-android/openssl-1.1.0h'
make: *** [all] Error 2
Error executing make for platform:armeabi

Also happens with NDK 18. Do you have any idea how I can fix this? I need to use the latest NDK in my app, so it's critical for me.

Thanks in advance.

manang commented 5 years ago

did you solve this issue?

david-hoze commented 5 years ago

Hi, no, but I switched to https://github.com/damaex/android-lib and it's working fine with NDK 19