[strongSwan] Strongswan 4.6.2 support with Android GB

Kushagra Bhatnagar kbhatnagar at sta.samsung.com
Tue May 8 19:12:39 CEST 2012

Hi Tobias,

Thanks for the reply. Please find below updates from my side.

>> 1. Build the vstr static library by following the wiki
>>   pages (on strongswan.org).

> You built this with droid-gcc?  Did you use the build script?  Are the
> static library and the Android.mk for libvstr in place withing the
> Android source tree?


>> 3. Change all the libvstr path to the appropriate path where
>>    libvstr.a is present.

> Where did you change this?  Are you referring to the libvstr_PATH
> variable in the top level Android.mk file?

Yes, basically in the following file /external/strongswan4.6.2/Android.mk

>> 4. Also run following commands in /external/strongswan4.6.2 folder
>>    ./configure, make and make distclean.

> That's only needed if you build from the git repository, building from
> the tarball should work without this step.

I repeat the whole process once again from scratch and this time I didn't perform this step.

>> 5. Added appropriate module names in core.mk file.

> I think that's not needed for Ginger Bread, only ICS (4.0) requires this.

I repeat the whole process once again from scratch and this time I didn't perform this step.

>> Looks like linker is not able to read the static library
>> "libvstr.a". Is the "libvstr.a" library is compatible with android?

> Hm, with the provided Android.mk on the wiki (vstr.mk which is moved by
> the vstr.build script to the location specified in that script) the
> static library should be converted to a dynamic library which is what
> strongSwan should be linked against.

When I compile the full android code base. As per Android.mk (vstr.mk) both the static (libvstr-static) and shared (libvstr.so) library gets generated in android/out folder.
Compilation is all successful, problem occured while generating libstrongswan library. While linking the files present in libstrongswan-intermediaries folder (printf_hook.c) error occurs as "undefined reference to functions present in libvstr.a library".
I observe that before generating libstrongswan, both libvstr-static and libvstr.so is generated properly.
Below is the snippet of the error.

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/test/obj/SHARED_LIBRARIES/libstrongswan_intermediates/printf_hook.o: in function vstr_wrapper_vfprintf:external/strongswan-4.6.3/src/libstrongswan/printf_hook.c:296: error: undefined reference to 'vstr_make_base'

I would like to mention that I didn't make any changes in the Android GB default kernel. By any chance is this the cause of error. Is changing the kernel code as per wiki link is also a mandatory step.

Thanks in advance.


More information about the Users mailing list