gpt4 book ai didi

ios - 为 ios 7 armv7s 编译 GMP

转载 作者:行者123 更新时间:2023-11-29 03:01:02 26 4
gpt4 key购买 nike

我正在尝试在我的 Macbook 上为 armv7s 和 iphone 模拟器 (i386) 编译 gmp 6.0.0,但我无法让它工作。我阅读了一些相关问题( Build GMP for iOSBuilding a C library (GMP) for arm64 iOS )并将其配置为:

./configure \
CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Wno-error -Wno-implicit-function-declaration" \
CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -E" \
CPPFLAGS="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -miphoneos-version-min=7.0" \
--host=arm-apple-darwin --disable-assembly

配置工作正常,但是当我运行 make 时失败:

clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
div_qr_1n_pi1.c:218:3: error: expected ')'
add_mssaaaa (u2, u1, u0, u0, up[n-2], p1, p0);
^
div_qr_1n_pi1.c:140:49: note: expanded from macro 'add_mssaaaa'
: "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
^
div_qr_1n_pi1.c:218:3: note: to match this '('
div_qr_1n_pi1.c:135:11: note: expanded from macro 'add_mssaaaa'
__asm__ ( "adds %2, %5, %6\n\t" \
^
div_qr_1n_pi1.c:256:7: error: expected ')'
add_mssaaaa (u2, u1, u0, u0, up[j], p1, p0);
^
div_qr_1n_pi1.c:140:49: note: expanded from macro 'add_mssaaaa'
: "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
^
div_qr_1n_pi1.c:256:7: note: to match this '('
div_qr_1n_pi1.c:135:11: note: expanded from macro 'add_mssaaaa'
__asm__ ( "adds %2, %5, %6\n\t" \
^
2 errors generated.
make[2]: *** [div_qr_1n_pi1.lo] Error 1
make[1]: *** [all-recursive] Error 1

我不知道下一步该做什么,如果有人能给我提示下一步该做什么就太好了。

编辑 1:

我下载了最新的快照,将 -no-integrated-as 添加到 cppflags 并将 clang++ 更改为 clang。配置后仍然运行良好,我收到错误:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang `test -f 'gen-fac.c' || echo './'`gen-fac.c -o gen-fac
gen-fac.c:31:10: fatal error: 'stdio.h' file not found
#include <stdio.h>

问候

最佳答案

我终于成功了。我重新安装了 xcode 命令行工具并进行了如下配置:

./configure \
CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" \
CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -Wno-error -Wno-implicit-function-declaration -miphoneos-version-min=7.0 -no-integrated-as -arch armv7s \
--host=arm-apple-darwin --disable-assembly --enable-static --disable-shared"

模拟器(i386)也是如此,并使用 lipo 来合并它们。

这里有 3 个占位符:

  • iPhoneOS7.1.sdk 可以是您当前的 SDK。
  • 7.0 您尝试为其编译库的操作系统的最低版本。
  • armv7s 也可以是 armv7arm64i386

关于ios - 为 ios 7 armv7s 编译 GMP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23294226/

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