gpt4 book ai didi

ios - 无法为 arm (iOS) 交叉编译 C 库

转载 作者:太空宇宙 更新时间:2023-11-04 01:53:27 27 4
gpt4 key购买 nike

<分区>

我正在尝试交叉编译 libDSM对于 iOS,从 arm64 开始。

我已经下载了源代码并尝试使用以下方法对其进行配置:

export XCODEDIR=$(xcode-select -p)
export DEVROOT=${XCODEDIR}/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS.sdk
export CFLAGS="-arch arm64 -pipe -no-cpp-precomp -isysroot $SDKROOT -mios-version-min=10.0 -I$SDKROOT/usr/include/"
export LDFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=10.0"

./configure --host arm-apple-darwin --prefix $PWD/build/arm64

它因这个错误而停止:

configure: error: C preprocessor "/lib/cpp" fails sanity check

configure.log 中的错误是:

configure:4504: checking how to run the C preprocessor
configure:4535: gcc -E conftest.c
In file included from conftest.c:14:
In file included from /Users/pmacro/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/limits.h:37:
In file included from /Users/pmacro/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/include/limits.h:63:
/Users/pmacro/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/include/sys/cdefs.h:761:2: error: Unsupported architecture
#error Unsupported architecture
^

configure.log 中较早的一条可能相关的消息是:

configure:3752: ./conftest

./configure: line 3754: ./conftest: Bad CPU type in executable

请注意,它对于 x86_64(我正在构建的平台)编译良好,但对于任何 arm 架构它都失败了。

我查看了 iOS 的交叉编译示例,它们似乎都遵循这些步骤。我正在运行预发布软件(macOS Sierra 和 Xcode 8),但在 Sierra 上运行 Xcode 7 时遇到同样的问题。感谢您的帮助。

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com