Changes between Version 2 and Version 3 of Building/Preparation/RaspberryPi


Ignore:
Timestamp:
Jan 30, 2013 10:03:43 AM (3 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/Preparation/RaspberryPi

    v2 v3  
    2020}}}
    2121
    22 You can also build registerised: leave out the `--enable-unregisterised` option, but then you '''must''' use LLVM (see below).
     22You can also build registerised: leave out the `--enable-unregisterised` option, but then you '''must''' install a suitable LLVM (see below).
    2323
    2424You'll need to use `integer-simple`, because the cross-compilation environment doesn't include GMP (see [wiki:Building/CrossCompiling]).
     
    2828== Using LLVM ==
    2929
    30  * When unregisterised, the C backend will be used by default, but you can optionally use LLVM.  Code generated using LLVM is compatible with code generated using the C backend.
    31  * When registerised, you ''must'' use LLVM.  The `-fllvm` option is unnecessary in this case.
     30Note that LLVM 2.9 does not work for registerised code generation on ARM (it crashes), and LLVM 3.1 has been reported to generate incorrect code.  Success has been reported with LLVM 3.0 and 3.2.
    3231
    33 To use LLVM, add these to your `mk/build.mk`:
     32 * When '''unregisterised''', the C backend will be used by default, but you can optionally use LLVM (see below).  Code generated using LLVM is compatible with code generated using the C backend.
     33 * When '''registerised''', LLVM is the only backend that supports registerised compilation on ARM, so it will be used automatically.  You don't have to do anything except ensure that a suitable version of LLVM is installed.
     34
     35To use LLVM when unregisterised, add these to your `mk/build.mk`:
    3436
    3537{{{
    36 GhcLibHcOpts       = -O -fllvm -optlc -mtriple=arm-linux-gnueabihf -optlc -mattr=+vfp2 -optlc -float-abi=hard
    37 GhcRtsHcOpts      += -fllvm -optlc -mtriple=arm-linux-gnueabihf -optlc -mattr=+vfp2 -optlc -float-abi=hard
     38GhcLibHcOpts       = -O -fllvm
     39GhcRtsHcOpts      += -fllvm
    3840}}}
    39 
    40 Note that LLVM 2.9 does not work for registerised code generation on ARM (it crashes), and LLVM 3.1 has been reported to generate incorrect code.  Success has been reported with LLVM 3.0 and 3.2.
    41 
    42 Unfortunately at the moment these options do not persist in GHC, so you have to give them when compiling application code too.