[strongSwan-dev] Builoding Android VPN Client

Andrey KomIssarov komissar.off.andrey at gmail.com
Tue Apr 24 13:33:21 CEST 2018


Hello

I'm trying to build strongswan Android VPN Client using cross-compile
and I got some problems.
I couldn't link libcrypto.a to strongswan.so using Android ndk-build
log:


[armeabi] SharedLibrary : libstrongswan.so
~/strongswan/src/frontends/android/app/src/main/jni/openssl/lib/libcrypto.a(cryptlib.o):cryptlib.c:function
OPENSSL_showfatal: error: undefined reference to 'stderr'
~/strongswan/src/frontends/android/app/src/main/jni/openssl/lib/libcrypto.a(cryptlib.o):cryptlib.c:function
OPENSSL_stderr: error: undefined reference to 'stderr'
~/strongswan/src/frontends/android/app/src/main/jni/openssl/lib/libcrypto.a(armcap.o):armcap.c:function
OPENSSL_cpuid_setup: error: undefined reference to 'sigfillset'
~/strongswan/src/frontends/android/app/src/main/jni/openssl/lib/libcrypto.a(armcap.o):armcap.c:function
OPENSSL_cpuid_setup: error: undefined reference to 'sigdelset'
... and a lot more


Here is my Android.mk
(~/strongswan/src/frontends/android/app/src/main/jni/openssl/Android.mk):


LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := crypto_static
LOCAL_SRC_FILES := lib/libcrypto.a
include $(PREBUILT_STATIC_LIBRARY)


Help of using LDFLGAS:
    LOCAL_LDFLAGS :=
-I~/Android/Sdk/ndk-bundle/platforms/android-24/arch-arm/usr/lib/libc.a
or linking libc:
    include $(CLEAR_VARS)
    LOCAL_MODULE := libc
    LOCAL_SRC_FILES :=
~/Android/Sdk/ndk-bundle/platforms/android-24/arch-arm/usr/lib/libc.a
    include $(PREBUILD_STATIC_LIBRARY)
doesn't make any sence

OpenSSL was successfully build for arch-arm by the instruction from
there web site.

Is there any experience of building Android VPN Client with or without
OpenSSL (using GMP) ?
Or maybe there is an error in my Android.mk ?

Thank you
Andrey


More information about the Dev mailing list