为ios7 arm64构建Botan库

时间:2013-12-23 14:19:14

标签: ios ios7 botan

我正在尝试为ios7构建Botan lib(32位和64位ios设备)

我试过了:

   ./configure.py --cpu=armv7 --cc=clang --cc-bin="clang++ -arch armv7 -arch armv7s --sysroot=$(IOS_SYSROOT)"
-bash: IOS_SYSROOT: command not found
   INFO: Guessing target OS is darwin (use --os to set)
   INFO: Canonicalizized --cpu=armv7 to arm/armv7
   INFO: Target is clang-darwin-arm-armv7
   INFO: Skipping, by request only - bzip2 cms cvc gnump openssl zlib
   INFO: Skipping, dependency failure - dyn_engine
   INFO: Skipping, incompatible CPU - aes_ni aes_ssse3 idea_sse2 md4_x86_32 md5_x86_32 mp_x86_32 mp_x86_64 rdrand serpent_x86_32 sha1_sse2 sha1_x86_32 sha1_x86_64 simd_altivec simd_sse2
   INFO: Skipping, incompatible OS - asm_x86_32 asm_x86_64 beos_stats cryptoapi_rng dyn_load win32_crit_section win32_stats
   INFO: Skipping, incompatible compiler - mp_asm64 mp_msvc64 mp_x86_32_msvc
   INFO: Skipping, loaded only if needed by dependency - aes_isa_eng asm_engine
   INFO: Skipping, missing TR1 - ssl
   INFO: Using MP module mp_generic
   INFO: Using SIMD module simd_scalar
   INFO: Assuming CPU is little endian
   INFO: Using symlink to link files into build directory
   INFO: Botan 1.10.7 build setup is complete
Claudius-MacBook-Pro:Botan-1.10.7 claudiuluminosu$ make check
clang++ -arch armv7 -arch armv7s --sysroot= -Ibuild/include -O2 -finline-functions  -D_REENTRANT -ansi -Wno-long-long -W -Wall -fPIC -fvisibility=hidden -c src/algo_base/symkey.cpp -o build/lib/algo_base_symkey.o
In file included from src/algo_base/symkey.cpp:8:
In file included from build/include/botan/symkey.h:11:
In file included from build/include/botan/secmem.h:11:
In file included from build/include/botan/allocate.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/string:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/bits/c++config.h:41:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/bits/os_defines.h:61:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/unistd.h:71:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/_types.h:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types.h:32:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/cdefs.h:655:2: error: 
      Unsupported architecture
#error Unsupported architecture
 ^
In file included from src/algo_base/symkey.cpp:8:
In file included from build/include/botan/symkey.h:11:
In file included from build/include/botan/secmem.h:11:
In file included from build/include/botan/allocate.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/string:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/bits/c++config.h:41:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/bits/os_defines.h:61:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/unistd.h:71:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/_types.h:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/machine/_types.h:34:2: error: 
      architecture not supported
#error architecture not supported
 ^
In file included from src/algo_base/symkey.cpp:8:
In file included from build/include/botan/symkey.h:11:
In file included from build/include/botan/secmem.h:11:
In file included from build/include/botan/allocate.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/string:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/bits/c++config.h:41:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/bits/os_defines.h:61:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/unistd.h:71:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/_types.h:27:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types.h:94:9: error: 
      unknown type name '__int64_t'
typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types.h:95:9: error: 
      unknown type name '__int32_t'
typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types.h:96:9: error: 
      unknown type name '__int32_t'
typedef __int32_t       __darwin_dev_t;         /* dev_t */
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types.h:99:9: error: 
      unknown type name '__uint32_t'
typedef __uint32_t      __darwin_gid_t;         /* [???] process and gro...
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types.h:100:9: error: 
      unknown type name '__uint32_t'
typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, o...
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types.h:101:9: error: 
      unknown type name '__uint64_t'
typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bi...

如何配置IOS_SYSROOT?我用的是XCode5。不应该默认设置?该怎么办?为什么它使用MacOSX平台...

这是我运行setenv-ios时的输出

./setenv-ios.sh
Configuring for Device (ARMv7)
XCODE_SDK: iPhoneOS7.0.sdk
XCODE_DEVELOPER: /Applications/Xcode.app/Contents/Developer
XCODE_TOOLCHAIN: /Applications/Xcode.app/Contents/Developer/usr/bin
XCODE_DEVELOPER_TOP: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
IOS_ARCH: armv7
IOS_TOOLCHAIN: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/
IOS_SYSROOT: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
SYSROOT TEST: found valid sysroot, we're go for launch
TOOL TEST: found all tools, this might actually work

这实际上可能有用......但它没有

1 个答案:

答案 0 :(得分:1)

我不确定,但你可以尝试一下......

以配置IOS_SYSROOT

如果您是从命令行执行此操作:

. ./setenv-ios.sh 
export CPP="cpp" 
export CC="clang -arch armv7 -arch armv7s --sysroot=$IOS_SYSROOT" 
export CXX="clang++ -arch armv7 -arch armv7s s--sysroot=$IOS_SYSROOT" 
 ./configure --host=x86_64-darwin --host=arm --with-sysroot=$IOS_SYSROOT ... 

如果要为ARM64构建,则可能需要添加 -mios版本分钟= 7.0。在编译时,OpenSSL不需要它 Clang,而Crypto ++和libevent,以及libcurl都做到了。