X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fbuilding%2Fbuilding.xml;h=1cce8b561af23351a3aab416795fe45274fee29f;hb=5b0e32406c30be1613fbf556685c77e840dff342;hp=0c80312537432c4aa60d093bf398ed7a890c4871;hpb=7465f1dd9a0d60a74b538e1894e035d732cbe30a;p=ghc-hetmet.git diff --git a/docs/building/building.xml b/docs/building/building.xml index 0c80312..1cce8b5 100644 --- a/docs/building/building.xml +++ b/docs/building/building.xml @@ -2752,8 +2752,8 @@ directive. - EXCLUDE_SRCS - EXCLUDE_SRCS + EXCLUDED_SRCS + EXCLUDED_SRCS Set to a list of source files (relative to the @@ -2771,7 +2771,7 @@ directive. EXTRA_SRCS - EXCLUDE_SRCS + EXTRA_SRCS Set to a list of extra source files (perhaps @@ -2952,6 +2952,58 @@ directive. ones in boilerplate.mk. + + Platform settings + Platform settings + + + There are three platforms of interest when building GHC: + + + + The build platform + + The platform on which we are doing this build. + + + + + The host platform + + The platform on which these binaries will run. + + + + + The target platform + + The platform for which this compiler will generate code. + + + + + These platforms are set when running the + configure script, using the + , , and + options. The mk/config.mk + file defines several symbols related to the platform settings (see + mk/config.mk for details). + + We don't currently support build & host being different, because + the build process creates binaries that are both run during the build, + and also installed. + + If host and target are different, then we are building a + cross-compiler. For GHC, this means a compiler + which will generate intermediate .hc files to port to the target + architecture for bootstrapping. The libraries and stage 2 compiler + will be built as HC files for the target system (see for details. + + More details on when to use BUILD, HOST or TARGET can be found in + the comments in config.mk. + + Pattern rules and options Pattern rules @@ -3540,20 +3592,19 @@ $ make install Bootstrapping GHC on a system without GHC already installed is achieved by taking the intermediate C files (known - as HC files) from a GHC compilation on a supported system to the - target machine, and compiling them using gcc to get a working - GHC. + as HC files) from another GHC compilation, compiling them using gcc to + get a working GHC. NOTE: GHC versions 5.xx were hard to bootstrap from C. We recommend using GHC 6.0.1 or later. HC files are platform-dependent, so you have to get a set - that were generated on similar hardware. There may be some - supplied on the GHC download page, otherwise you'll have to - compile some up yourself, or start from - unregisterised HC files - see . + that were generated on the same platform. There + may be some supplied on the GHC download page, otherwise you'll have to + compile some up yourself, or start from + unregisterised HC files - see . The following steps should result in a working GHC build with full libraries: @@ -3696,7 +3747,7 @@ $ ./configure --enable-hc-boot --enable-hc-boot-unregisterised $ cd T/ghc/includes -$ make ghcconfig.h +$ make @@ -3722,14 +3773,15 @@ $ ./configure GhcUnregisterised = YES GhcLibHcOpts = -O -fvia-C -keep-hc-files +GhcRtsHcOpts = -keep-hc-files GhcLibWays = SplitObjs = NO GhcWithNativeCodeGen = NO GhcWithInterpreter = NO GhcStage1HcOpts = -O -fasm -GhcStage2HcOpts = -O -fvia-C -keep-hc-files +GhcStage2HcOpts = -O -fvia-C -keep-hc-files SRC_HC_OPTS += -H32m -GhcBootLibs = YES +GhcBootLibs = YES @@ -3755,7 +3807,7 @@ GhcBootLibs = YES Copy - T/ghc/includes/ghcconfig.h + T/ghc/includes/ghcautoconf.h to H/ghc/includes. Note that we are building on the host machine, using the @@ -3766,9 +3818,9 @@ GhcBootLibs = YES - Touch ghcconfig.h, just to make + Touch ghcautoconf.h, just to make sure it doesn't get replaced during the build: -$ touch H/ghc/includes/ghcconfig.h +$ touch H/ghc/includes/ghcautoconf.h @@ -3785,15 +3837,17 @@ $ make boot && make -$ cd H/ghc +$ cd H/ghc/compiler $ make boot stage=2 && make stage=2 - + -$ cd H/ghc/utils +$ cd H/ghc/lib +$ make clean +$ make -k UseStage1=YES EXTRA_HC_OPTS='-O -fvia-C -keep-hc-files' +$ cd H/ghc/utils $ make clean -$ make -k HC=H/ghc/compiler/stage1/ghc-inplace \ - EXTRA_HC_OPTS='-O -fvia-C -keep-hc-files' +$ make -k UseStage1=YES EXTRA_HC_OPTS='-O -fvia-C -keep-hc-files'