... | ... | @@ -25,7 +25,7 @@ To configure, use |
|
|
```
|
|
|
|
|
|
|
|
|
You can also build registerised: leave out the `--enable-unregisterised` option, but then you **must** use LLVM (see below).
|
|
|
You can also build registerised: leave out the `--enable-unregisterised` option, but then you **must** install a suitable LLVM (see below).
|
|
|
|
|
|
|
|
|
You'll need to use `integer-simple`, because the cross-compilation environment doesn't include GMP (see [Building/CrossCompiling](building/cross-compiling)).
|
... | ... | @@ -35,19 +35,16 @@ The build should go successfully all the way to stage 2. You can then use the s |
|
|
|
|
|
## Using LLVM
|
|
|
|
|
|
- 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.
|
|
|
- When registerised, you *must* use LLVM. The `-fllvm` option is unnecessary in this case.
|
|
|
|
|
|
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.
|
|
|
|
|
|
To use LLVM, add these to your `mk/build.mk`:
|
|
|
|
|
|
```wiki
|
|
|
GhcLibHcOpts = -O -fllvm -optlc -mtriple=arm-linux-gnueabihf -optlc -mattr=+vfp2 -optlc -float-abi=hard
|
|
|
GhcRtsHcOpts += -fllvm -optlc -mtriple=arm-linux-gnueabihf -optlc -mattr=+vfp2 -optlc -float-abi=hard
|
|
|
```
|
|
|
|
|
|
- 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.
|
|
|
- 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.
|
|
|
|
|
|
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.
|
|
|
|
|
|
To use LLVM when unregisterised, add these to your `mk/build.mk`:
|
|
|
|
|
|
Unfortunately at the moment these options do not persist in GHC, so you have to give them when compiling application code too. |
|
|
```wiki
|
|
|
GhcLibHcOpts = -O -fllvm
|
|
|
GhcRtsHcOpts += -fllvm
|
|
|
``` |
|
|
\ No newline at end of file |