为ios 7 armv7s编写GMP

为ios 7 armv7s编写GMP,ios,arm,gmp,Ios,Arm,Gmp,我试图在我的Macbook上为armv7s和iphone模拟器(i386)编译gmp 6.0.0,但我就是无法让它工作。我阅读了一些相关问题(,),并将其配置为: ./configure \ CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Wno-error -Wno-implicit-function-declaration" \ CPP="/

我试图在我的Macbook上为armv7s和iphone模拟器(i386)编译gmp 6.0.0,但我就是无法让它工作。我阅读了一些相关问题(,),并将其配置为:

./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作为cppflags,并将clang++更改为clang。configure仍然运行良好。一旦我进行配置,就会出现错误:

/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>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang`test-f'gen fac.c'| | echo'/`gen fac.c-o gen fac.c
gen fac.c:31:10:致命错误:“未找到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
    也可以是
    armv7
    arm64
    i386

请参见:,带有标记
-不集成为
。虽然您的错误消息使它看起来像某种C++命名空间问题。这可能有助于说明<代码> AddiSMSAAAA//CuxGe宏。为什么你要用C++编译器来编写C代码?首先,在替换<代码> CLAN++/COD>后,用<代码> CLAN<代码>,得到最新的快照:如果已经做了一些修改,那么这条线有问题。粘贴副本时,它会将--host=arm等传递给clang(这会阻塞它们),而不是configure。我得到了一个
configure:error:找不到工作的编译器,请参阅config.log了解详细信息
,这些错误包括
clang:error:unsupported选项'--host=arm apple darwin'
将configure命令移到前面似乎可以正确地传递它们,但在其他方面有错误。从config.log:
未知伪操作:.ios\u版本\u min