[gambit-list] build-gambit-iOS on 10.7 / Xcode 4.2 / iOS SDK 5.0?

Marc Feeley feeley at iro.umontreal.ca
Wed Oct 26 11:01:22 EDT 2011


On 2011-10-26, at 5:49 AM, Vinny Fiano wrote:

> Has anyone successfully built gambit for iOS using the latest
> toolchain? I have fiddled with a number of options (most notably
> enable-single-host) without success. The closest I've come is a
> simulator build that seems to interpret but fails to compile with "***
> ERROR -- Can't find file <abs path to input file>".
> 
> - Vinny

Compiling v4.6.1 on iOS is not easy "out of the box" with Xcode 4.2 because the default gcc is buggy.  The default gcc is LLVM GCC which does not compile label values (i.e. &&label) correctly, even though it claims conformance to gcc.  I fixed this over the last few weeks, and v4.6.2 should compile out of the box.  Now label values are not used when LLVM is detected.  Unfortunately this makes the code run 5 times slower on iOS (yes 400% slower).  My personal "solution" is to keep around a version of Xcode 4.0 which has a good gcc for when I build releases of Gambit REPL.  I hope Apple will fix the bug in LLVM GCC so that in the future label values can be used with the default iOS C compiler.

Just to be clear, here is the procedure to use on Mac OS X:

% curl http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/source/gambc-v4_6_2.tgz > gambc-v4_6_2.tgz
% tar zxf gambc-v4_6_2.tgz 
% cd gambc-v4_6_2
% CC=i686-apple-darwin11-gcc-4.2.1 ./configure --enable-single-host
% make -j 2
% cd examples/iOS
% make examples   ### this will recompile the Gambit runtime for the iPhone (real device and simulator)
% open GambitREPL.xcodeproj

Marc




More information about the Gambit-list mailing list