Changes between Version 44 and Version 45 of Building/CrossCompiling/iOS


Ignore:
Timestamp:
Oct 30, 2013 12:50:18 AM (6 months ago)
Author:
lukexi
Comment:

Added instructions for an updated version of libffi, and unified the Xcode 5 instruction formatting

Legend:

Unmodified
Added
Removed
Modified
  • Building/CrossCompiling/iOS

    v44 v45  
    88(The problem is that 1. GHC tries to run a C pre-processor over Haskell code, and 2. Xcode versions >= 5 use clang instead of gcc, and 3. clang doesn't like Haskell code.).  
    99 
    10 GHC 7.8 already includes a fix for this. 
     10GHC 7.8 already includes a fix for this, but until that's released you'll have to use this. 
     11 
     12Also see the '''Xcode 5''' notes interspersed through these steps. 
    1113 
    1214== Steps == 
     
    2325You will need to check out the scripts at [https://github.com/ghc-ios/ghc-ios-scripts] and add the checked out directory to your PATH. You may need to edit these scripts if you are using a different iOS / iOS simulator platform version than the one the scripts are pointed at. 
    2426 
    25 If you're using Xcode 5, do "git checkout xcode5" after cloning. Also see the note at the top of this page regarding clang-xcode5-wrapper. 
     27> **Xcode 5** 
     28> 
     29> Do "git checkout xcode5" after cloning. Also see the note at the top of this page regarding clang-xcode5-wrapper. 
    2630 
    2731=== 3. Check out GHC === 
     
    3337perl boot 
    3438}}} 
     39 
     40> **Xcode 5** 
     41> 
     42> You need to replace the version of libffi in libffi-tarballs with this one: 
     43> [https://github.com/ghc-ios/libffi-tarballs/blob/master/libffi-3.0.13z.tar.gz?raw=true] 
     44> It will be automatically picked up by the build system, so just deleting the old one and dropping the new one in is all you need to do. 
    3545 
    3646=== 4. Create a build.mk file === 
     
    5969}}} 
    6070 
    61 For Xcode 5, change {{{--with-gcc=arm-apple-darwin10-gcc}}} / {{{--with-gcc=i386-apple-darwin11-gcc}}} to {{{--with-gcc=arm-apple-darwin10-clang}}} / {{{--with-gcc=i386-apple-darwin11-clang}}} , respectively. 
    62  
    6371GHC is smart enough to prefix the binaries and libraries with the target name, e.g. arm-apple-darwin10-ghc, so this will install alongside your native GHC without overwriting anything. 
     72 
     73> **Xcode 5** 
     74> 
     75> Change {{{--with-gcc=arm-apple-darwin10-gcc}}} / {{{--with-gcc=i386-apple-darwin11-gcc}}} to {{{--with-gcc=arm-apple-darwin10-clang}}} / {{{--with-gcc=i386-apple-darwin11-clang}}} , respectively. 
     76 
     77 
    6478 
    6579=== 6. Make sure your Cabal and cabal-install are new enough ===