Search code examples
ioscompilationmakefilegmparmv7

Problems Building GMP using iOS SDK 8.3


I can't build GMP for iOS -arch armv7s no matter how I configure make. First, configure wasn't finding a c compiler, then I got past the configure stage with this : ./configure CC=clang CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E" CPPFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/ -miphoneos-version-min=8.0 -arch armv7s -target arm-apple-darwin" --host=aarch64-apple-darwin --disable-assembly --enable-static --disable-shared

Afterwards, make runs for a little bit, then quits with this :

    libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_div_qr_1n_pi1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/ -miphoneos-version-min=8.0 -arch armv7s -target arm-apple-darwin -O2 -pedantic -DNO_ASM -c div_qr_1n_pi1.c -o div_qr_1n_pi1.o
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
make: *** [all] Error 2

Does anyone have any idea how to fix this? I can compile gmp for x86 on my mac without a single problem.


Solution

  • This issue was fixed a few months ago. Sadly, it isn't available in an official release yet, but you can get a snapshot from https://gmplib.org/download/snapshot/ .