From: simonmar Date: Wed, 3 Sep 2003 13:16:37 +0000 (+0000) Subject: [project @ 2003-09-03 13:16:37 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~500 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=dd13de3f983719be4beba1db9a98ac1fda641cc7;p=ghc-hetmet.git [project @ 2003-09-03 13:16:37 by simonmar] Update the unregisterised bootstrapping instructions to recommend using hc-build, and rearange some things. --- diff --git a/docs/building/building.sgml b/docs/building/building.sgml index 913cb1b..f0adddd 100644 --- a/docs/building/building.sgml +++ b/docs/building/building.sgml @@ -3711,6 +3711,20 @@ foo% make install since unregisterised compilation is usually just a step on the way to a full registerised port, we don't mind too much. + Notes on GHC portability in general: we've tried to stick + to writing portable code in most parts of the system, so it + should compile on any POSIXish system with gcc, but in our + experience most systems differ from the standards in one way or + another. Deal with any problems as they arise - if you get + stuck, ask the experts on + glasgow-haskell-users@haskell.org. + + Lots of useful information about the innards of GHC is + available in the GHC + Commentary, which might be helpful if you run into some + code which needs tweaking for your system. + Cross-compiling to produce an unregisterised GHC @@ -3876,55 +3890,32 @@ $ make hc-file-bundle Project=Ghc On the target machine: - At this stage we simply need to bootstrap a compiler - from the intermediate C files we generated above. It is - possible to follow the instructions for bootstrapping from C - files in , but we find - that the script hc-build is more suited - to booting a registerised compiler on an already-working - platform. The following instructions duplicate some of what - the hc-build script does, but the process - is made simpler by just aiming to get a working compiler, - then using this to bootstrap a completely fresh tree. - - - - -$ cd T/.. && tar xvzf ghc-*-hc.tar.gz - - - - - Create - T/mk/build.mk, - with the following contents: - - -GhcUnregisterised = YES -GhcLibWays = -SplitObjs = NO -GhcWithNativeCodeGen = NO -GhcWithInterpreter = NO - - - - - Bootstrap GHC from the .hc files: + At this stage we simply need to bootstrap a compiler + from the intermediate C files we generated above. The + process of bootstrapping from C files is automated by the + script in distrib/hc-build, and is + described in . -$ ./configure --enable-hc-boot --enable-hc-boot-unregisterised -$ make -C glafp-utils boot all -$ make -C ghc boot -$ make -C libraries boot all -$ make -C ghc all +$ ./distrib/hc-build --enable-hc-boot-unregisterised - - - You should now have a working GHC binary. You - might want to try using this GHC to compile a Hello - World, to make sure it's doing something - reasonable: + However, since this is a bootstrap on a new machine, + the automated process might not run to completion the + first time. For that reason, you might want to treat the + hc-build script as a list of + instructions to follow, rather than as a fully automated + script. This way you'll be able to restart the process + part-way through if you need to fix anything on the + way. + + Don't bother with running + make install in the newly + bootstrapped tree; just use the compiler in that tree to + build a fresh compiler from scratch, this time without + booting from C files. Before doing this, you might want + to check that the bootstrapped compiler is generating + working binaries: $ cat >hello.hs @@ -3932,39 +3923,17 @@ main = putStrLn "Hello World!\n" ^D $ T/ghc/compiler/ghc-inplace hello.hs -o hello $ ./hello -Hello World!\n +Hello World! - - - Now, use this compiler - (T/ghc/compiler/ghc-inplace) - to build another GHC tree from scratch, as - normal. - - + Once you have the unregisterised compiler up and + running, you can use it to start a registerised port. The + following sections describe the various parts of the + system that will need architecture-specific tweaks in + order to get a registerised build going. + - - The build may not go through cleanly. We've tried to - stick to writing portable code in most parts of the compiler, - so it should compile on any POSIXish system with gcc, but in - our experience most systems differ from the standards in one - way or another. Deal with any problems as they arise - if you - get stuck, ask the experts on - glasgow-haskell-users@haskell.org. - - Once you have the unregisterised compiler up and - running, you can use it to start a registerised port. The - following sections describe the various parts of the system - that will need architecture-specific tweaks in order to get a - registerised build going. - - Lots of useful information about the innards of GHC is - available in the GHC - Commentary, which might be helpful if you run into - some code which needs tweaking for your system.