Bug #1321
Android client compilations errors for arm64-v8a
Description
Hello, I'm trying to compile strongswan for Andorid 64 bit processors (arm64-v8a).
I'm using 5.4.0dr6 tarball as a source set and compliling on latest Mac OSX 10.11.3. Android NDK verison is latest - r10e./configure
and make dist
steps work fine and I also able to build libraries with ndk-build
for existing architectures (armeabi x86 mips) without problem.
However, when I've added arm64-v8a to APP_ABI in Applicaiton.mk, ndk-build
fails always with error below:
[arm64-v8a] Compile : strongswan <= mutex.c jni/strongswan/src/libstrongswan/threading/mutex.c: In function 'timed_wait_abs': jni/strongswan/src/libstrongswan/threading/mutex.c:263:3: warning: implicit declaration of function 'pthread_cond_timedwait_monotonic' [-Wimplicit-function-declaration] timed_out = pthread_cond_timedwait(&this->condvar, &mutex->mutex, ^ [arm64-v8a] SharedLibrary : libstrongswan.so ./obj/local/arm64-v8a/objs/strongswan/threading/mutex.o: In function `timed_wait_abs': /Users/alexs/Documents/Workspace/AndroidStudio/vpn-shield/strongswan/src/frontends/android/app/src/main/jni/strongswan/src/libstrongswan/threading/mutex.c:270: undefined reference to `pthread_cond_timedwait_monotonic' /Users/alexs/Documents/Workspace/AndroidStudio/vpn-shield/strongswan/src/frontends/android/app/src/main/jni/strongswan/src/libstrongswan/threading/mutex.c:263: undefined reference to `pthread_cond_timedwait_monotonic' collect2: error: ld returned 1 exit status make: *** [obj/local/arm64-v8a/libstrongswan.so] Error 1
After some googling I've tried to remove that function redefine from mutex.c
, by removing this lines https://github.com/strongswan/strongswan/blob/master/src/libstrongswan/threading/mutex.c#L241-L244 .
And it worked, ndk-build
completed successfully and app seems to work fine on 64bit device.
So, is it fine to use such approach, and do you plan to add arm64-v8a to supported architectures for Android?
History
#1 Updated by Tobias Brunner over 9 years ago
- Tracker changed from Issue to Bug
- Status changed from New to Feedback
So, is it fine to use such approach, and do you plan to add arm64-v8a to supported architectures for Android?
Refer to the related issue on Github and try the changes in the android-64-bit branch.
#2 Updated by Alexander Semenov over 9 years ago
Tobias Brunner wrote:
Refer to the related issue on Github and try the changes in the android-64-bit branch.
Ok, I've tetsted changes in the android-64-bit branch, and it works well. Thanks a lot!
Are you going to merge that to master?
#3 Updated by Tobias Brunner over 9 years ago
- Status changed from Feedback to Closed
- Assignee set to Tobias Brunner
- Target version set to 5.5.0
- Resolution set to Fixed
Are you going to merge that to master?
Done (commit:17e36cd48c, commit:2f3879c3fe). A new version of the app will be released in a couple of weeks.