[botan-devel] Building Botan for iOS 6.1

Ken Smith kgsmith at gmail.com
Wed Jan 30 20:43:25 EST 2013


Hi all,

I've built Botan 1.10.4 for iOS 6.1 but am having linker errors which
I hope you can help me with. I'm using the latest Xcode v4.6 which
uses g++ 4.2 under the covers. I've configured Botan like this.


./configure.py --cpu=arm --disable-asm --disable-sse2 --disable-ssse3
--disable-altivec --disable-aes-ni --disable-movbe
--prefix=/tmp/botan-1.10.4-armv7
./configure.py --cpu=arm --disable-asm --disable-sse2 --disable-ssse3
--disable-altivec --disable-aes-ni --disable-movbe
--prefix=/tmp/botan-1.10.4-armv7s
./configure.py --cpu=i386 --disable-asm --disable-sse2 --disable-ssse3
--disable-altivec --disable-aes-ni --disable-movbe
--prefix=/tmp/botan-1.10.4-i386

In the makefile for armv7:
CXX =/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++
-arch armv7 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk

-arch and -isysroot are slightly different for armv7s and i386. I also
update the paths to ar and ranlib. I get lots of warnings about
constants being too big to fit into the destination types so to keep
things tidy, I append ULL and UL to integer contstants throught the
source where appropriate. At the end of the build I lipo the three
static libraries into a single universal library. I link to this and
to libstdc++.6.dylib in my Xcode project. My source only calls

Botan::LibraryInitializer init;

at application startup to test the integration. I get this linker error.

Undefined symbols for architecture armv7s:
  "Botan::LibraryInitializer::initialize(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&)",
referenced from:
      Botan::LibraryInitializer::LibraryInitializer(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in
AppDelegate.o
ld: symbol(s) not found for architecture armv7s%

As a first pass at fixing this, I edited the Makefiles to remove
-fvisibility=hidden from SO_OBJ_FLAGS (thinking that the version of
GCC didn't support the symbol exporting magic that is used in Botan.
This didn't solve the linker error. What should I try next?

   :{>



More information about the botan-devel mailing list