Hi Nick,
I did a few tests with my application and got some good results and one smaller issue :-) .
To test some stuff I did the following steps:
- added 'NDK_TOOLCHAIN_VERSION := clang' to SQLCipher's Application.mk in jni/
- built the whole code with openSSL, thus first a 'make init', then 'make' to built the rest
Thus openSSL was compiled with GCC, the other SQLCipher C / C++ code with clang. The libraries were
built and I copied them into my application development tree, created my application and tested it - all works well.
I could open and process existing databases created with the older code, also create and process new
databases with this newly built libraries. Thus the GCC and Clang code seems to work together without
issues. Also my own C/C++ code was compiled with GCC and work with the Clang compiled code of
SQLCipher. I haven't run the official tests (see [1] in your posting), just tested with my application.
I then tried to build openSSL with clang and found an issue with the openSSL build/configure scripts.
To check if I can build openSSL with clang I modified the 'build-openssl-libraries.sh' file to create the
standalone toolchain with clang:
${ANDROID_NDK_ROOT}/build/tools/make-standalone-toolchain.sh \
--platform=${ANDROID_PLATFORM_VERSION} \
--install-dir=${ANDROID_TOOLCHAIN_DIR} \
--arch=arm \
--toolchain=arm-linux-androideabi-clang
I also tested the newer python based command file:
${ANDROID_NDK_ROOT}/build/tools/make_standalone_toolchain.py --install-dir=${ANDROID_TOOLCHAIN_DIR) --arch=arm
The new command works well and created the standalone toolchain without any issues.
Then I changed CC=arm-linux-androideabi-gcc to CC=arm-linux-androideabi-clang and started the build. The openSSL
compile bails out because the openSSL build script uses a compiler flag '-mandroid' that clang does not understand/support. I have not modified
the openSSL scripts, they are always loaded before building openSSL. IMHO here the openSSL team needs to change the build script to
have clang compliant build.
Werner