ekke / android-openssl-qt Goto Github PK
View Code? Open in Web Editor NEWscripts to generate openssl .so to be used from Qt Android Projects
scripts to generate openssl .so to be used from Qt Android Projects
Hello
Thanks for the awesome work
the files generated and i copied them into my project but app crash when start!
i didnt change any configuration , just i changed the location of NDK
also i am using QR 5.9 Armv7
any ideas?
Thanks
Sorry i'am a newbie
How do i put this to work on windows.
I m getting an error about .so missing.
thank you
This is terminal output:
`
ismails-MacBook-Pro:android-openssl-qt-master ismail$ chmod 755 ./build-all-arch.sh
ismails-MacBook-Pro:android-openssl-qt-master ismail$ chmod 755 ./setenv-android-mod.sh
ismails-MacBook-Pro:android-openssl-qt-master ismail$ export ANDROID_NDK_ROOT=/Users/ismail/Documents/Android/android-ndk-r10e
ismails-MacBook-Pro:android-openssl-qt-master ismail$ export OPENSSL_VERSION="openssl-1.1.1b"
ismails-MacBook-Pro:android-openssl-qt-master ismail$ ./build-all-arch.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8021k 100 8021k 0 0 1824k 0 0:00:04 0:00:04 --:--:-- 1855k
Error: FIPS_SIG does not specify incore module. Please edit this script.
CHECK_CROSS_COMPILER = arm-linux-androideabi-
ANDROID_NDK_ROOT: /Users/ismail/Documents/Android/android-ndk-r10e
ANDROID_ARCH: arch-arm
ANDROID_EABI: arm-linux-androideabi-4.9
ANDROID_API: android-21
ANDROID_SYSROOT: /Users/ismail/Documents/Android/android-ndk-r10e/platforms/android-21/arch-arm
ANDROID_TOOLCHAIN: /Users/ismail/Documents/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin
FIPS_SIG:
CROSS_COMPILE: arm-linux-androideabi-
ANDROID_DEV: /Users/ismail/Documents/Android/android-ndk-r10e/platforms/android-21/arch-arm/usr
CROSS COMPILE ENV : arm-linux-androideabi-
Can't open Makefile.org: No such file or directory.
***** Deprecated options: no-ssl2
Configuring OpenSSL version 1.1.1b (0x1010102fL) for android-armv7
Using os-specific seed configuration
Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]
pick os/compiler from:
BS2000-OSD BSD-generic32 BSD-generic64 BSD-ia64 BSD-sparc64 BSD-sparcv8
BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-i386 Cygwin-i486 Cygwin-i586
Cygwin-i686 Cygwin-x86 Cygwin-x86_64 DJGPP MPE/iX-gcc UEFI UWIN VC-CE VC-WIN32
VC-WIN32-ARM VC-WIN32-ONECORE VC-WIN64-ARM VC-WIN64A VC-WIN64A-ONECORE
VC-WIN64A-masm VC-WIN64I aix-cc aix-gcc aix64-cc aix64-gcc android-arm
android-arm64 android-armeabi android-mips android-mips64 android-x86
android-x86_64 android64 android64-aarch64 android64-mips64 android64-x86_64
bsdi-elf-gcc cc darwin-i386-cc darwin-ppc-cc darwin64-ppc-cc
darwin64-x86_64-cc gcc haiku-x86 haiku-x86_64 hpux-ia64-cc hpux-ia64-gcc
hpux-parisc-cc hpux-parisc-gcc hpux-parisc1_1-cc hpux-parisc1_1-gcc
hpux64-ia64-cc hpux64-ia64-gcc hpux64-parisc2-cc hpux64-parisc2-gcc hurd-x86
ios-cross ios-xcrun ios64-cross ios64-xcrun iossimulator-xcrun iphoneos-cross
irix-mips3-cc irix-mips3-gcc irix64-mips4-cc irix64-mips4-gcc linux-aarch64
linux-alpha-gcc linux-aout linux-arm64ilp32 linux-armv4 linux-c64xplus
linux-elf linux-generic32 linux-generic64 linux-ia64 linux-mips32 linux-mips64
linux-ppc linux-ppc64 linux-ppc64le linux-sparcv8 linux-sparcv9 linux-x32
linux-x86 linux-x86-clang linux-x86_64 linux-x86_64-clang linux32-s390x
linux64-mips64 linux64-s390x linux64-sparcv9 mingw mingw64 nextstep
nextstep3.3 sco5-cc sco5-gcc solaris-sparcv7-cc solaris-sparcv7-gcc
solaris-sparcv8-cc solaris-sparcv8-gcc solaris-sparcv9-cc solaris-sparcv9-gcc
solaris-x86-gcc solaris64-sparcv9-cc solaris64-sparcv9-gcc solaris64-x86_64-cc
solaris64-x86_64-gcc tru64-alpha-cc tru64-alpha-gcc uClinux-dist
uClinux-dist64 unixware-2.0 unixware-2.1 unixware-7 unixware-7-gcc vms-alpha
vms-alpha-p32 vms-alpha-p64 vms-ia64 vms-ia64-p32 vms-ia64-p64 vos-gcc
vxworks-mips vxworks-ppc405 vxworks-ppc60x vxworks-ppc750 vxworks-ppc750-debug
vxworks-ppc860 vxworks-ppcgen vxworks-simlinux
NOTE: If in doubt, on Unix-ish systems use './config'.
`
there is only armeabi-v7a folder in prebuild directory and it's empty. Except this, prebuild directory is completely empty.
Why? Is this issue about ssl version?
Thanks.
EDIT: I tried with ssl version 1.0.2r and it's worked and .so files generated for x86 and armeabi-v7 but there is not arm64. Is it normal?
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!
Some feedback when adding support for arm64-v8a.
I first modified build-all-arch.sh
and set archs=(armeabi-v7a x86 arm64-v8a)
In setenv-android-mod.sh
, I had to replace randlib
with ranlib
(a typo I guess?)
In android-openssl.pri
I would suggest to use
$$PWD/../../android-openssl-qt/prebuilt/$$ANDROID_TARGET_ARCH/libcrypto.so
Note also that Qt5.13 will be packaged with OpenSSL1.1 afaik
Building OpenSSL on macOS is a challenge!! One day wasted and counting...
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_ctrl
I got past the '-mandroid' issue by removing it from the Makefile
Follow this first: Qt 5.9 Adding OpenSSL Support for Android
File: Setenv-android.sh
_ANDROID_NDK="android-ndk-r9"
_ANDROID_EABI="arm-linux-androideabi-4.9"
# _ANDROID_ARCH=arch-x86
_ANDROID_ARCH=arch-arm
Example:
#DO_GNU_SO=$(CALC_VERSIONS); \ # SHLIB=lib$(LIBNAME).so; \ # SHLIB_SUFFIX=; \ # ALLSYMSFLAGS='-Wl,--whole-archive'; \ # NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ # SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" # https://stackoverflow.com/questions/4580789/ld-unknown-option-soname-on-os-x O_GNU_SO=$(CALC_VERSIONS); \ SHLIB=lib$(LIBNAME).so; \ SHLIB_SUFFIX=; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-install_name,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
./Configure shared android
Remove '''CFLAG''' option '''-mandroid''' from Makefile
Build
make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER="
Resulting error: syntax error near unexpected token `;'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../libcrypto.a(v3_asid.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../libcrypto.a(v3_addr.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../libcrypto.a(cms_cd.o) has no symbols if [ -n "libcrypto.so.1.0.0 libssl.so.1.0.0" ]; then \ (cd ..; /Applications/Xcode.app/Contents/Developer/usr/bin/make libcrypto.so.1.0.0); \ fi [ -z "" ] || gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -I/include -B/lib -O3 -fomit-frame-pointer -Wall -Iinclude \ -DFINGERPRINT_PREMAIN_DSO_LOAD -o fips_premain_dso \ fips_premain.c fipscanister.o \ libcrypto.a -ldl /bin/sh: -c: line 0: syntax error near unexpected token `;' /bin/sh: -c: line 0: `; SHOBJECTS="libcrypto.a "; ( :; LIBDEPS="${LIBDEPS:--L. -ldl}"; SHAREDCMD="${SHAREDCMD:-gcc}"; SHAREDFLAGS="${SHAREDFLAGS:--fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -I/include -B/lib -O3 -fomit-frame-pointer -Wall }"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${SHAREDCMD} ${SHAREDFLAGS} -o $SHLIB$SHLIB_SOVER$SHLIB_SUFFIX $ALLSYMSFLAGS $SHOBJECTS $NOALLSYMSFLAGS $LIBDEPS ) && if [ -n "$INHIBIT_SYMLINKS" ]; then :; else prev=$SHLIB$SHLIB_SOVER$SHLIB_SUFFIX; if [ -n "$SHLIB_COMPAT" ]; then for x in $SHLIB_COMPAT; do ( :; rm -f $SHLIB$x$SHLIB_SUFFIX; ln -s $prev $SHLIB$x$SHLIB_SUFFIX ); prev=$SHLIB$x$SHLIB_SUFFIX; done; fi; if [ -n "$SHLIB_SOVER" ]; then ( :; rm -f $SHLIB$SHLIB_SUFFIX; ln -s $prev $SHLIB$SHLIB_SUFFIX ); fi; fi'
I need to build boih arm7 and x86 so I can test in Genymotion emulator.
@ekke @mabedMRD @alexgarret @machinekoder Qt guys? Any tips or suggestions are greatly appreciated.
^
compilation terminated.
mem.c:59:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
mem_clr.c:60:20: fatal error: string.h: No such file or directory
#include <string.h>
^
compilation terminated.
mem_dbg.c:112:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
In file included from cversion.c:59:0:
cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory
^
compilation terminated.
In file included from ex_data.c:141:0:
cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory
^
compilation terminated.
cpt_err.c:62:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
In file included from uid.c:56:0:
../include/openssl/crypto.h:120:21: fatal error: stdlib.h: No such file or directory
^
compilation terminated.
o_time.c:65:20: fatal error: string.h: No such file or directory
#include <string.h>
^
compilation terminated.
o_str.c:60:19: fatal error: ctype.h: No such file or directory
#include <ctype.h>
^
compilation terminated.
o_dir.c:60:19: fatal error: errno.h: No such file or directory
#include <errno.h>
^
compilation terminated.
In file included from o_fips.c:59:0:
cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory
^
compilation terminated.
In file included from o_init.c:56:0:
../e_os.h:468:28: fatal error: unistd.h: No such file or directory
^
compilation terminated.
make[1]: *** [local_depend] Error 1
make: *** [depend] Error 1
I am on MACOSX High sierra.
any Idea ?
Thanks for the script. Unfortunately, building fails with OpenSSL version 1.1.0e
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.