Details

    • Type: Bug Bug
    • Status: Reported
    • Priority: P3: Somewhat important P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.8.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Qt 5.8
      OSX 10.11.6

      Description

      followed the description here: http://doc.qt.io/qt-5/opensslsupport.html

      downloaded and extracted openssl-1.0.2k
      Open Terminal

      cd <my-path>/openssl-1.0.2k
      export ANDROID_NDK_ROOT=<my-path>/android-ndk-r10e
      export CC=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc
      export AR=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar
      ANDROID_DEV=$ANDROID_NDK_ROOT/platforms/android-21/arch-arm/usr
      
      ./Configure shared android-armv7
      

      Configuration was done
      then opened Makefile and replaced values for LIBNAME

      make build_libs
      

      now getting error:

      Configured for android-armv7.
      ekkes-MBP:openssl-1.0.2k admin$ make build_libs
      making all in crypto...
      /usr/bin/perl ../util/mkbuildinf.pl "gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -I/include -B/lib -O3 -fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM" "android-armv7" >buildinf.h
      gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -I/include -B/lib -O3 -fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM   -c -o cryptlib.o cryptlib.c
      clang: error: unknown argument: '-mandroid'
      make[1]: *** [cryptlib.o] Error 1
      make: *** [build_crypto] Error 1
      
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        Ekkehard added a comment -

        also tried with openssl-1.0.2h - same error

        found some infos about unknown argument: '-mandroid':
        https://github.com/openssl/openssl/issues/1531
        https://bruteforce.gr/bypassing-clang-error-unknown-argument.html
        so I tried adding a first line

        ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
        

        getting same error
        also: why does this error comes up ? if I understood right shouldn't happen with gcc

        Show
        Ekkehard added a comment - also tried with openssl-1.0.2h - same error found some infos about unknown argument: '-mandroid': https://github.com/openssl/openssl/issues/1531 https://bruteforce.gr/bypassing-clang-error-unknown-argument.html so I tried adding a first line ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in- future getting same error also: why does this error comes up ? if I understood right shouldn't happen with gcc
        Hide
        Ekkehard added a comment -

        Have some projects where I'm only using http and they're running well on Android7 using Qt 5.7
        With 5.8 same project crashes because of missing openssl
        Is this expected with 5.8 or should I open a bugreport ?

        Show
        Ekkehard added a comment - Have some projects where I'm only using http and they're running well on Android7 using Qt 5.7 With 5.8 same project crashes because of missing openssl Is this expected with 5.8 or should I open a bugreport ?
        Hide
        Timur Pocheptsov added a comment -

        QNAM is initializing some SSL structures even for 'http' requests both in 5.7 and 5.8, so this is not something new (what can be new though - we have more OpenSSL API calls that result in a crash). There is some suggestion here: https://bugreports.qt.io/browse/QTBUG-57922 (the last comment) + you can build Qt without OpenSSL at all if you don't need it (this will essentially exclude SSL related code). I suggest we close this bug-report.

        Show
        Timur Pocheptsov added a comment - QNAM is initializing some SSL structures even for 'http' requests both in 5.7 and 5.8, so this is not something new (what can be new though - we have more OpenSSL API calls that result in a crash). There is some suggestion here: https://bugreports.qt.io/browse/QTBUG-57922 (the last comment) + you can build Qt without OpenSSL at all if you don't need it (this will essentially exclude SSL related code). I suggest we close this bug-report.
        Hide
        Ekkehard added a comment -

        I also have projects with https and Android 7
        So I need openssl there
        But adding openssl as described in the docs isn't working for me on OSX
        always getting error: unknown argument: '-mandroid'

        Show
        Ekkehard added a comment - I also have projects with https and Android 7 So I need openssl there But adding openssl as described in the docs isn't working for me on OSX always getting error: unknown argument: '-mandroid'
        Hide
        Ekkehard added a comment -

        yes - we can close this one - I added comment to 57922.

        Show
        Ekkehard added a comment - yes - we can close this one - I added comment to 57922.
        Hide
        Ekkehard added a comment - - edited

        finally did it the secure way and built from openssl sources on OSX

        used the .sh scripts from https://github.com/orangefour/android-openssl

        in Terminal:

        cd <path/to/scripts>
        chmod 755 ./build-all-arch.sh
        chmod 755 ./setenv-android-mod.sh
        export ANDROID_NDK_ROOT=/daten/_android/android-ndk-r10e
        export OPENSSL_VERSION="openssl-1.0.2k"
        ./build-all-arch.sh
        

        inside projects adding a .pri pointing to the .so files:

        android {
          ANDROID_EXTRA_LIBS += $$PWD/my/path/to/prebuilt/armeabi-v7a/libcrypto.so
          ANDROID_EXTRA_LIBS += $$PWD/my/path/to/android-openssl/prebuilt/armeabi-v7a/libssl.so
        }
        

        here's my github repo: https://github.com/ekke/android-openssl-qt

        will blog about in detail

        Show
        Ekkehard added a comment - - edited finally did it the secure way and built from openssl sources on OSX used the .sh scripts from https://github.com/orangefour/android-openssl in Terminal: cd <path/to/scripts> chmod 755 ./build-all-arch.sh chmod 755 ./setenv-android-mod.sh export ANDROID_NDK_ROOT=/daten/_android/android-ndk-r10e export OPENSSL_VERSION= "openssl-1.0.2k" ./build-all-arch.sh inside projects adding a .pri pointing to the .so files: android { ANDROID_EXTRA_LIBS += $$PWD/my/path/to/prebuilt/armeabi-v7a/libcrypto.so ANDROID_EXTRA_LIBS += $$PWD/my/path/to/android-openssl/prebuilt/armeabi-v7a/libssl.so } here's my github repo: https://github.com/ekke/android-openssl-qt will blog about in detail

          People

          • Assignee:
            Qt Graphics and Multimedia Team
            Reporter:
            Ekkehard
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:

              Gerrit Reviews

              There are no open Gerrit changes