ios - 为 ios7 arm64 构建 Botan 库

标签 ios ios7 botan

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

我试过:

   ./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

这可能真的有用......但它没有

最佳答案

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

配置 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-version-min=7.0。 OpenSSL 在下面编译时不需要它 Clang,而 Crypto++ 和 libevent,以及 libcurl 做到了。

关于ios - 为 ios7 arm64 构建 Botan 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20745412/

相关文章:

ios - 如何使用 Frame Size 从 ViewController 调用自定义 UIView

ios - 应用设置不包含定位服务

ios - iOS 和 PC 之间的安全信号

iphone - CGContextShowTextAtPoint 已弃用 - 我现在应该使用什么?

iOS:如何识别 Xcode 仪器的泄漏?

ios - 预期标识符

ios - 在当前 View Controller 中关闭以前的模态视图 Controller

c++ - QT中使用Botan C++加密文件

c++ - Botan C++哈希函数generate_bcrypt()

c++ - 在 Qt 中使用 Botan 时遇到问题