适用于iOS 7 armv7s GMP编译 [英] Compiling GMP for ios 7 armv7s

查看:484
本文介绍了适用于iOS 7 armv7s GMP编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着去编译我的MacBook上armv7s和iPhone模拟器(I386),GMP 6.0.0,但我只是无法得到它的工作。我读了一些相关的问题(建立GMP适用于iOS ,的Building~~V的arm64的iOS C库(GMP)),并配置它:

  ./配置\\
CC =/应用/ X code.app /内容/开发商/工具链/ X codeDefault.xctoolchain的/ usr / bin中/铛++ -Wno错误-Wno隐函数声明\\
CPP =/应用/ X code.app /内容/开发商/工具链/ X codeDefault.xctoolchain的/ usr / bin中/铛++ -E\\
CPPFLAGS = - 拱armv7s -isysroot /Applications/X$c$c.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -miphoneos版本分钟= 7.0\\
主机=臂苹果达尔文--disable组装

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

 铛:警告:治疗'C'输入为C ++当C ++模式下,这种行为是德precated
div_qr_1n_pi1.c:218:3:错误:预期')'
  add_mssaaaa(U2,U1,U0,U0,向上[N-2],P1,P0);
  ^
div_qr_1n_pi1.c:140:49:注意:从宏观'add_mssaaaa'扩大
           :R(啊),日(BH),%R(人),日(BL)__CLOBBER_CC)
                                                       ^
div_qr_1n_pi1.c:218:3:注意:要匹配这个'('
div_qr_1n_pi1.c:135:11:注意:从宏观'add_mssaaaa'扩大
  __asm​​__(加2%,5%,6%\\ n \\ t的\\
          ^
div_qr_1n_pi1.c:256:7:错误:预期')'
      add_mssaaaa(U2,U1,U0,U0,同比[J],P1,P0);
      ^
div_qr_1n_pi1.c:140:49:注意:从宏观'add_mssaaaa'扩大
           :R(啊),日(BH),%R(人),日(BL)__CLOBBER_CC)
                                                       ^
div_qr_1n_pi1.c:256:7:注意:要匹配这个'('
div_qr_1n_pi1.c:135:11:注意:从宏观'add_mssaaaa'扩大
  __asm​​__(加2%,5%,6%\\ n \\ t的\\
          ^
产生2个错误。
使[2]:*** [div_qr_1n_pi1.lo]错误1
使[1]:*** [所有递归]错误1

我不知道下一步该怎么做,将是巨大的,如果有人能够给我一个提示下一个尝试的东西。

编辑1:

我下载了最新的快照,添加-no整合,作为对CPPFLAGS,改变铛++来铿锵。配置还是只要我让运行正常位,我得到的错误:

<$p$p><$c$c>/Applications/X$c$c.app/Contents/Developer/Toolchains/X$c$cDefault.xctoolchain/usr/bin/clang `测试-f'发电机fac.c'||回声./'`gen-fac.c -o发电机FAC
发电机fac.c:31:10:致命错误:未找到文件stdio.h文件
#包括LT&;&stdio.h中GT;

问候


解决方案

我终于得到了它的工作。我重新安装了X code命令行工具,并将其配置是这样的:

  ./配置\\
CC =/应用/ X code.app /内容/开发商/工具链/ X codeDefault.xctoolchain的/ usr / bin中/铛\\
CFLAGS = - isysroot /Applications/X$c$c.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/ -Wno错误-Wno隐函数声明-miphoneos版本分钟= 7.0 - 没有集成,为-arch armv7s \\
主机=臂苹果达尔文--disable组装--enable-静态--disable共享

同为模拟器(I386),并使用脂合并它们。

有3占位符的位置:


  • iPhoneOS7.1.sdk 可以是任何当前的SDK是。

  • 7.0 的版本分钟你试图编译库的操作系统。

  • armv7s 这可能是也的ARMv7 arm64 386

Im trying to compile gmp 6.0.0 for armv7s and iphone simulator (i386) on my Macbook but i just cant get it to work. i read some related questions (Build GMP for iOS, Building a C library (GMP) for arm64 iOS) and configured it with:

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

Configuring works fine but when i run make it fails with:

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

i dont know what to do next, would be great if someone could give me a hint what to try next.

EDIT 1:

i downloaded the latest snapshot, added -no-integrated-as to the cppflags and changed clang++ to clang. configure still runs fine bit as soon as i make, i get the error:

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

Regards

解决方案

I finally got it working. i reinstalled the xcode command line tools and configured it like this:

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

same for the simulator(i386) and used lipo to merge them.

There are 3 placeholders here :

  • iPhoneOS7.1.sdk which can be whatever your current SDK is.
  • 7.0 The min version of the OS you're trying to compile the library for.
  • armv7s which could be also armv7, arm64, i386.

这篇关于适用于iOS 7 armv7s GMP编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆