[Haskell-iPhone] ARM64 Haskell via GHC 7.10.1 - How to build?

Manuel Gómez targen at gmail.com
Sun May 17 08:11:12 UTC 2015


I see from the discussion in [#7942] that ARM64 support has been
merged into GHC and should be available in 7.10.1.  This is wonderful
— and necessary for iOS development if one intends to pass through the
Apple App Store, as since February new apps are rejected lest they
support ARM64.

However, while scripts seem to be provided in [ghc-ios-scripts] for
installing binaries of GHC 7.8.3 for the iOS Simulator
(i386-apple-darwin11) and actual iOS devices (arm-apple-darwin10,
32-bit ARM), the scripts for aarch64-apple-darwin14 (ARM64 on iOS
devices) aren’t used by the main wrapper scripts and the installation
scripts don’t appear to mention anything about installing a GHC built
for ARM64 cross-compiling — indeed, it’s only 32-bit ARM via GHC
7.8.3.  I can’t find any binary GHCs on the [downloads] either.

Building GHC from source for cross-compiling to ARM64 is currently
failing for me probably due to some trivial issue with my build
environment.  «./configure» says:

    checking version of gcc... configure: error: Need at least gcc
version 3.0 (3.4+ recommended)

That’s configuring with

    ./configure --target=aarch64-apple-darwin14
--with-gcc=aarch64-apple-darwin14-clang

Furthermore,

    $ gcc -v
    Configured with:
--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
    Target: x86_64-apple-darwin14.3.0
    Thread model: posix

    $ aarch64-apple-darwin14-clang
    aarch64-apple-darwin14-clang: line 7:
/usr/local/opt/llvm/bin/clang: No such file or directory
    aarch64-apple-darwin14-clang: line 7: exec:
/usr/local/opt/llvm/bin/clang: cannot execute: No such file or
directory

Note the [aarch64-apple-darwin14-clang] command I’m running there is
the script from [ghc-ios-scripts], which seems overly simplistic
compared to the same script for ARMv7 GHC-iOS:
https://github.com/ghc-ios/ghc-ios-scripts/blob/master/arm-apple-darwin10-clang

I suppose the solution might even be as simple as installing an
adequate version of LLVM+Clang over there at «/usr/local/opt/llvm»
which the commands seem to be looking for — but which version might be
appropriate?  Moreover, is there some guide on how to install what
needs to be installed?  The ghc-ios scripts get 3.0, yet some Trac
comments seem to suggest some very recent version of LLVM, possibly
3.6 or maybe just the latest development version.

Is this even something people have working?

[#7942]: https://ghc.haskell.org/trac/ghc/ticket/7942
[ghc-ios-scripts]: https://github.com/ghc-ios/ghc-ios-scripts
[aarch64-apple-darwin14-clang]:
https://github.com/ghc-ios/ghc-ios-scripts/blob/master/aarch64-apple-darwin14-clang
[downloads]: https://downloads.haskell.org/~ghc/7.10.1/


More information about the iPhone mailing list