Stefan, If you build the stage 2 compiler using the stage 1 compiler, then the stage 2 compiler will only be able to run on the iPhone! What you need to do is change the options used in building the stage 1 compiler. Steve On 27/01/11 03:57, Stefan Kersten wrote:
hi steve,
On 20.01.11 22:16, Stephen Blackheath [to GHC-iPhone] wrote:
The reason why Template Haskell doesn't work on the current GHC-iPhone compiler is because when I tweaked the build to cross compile, I just took the Stage 1 compiler as the cross compiler. And, by default, the stage 1 compiler doesn't support TH.
ah, ok, that explains it! ;)
It is most likely just a matter of throwing a switch in the build somewhere. I believe the TH code is interpreted, so the ARM back end should not be an issue. Unfortunately, fixing this is nowhere near my priority list at the moment.
ok, no problem.
If you want to attempt it, I've given detailed instructions on how to build the compiler, so you should have no trouble. It builds well on Snow Leopard, and takes about an hour or so. I'll help with answering questions as much as I can.
i've built the iphone-simulator compiler by patching ghc-6.10.4 and also using 6.10.4 for compilation; thanks for the detailed build instructions! the build succeeded, but now i'll need your help; the very last output is (probably as expected):
# Cross compile: We don't actually build the compiler in stage 2. #make -C compiler stage=2 # Cross compile: We only need a selection of the utils in 'utils' built for the target #make -C utils with-stage-2 # Build ghc-pkg in stage 2 because it needs different default directories # to the one we built in stage 1. (The makefile forces it to be built for the build host.) make -C utils/ghc-pkg with-stage-2 make[2]: Nothing to be done for `with-stage-2'.
i've built the stage2 compiler with make -C compiler stage=2, but i'm not sure how to modify the build script to actually install that compiler. any ideas?
thanks, <sk>