ekke / android-openssl-qt

scripts to generate openssl .so to be used from Qt Android Projects
50 stars 18 forks source link

clang: error: unknown argument: '-mandroid' #9

Closed akontsevich closed 5 years ago

akontsevich commented 5 years ago

I'm trying to run the script in Linux. My NDK Version: 18.1.5063045

export ANDROID_NDK_ROOT=~/Android/Sdk/ndk-bundle/
export OPENSSL_VERSION="openssl-1.0.2o"
./build-all-arch.sh

But got an error:

make[1]: Entering directory '.../android-openssl-qt/openssl-1.0.2o/crypto'
clang: error: unknown argument: '-mandroid'
clang: error: unknown argument: '-mandroid'
make[1]: *** [Makefile:137: local_depend] Error 1
make[1]: Leaving directory '.../android-openssl-qt/openssl-1.0.2o/crypto'
make: *** [Makefile:484: depend] Error 1

Any chance to make it work in Linux or it works only under Mac? Script proposed on qt.io a little bit tricky. Thanks!

ekke commented 5 years ago

response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} AFAIK you should use NDK r10e for openssl even if you are using r18b for yor apps.  Von: notifications@github.comGesendet: 18. Dezember 2018 13:01An: android-openssl-qt@noreply.github.comAntworten: reply@reply.github.comCc: subscribed@noreply.github.comBetreff: [ekke/android-openssl-qt] clang: error: unknown argument: '-mandroid' (#9) I'm trying to run the script in Linux. My NDK Version: 18.1.5063045

export ANDROID_NDK_ROOT=~/Android/Sdk/ndk-bundle/ export OPENSSL_VERSION="openssl-1.0.2o" ./build-all-arch.sh

But got an error: make[1]: Entering directory '.../android-openssl-qt/openssl-1.0.2o/crypto' clang: error: unknown argument: '-mandroid' clang: error: unknown argument: '-mandroid' make[1]: [Makefile:137: local_depend] Error 1 make[1]: Leaving directory '.../android-openssl-qt/openssl-1.0.2o/crypto' make: [Makefile:484: depend] Error 1

Any chance to make it work in Linux or it works only under Mac? Script proposed on qt.io a little bit tricky. Thanks!

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.

akontsevich commented 5 years ago

I see. Downloaded android-ndk-r10e-linux-x86_64.zip - builds fine for armeabi-v7a and x86.

akontsevich commented 5 years ago

Added arm64-v8a to the list in script: archs=(arm64-v8a armeabi-v7a x86 x86_64), got error:

Error: Failed to find aarch64-linux-android-randlib. Please edit this script.
~/Android/Sdk/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-randlib

for both r10e and r18b. How to fix?

akontsevich commented 5 years ago

Found working script: https://github.com/couchbaselabs/couchbase-lite-libcrypto/issues/5 - works fine with any NDK. Will fork it.

ekke commented 5 years ago

thx. will wat5ch your fork and try next month.

akontsevich commented 5 years ago

https://github.com/akontsevich/openssl-android-build - fixed scripts

udiakasnuke commented 3 years ago

@akontsevich - Just wanted to confirm.. I am using your above repo for 1.0.2u version of openssl and looks like it works like a charm - i am able to create the libraries for arm64-v8a, armeabi-v7a and x86.

Do u have anything for 1.1.1i version ??

ekke commented 3 years ago

@udiakasnuke you should now use the KDAB project: https://github.com/KDAB/android_openssl I stopped developing on my project because of the great KDAB repo

udiakasnuke commented 3 years ago

@ekke - I came around this, but documentation is lacking in KDAB... I am not sure how to build openssl libraries for android using that. Can you please point me?? I need to build libraries for both 1.0.2u and 1.1.1i., but it still hope whatever i did using your project for 1.0.2u was right :) ... Thanks!!

akontsevich commented 3 years ago

Do u have anything for 1.1.1i version ??

Change version in scripts to 1.1.1i - should work. I think README is clear enough there.

udiakasnuke commented 3 years ago

@akontsevich - Changing the version to 1.1.1i and running ./generate-headers-mac.sh resulted in make: *** No rule to make target `clean'. Stop.

looks like there is no makeFile.... Can i workaround this somehow?? please guide..

akontsevich commented 3 years ago

Sorry, won't help you on mac currently.

udiakasnuke commented 3 years ago

@akontsevich - :( . Looks like the problem was in "make clean" since MakeFile is not present in 1.1.1i . But when i comment that even then its failing looks like this time its Configure command, openssl is asking me to choose some compiler.

Is there some other repo which i can follow along ?? Please suggest .

akontsevich commented 3 years ago

But why do You need it as recent Qt and QtC versions ship built-in openssl in installer?

udiakasnuke commented 3 years ago

eventually i need binaries and headers for 1.1.1i which i can use within my application..... but due to security reasons didn't want to integrate it directly.... Do you know or point me to someplace such that i can built it locally and then use?? Alternatively you said that these openssl binaries comes along with Qt, maybe i am not aware of that , how do i access those i.e 1.1.1i's ones. ??

akontsevich commented 3 years ago

Run latest installer and You'll see:

image

I think You may find build scripts there as well.

udiakasnuke commented 3 years ago
Screenshot 2020-12-23 at 11 39 40 PM

Can't see any option for OpenSSL Toolkit!!

akontsevich commented 3 years ago

Then on mac it still missed.

udiakasnuke commented 3 years ago

@akontsevich - any workaround ?? please suggest. Your script worked fine for me for 1.0.2u but i need 1.1.1i as well.. anyway i can achieve . Can you point me to something?

akontsevich commented 3 years ago

Sorry, did not build 1.1 yet.

udiakasnuke commented 3 years ago

Looks like i am stuck now... need to migrate to 1.1.1.. but i am not able to find any proper documentation to do so :(