leenjewel / openssl_for_ios_and_android

OpenSSL Library for iOS and Android
931 stars 320 forks source link

clang70: error: unknown argument: '-mandroid' #35

Open diffstorm opened 6 years ago

diffstorm commented 6 years ago

Hello,

I'm compiling openssl for Android on Linux. I'm getting the following error:

clang70: error: unknown argument: '-mandroid'

I could not find any -mandroid tags in .sh files. How can I remove this from command line? OR Can you share a recent release for android 32 and 64 bit libraries for latest NDK?

/home/reveng/openssl/openssl_for_ios_and_android/tools/armeabi-android-toolchain/bin/arm-linux-androideabi-gcc  -I. -Icrypto/include -Iinclude -I/home/reveng/openssl/openssl_for_ios_and_android/tools/armeabi-android-toolchain/sysroot/usr/include -DZLIB -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSL_PIC -DOPENSSLDIR="\"/home/reveng/openssl/openssl_for_ios_and_android/tools/libs/armeabi/ssl\"" -DENGINESDIR="\"/home/reveng/openssl/openssl_for_ios_and_android/tools/libs/armeabi/lib/engines-1.1\"" -Wall -O3 -pthread -mandroid -fPIC --sysroot=/home/reveng/openssl/openssl_for_ios_and_android/tools/armeabi-android-toolchain/sysroot -Wa,--noexecstack  -fPIC -DOPENSSL_USE_NODELETE -MMD -MF crypto/aes/aes_ecb.d.tmp -MT crypto/aes/aes_ecb.o -c -o crypto/aes/aes_ecb.o crypto/aes/aes_ecb.c
clang70: error: unknown argument: '-mandroid'
make[1]: *** [crypto/aes/aes_cbc.o] Error 1
make[1]: *** Waiting for unfinished jobs....
clang70: error: unknown argument: '-mandroid'
make[1]: *** [crypto/aes/aes_cfb.o] Error 1
clang70: error: unknown argument: '-mandroid'
clang70: error: unknown argument: '-mandroid'
make[1]: *** [crypto/aes/aes_ecb.o] Error 1
make[1]: *** [crypto/aes/aes_core.o] Error 1
wrcgator commented 5 years ago

Anyone resolve this issue?

tmetn commented 5 years ago

following

oncealong commented 5 years ago

latest ndk(r18) compiler tool is clang, and gcc is removed. Now I am finding how to compile openssl with clang too!

AsteriskZuo commented 5 years ago

I had the same question about compile android on mac. I try gcc and clang are error about ‘mandroid’ if [ -z "${CLANG}" ]; then export CC=${NDK_TOOLCHAIN_BASENAME}-gcc export CXX=${NDK_TOOLCHAIN_BASENAME}-g++ else export CC=${NDK_TOOLCHAIN_BASENAME}-clang export CXX=${NDK_TOOLCHAIN_BASENAME}-clang++ fi;

I use clang80. if use old compiler is ok?

AsteriskZuo commented 5 years ago

I use one day. I try to solve this problem. I done. I add code on tools/build-openssl4android.sh "sed -ie 's/-mandroid//g' "Makefile"" I compile is ok.

I use clang compile . add code on tools/_shared.sh "CLANG="TEST"" This is ok.

Look at the branches I fork.

okeyest commented 5 years ago

I dropped the version of the ndk to 14b, which can be compiled complete.