[Interest] Adding OpenSSL Support to Android 6.0 - Provided instructions fail to build

Nuno Santos nunosantos at imaginando.pt
Tue Nov 3 17:53:13 CET 2015


I’m using this script to do the job. alexbbb has made an 

https://github.com/alexbbb/pjsip-android-builder/blob/master/openssl-build <https://github.com/alexbbb/pjsip-android-builder/blob/master/openssl-build>

This is the full output

MACKIE:workspace nsantos$ ./openssl-build.sh ~/android/ndk ~/Downloads/openssl-master 15 armeabi-v7a 4.8 build 
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying c++ runtime headers and libraries...
Copying files to: /tmp/openssl/android-toolchain-arm
Cleaning up...
Done.
-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include
Configuring for android-armv7
    no-deprecated   [default]  OPENSSL_NO_DEPRECATED (skip dir)
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)
    no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
    no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
    no-sctp         [default]  OPENSSL_NO_SCTP (skip dir)
    no-shared       [default] 
    no-ssl-trace    [default]  OPENSSL_NO_SSL_TRACE (skip dir)
    no-store        [experimental] OPENSSL_NO_STORE (skip dir)
    no-unit-test    [default]  OPENSSL_NO_UNIT_TEST (skip dir)
    no-zlib         [default] 
    no-zlib-dynamic [default] 
IsMK1MF=0
CC            =/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc
CFLAG         =-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot=$(CROSS_SYSROOT) -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
EX_LIBS       =-ldl
CPUID_OBJ     =armcap.o armv4cpuid.o
BN_ASM        =bn_asm.o armv4-mont.o armv4-gf2m.o
EC_ASM        =ecp_nistz256.o ecp_nistz256-armv4.o
DES_ENC       =des_enc.o fcrypt_b.o
AES_ENC       =aes_cbc.o aes-armv4.o bsaes-armv7.o aesv8-armx.o
BF_ENC        =bf_enc.o
CAST_ENC      =c_enc.o
RC4_ENC       =rc4_enc.o rc4_skey.o
RC5_ENC       =rc5_enc.o
MD5_OBJ_ASM   =
SHA1_OBJ_ASM  =sha1-armv4-large.o sha256-armv4.o sha512-armv4.o
RMD160_OBJ_ASM=
CMLL_ENC      =camellia.o cmll_misc.o cmll_cbc.o
MODES_OBJ     =ghash-armv4.o ghashv8-armx.o
ENGINES_OBJ   =
PROCESSOR     =
RANLIB        =/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-ranlib
ARFLAGS       =
PERL          =/opt/local/bin/perl5
THIRTY_TWO_BIT mode
DES_UNROLL used
DES_INT used
BN_LLONG mode
RC4 uses uchar
RC4_CHUNK is unsigned long
BF_PTR used

Configured for android-armv7.
making all in crypto...
/opt/local/bin/perl5 ../util/mkbuildinf.pl "/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM" "android-armv7" >buildinf.h
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o cryptlib.o cryptlib.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o mem.o mem.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o mem_dbg.o mem_dbg.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o cversion.o cversion.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o ex_data.o ex_data.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o cpt_err.o cpt_err.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o ebcdic.o ebcdic.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o uid.o uid.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o o_time.o o_time.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o o_str.o o_str.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o o_dir.o o_dir.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o thr_id.o thr_id.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o lock.o lock.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o fips_ers.o fips_ers.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o o_init.o o_init.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o o_fips.o o_fips.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-gcc -I. -I.. -I../include -Iinclude  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -fPIC --sysroot= -Wa,--noexecstack -Wall -O3 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM  -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include  -c -o sec_mem.o sec_mem.c
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-ar  r ../libcrypto.a cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o fips_ers.o o_init.o o_fips.o sec_mem.o armcap.o armv4cpuid.o
/tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-ar: ../libcrypto.a: Malformed archive


> On 03 Nov 2015, at 16:45, Elvis Stansvik <elvstone at gmail.com> wrote:
> 
> Den 3 nov 2015 5:31 em skrev "Nuno Santos" <nunosantos at imaginando.pt <mailto:nunosantos at imaginando.pt>>:
> >
> > I’m having issues compiling openssl on Mac OSX El Capitain. 
> >
> > The following command always terminates with “Malformed archive”
> >
> > /tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-ar  r ../libcrypto.a cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o fips_ers.o o_init.o o_fips.o sec_mem.o armcap.o armv4cpuid.o
> > /tmp/openssl/android-toolchain-arm/bin/arm-linux-androideabi-ar: ../libcrypto.a: Malformed archive
> >
> > Does anyone experienced this lately? 
> 
> Are you sure that library was built for the right architecture?
> 
> Elvis
> >
> >> On 03 Nov 2015, at 15:51, Nuno Santos <nunosantos at imaginando.pt <mailto:nunosantos at imaginando.pt>> wrote:
> >>
> >> You were right about the export.
> >>
> >> Using export CC and export AR does the trick, however it still doesn’t find stdlib.h without passing -I/Users/nsantos/android/ndk/platforms/android-9/arch-arm/usr/include
> >>
> >>
> >>> On 03 Nov 2015, at 13:35, Elvis Stansvik <elvstone at gmail.com <mailto:elvstone at gmail.com>> wrote:
> >>>
> >>> I have no experience with cross building, but just to make sure: Are you exporting these variables? Otherwise configure/make will not pick them up.
> >>
> >>
> >> _______________________________________________
> >> Interest mailing list
> >> Interest at qt-project.org <mailto:Interest at qt-project.org>
> >> http://lists.qt-project.org/mailman/listinfo/interest <http://lists.qt-project.org/mailman/listinfo/interest>
> >
> >
> >
> > _______________________________________________
> > Interest mailing list
> > Interest at qt-project.org <mailto:Interest at qt-project.org>
> > http://lists.qt-project.org/mailman/listinfo/interest <http://lists.qt-project.org/mailman/listinfo/interest>
> >
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151103/6f0d5196/attachment.html>


More information about the Interest mailing list