Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building OpenSSL for android
Qt 6.11 is out! See what's new in the release blog

Building OpenSSL for android

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 4.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    WayneGoetz
    wrote on last edited by
    #1

    Hi,

    I am trying to follow: http://doc.qt.io/qt-5/opensslsupport.html
    But when doing

    make build_libs
    

    I get:

    cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory
    

    Is there an newer version of the documentation?

    1 Reply Last reply
    0
    • W Offline
      W Offline
      WayneGoetz
      wrote on last edited by
      #2

      Well, I used the prebuild libraries from: https://github.com/emileb/OpenSSL-for-Android-Prebuilt.git

      1 Reply Last reply
      1
      • T Offline
        T Offline
        th.thielemann
        wrote on last edited by
        #3

        For linux on arm I fixed this. Fix was required because armv7 was not supported by openssl Configure.
        First I changed Configure file:
        Searched for line starting with "linux-armv4" and included my own configuration line here.
        "linux-armv7", "gcc: -DTERMIO -D__ARM_ARCH_7A__ -O3 -march=armv7-a -I$(SYSROOT)/usr/include/ -B$(SYSROOT)/lib -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.$(SHLIB_MAJOR).$(SHLIB_MINOR)",

        The line is references in the following build steps:
        Adapt the make to your environment.

        ToolChainName=arm-linux-gnueabihf
        ToolChainInstallDirectory=/myfolder/linux-devkit/sysroots/i686-arago-linux/usr/bin
        export SYSROOT=/myfolder/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi
        export CC="$ToolChainInstallDirectory/$ToolChainName-gcc -march=armv7-a --sysroot=$SYSROOT"
        make depend
        make build_libs
        
        
        1 Reply Last reply
        0
        • EddieE Offline
          EddieE Offline
          Eddie
          wrote on last edited by Eddie
          #4

          Personally I am paranoid about packaging prebuilt OpenSSL libs I find laying bout the Internet in my customer's apps. I will NOT use them.

          Reverting to use Android NDK r10e solved build problems I had on macOS.

          This script builds arm, arm7, and x86. I could not get Ubuntu 18.04 build of OpenSSL to work even with r10e.

          • https://github.com/esutton/android-openssl

          FIle: myproject.pro

          android {
              # Copy build-output of https://github.com/esutton/android-openssl
              # to /platform/android/lib/openssl/
              # Android >= 6.0 requires apps to install their own libcrypto.so and libssl.so
              equals(ANDROID_TARGET_ARCH, armeabi-v7a) {
                  ANDROID_EXTRA_LIBS += $$files($${PWD}/platform/android/lib/openssl/arch-armeabi-v7a/*.so)
              }
              equals(ANDROID_TARGET_ARCH, x86)  {
                  ANDROID_EXTRA_LIBS += $$files($${PWD}/platform/android/lib/openssl/arch-x86/*.so)
              }
          }
          
          
          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved