[strongSwan] undefined reference to vstr functions while building strongswan for Android
tobias at strongswan.org
Sat Jul 13 10:02:50 CEST 2013
> ./obj/local/armeabi/objs/strongswan/utils/printf_hook.o: in function
> error: undefined reference to 'vstr_fmt_add'
This issue is related to the new x86_64 host toolchains that were
introduced with the 8e release of the NDK (which seems to be included in
the recent ADT bundle you are using). If the x86 version of the NDK is
not also installed on the host the NDK script that should create the
standalone toolchain fails when not explicitly told to build an x86_64
toolchain (it simply defaults to building an x86 toolchain, which it
can't, instead of doing some kind of auto-detection).
Unfortunately, the vstr_arch.build script does not have much error
handling and, thus, did not notice that the toolchain was not there.
Instead it continued, but built the library with the tools on your
x86_64 host, that is, it did not cross-compile for ARM. Therefore,
while the symbols are, in fact, contained in the libvstr.a archive it is
built for the wrong architecture. This later causes the observed errors
when the linker tries to link libvstr.a (x86_64) into libstrongswan.so
I updated the build script on the wiki , so that the x86_64 toolchain
can now be used explicitly (there is no need to also install the x86
NDK, which requires a whole bunch of extra libraries - ia32-libs package
on Ubuntu - when used on x86_64 hosts). I also added some error
handling if building the toolchain fails.
More information about the Users