[Android-development] Fwd: OpenSSL Runtime Support

Robert Iakobashvili coroberti at gmail.com
Sun Jun 23 09:12:13 CEST 2013


Hello,
I'd like to make my Qt-5 application for Android
working with openssl.

So, I'm following QT5 Android wiki as below:
http://qt-project.org/wiki/Qt5ForAndroid and by using
git version since June 21, 2013

To enable run-time support and usage for openssl
related functions in my application, I've configured it
with added flags -openssl and -I/path-to-openssl-headers.

./configure -developer-build -xplatform android-g++ -nomake tests
-nomake examples -android-ndk /home/robert/dev/android-ndk-r8e-ma
-android-sdk /home/robert/dev/android-sdk-linux -android-ndk-host
linux-x86 -skip qttranslations -skip qtwebkit -skip qtserialport -skip
qtwebkit-examples -openssl -I/home/robert/dev/openssl-1.0.1e/include

and seen that openssl run-time support is configured

Trying to make, I'm getting the following compilation error:

/home/robert/dev/android-ndk-r8e-ma/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
-c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
-ffunction-sections -funwind-tables -fstack-protector -fno-short-enums
-DANDROID -Wa,--noexecstack -std=gnu++0x
-I/home/robert/dev/openssl-1.0.1e/include -g -g -marm -O0
-fno-omit-frame-pointer -fvisibility=hidden
-fvisibility-inlines-hidden -fno-exceptions -Wall -Wno-psabi -W
-D_REENTRANT -fPIC -DQT_NO_PRINTDIALOG -DQT_NO_LIBUDEV -DQT_NO_XCB
-DQT_NO_XKBCOMMON -DQT_NO_USING_NAMESPACE -DQT_BUILD_NETWORK_LIB
-DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS
-DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS
-DQT_CORE_LIB -I../../mkspecs/android-g++ -I. -I../../include
-I../../include/QtNetwork -I../../include/QtNetwork/5.1.1
-I../../include/QtNetwork/5.1.1/QtNetwork -Ikernel
-I../../include/QtCore -I../../include/QtCore/5.1.1
-I../../include/QtCore/5.1.1/QtCore -I.moc/debug-shared
-I/home/robert/dev/android-ndk-r8e-ma/sources/cxx-stl/gnu-libstdc++/4.7/include
-I/home/robert/dev/android-ndk-r8e-ma/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include
-I/home/robert/dev/android-ndk-r8e-ma/platforms/android-9/arch-arm/usr/include
-o .obj/debug-shared/qsslsocket_openssl_symbols.o
ssl/qsslsocket_openssl_symbols.cpp
ssl/qsslsocket_openssl_symbols.cpp: In function 'QStringList libraryPathList()':
ssl/qsslsocket_openssl_symbols.cpp:426:52: error: 'dl_iterate_phdr'
was not declared in this scope

When looking at link.h header file in
android-ndk-r8e-ma/platforms/android-9/arch-arm/usr/include

the following declarations are in use in link.h:

#ifdef __arm__
typedef long unsigned int* _Unwind_Ptr;
_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount);
#else
int dl_iterate_phdr(int (*cb)(struct dl_phdr_info*, size_t, void*), void*);
#endif

and instead of dl_iterate_phdr used for __arm__
dl_unwind_find_exidx

Does it mean that I need to patch ssl/qsslsocket_openssl_symbols.cpp
for __arm__ builds or there's another more conventional way to enable
run-time support for openssl on Android?

Sorry for the newbie question and for my limited understanding.

Thank you in advance!

Robert



More information about the Android-development mailing list