X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fbuilding%2Fbuilding.xml;h=b67525fb87f3034a6209f935993c05420841b6a0;hb=bfdd44b2bfec3d819fd5ce19279832c25f096bb4;hp=3affc087ab5df3620053ad25d1cb4456ae6b0bb3;hpb=31b36891326ccace3f9d7d29ae036628069ce7da;p=ghc-hetmet.git diff --git a/docs/building/building.xml b/docs/building/building.xml index 3affc08..b67525f 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 @@ -3650,6 +3650,13 @@ $ make install Cross-compiling to produce an unregisterised GHC + NOTE! These instructions apply to GHC 6.4 and (hopefully) + later. If you need instructions for an earlier version of GHC, try + to get hold of the version of this document that was current at the + time. It should be available from the appropriate download page on + the GHC homepage. + In this section, we explain how to bootstrap GHC on a new platform, using unregisterised intermediate C files. We haven't put a great deal of effort into automating this @@ -3689,7 +3696,7 @@ $ ./configure --enable-hc-boot --enable-hc-boot-unregisterised $ cd T/ghc/includes -$ make config.h +$ make ghcconfig.h @@ -3714,13 +3721,16 @@ $ ./configure with the following contents: GhcUnregisterised = YES -GhcLibHcOpts = -O -H32m -keep-hc-files +GhcLibHcOpts = -O -fvia-C -keep-hc-files +GhcRtsHcOpts = -keep-hc-files GhcLibWays = SplitObjs = NO GhcWithNativeCodeGen = NO GhcWithInterpreter = NO -GhcStage1HcOpts = -O -H32m -fasm -GhcStage2HcOpts = -O -fvia-C -keep-hc-files +GhcStage1HcOpts = -O -fasm +GhcStage2HcOpts = -O -fvia-C -keep-hc-files +SRC_HC_OPTS += -H32m +GhcBootLibs = YES @@ -3746,7 +3756,7 @@ GhcStage2HcOpts = -O -fvia-C -keep-hc-files Copy - T/ghc/includes/config.h + T/ghc/includes/ghcconfig.h to H/ghc/includes. Note that we are building on the host machine, using the @@ -3757,9 +3767,9 @@ GhcStage2HcOpts = -O -fvia-C -keep-hc-files - Touch config.h, just to make + Touch ghcconfig.h, just to make sure it doesn't get replaced during the build: -$ touch H/ghc/includes/config.h +$ touch H/ghc/includes/ghcconfig.h @@ -3776,15 +3786,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 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' +$ cd H/ghc/utils +$ make clean +$ make -k UseStage1=YES EXTRA_HC_OPTS='-O -fvia-C -keep-hc-files' @@ -4317,6 +4329,24 @@ Cygwin programs have a more complicated mount table, and map the lettered drives +Crippled <command>ld</command> + + +It turns out that on both Cygwin and MSYS, the ld has a +limit of 32kbytes on its command line. Especially when using split object +files, the make system can emit calls to ld with thousands +of files on it. Then you may see something like this: + +(cd Graphics/Rendering/OpenGL/GL/QueryUtils_split && /mingw/bin/ld -r -x -o ../QueryUtils.o *.o) +/bin/sh: /mingw/bin/ld: Invalid argument + +The solution is either to switch off object file splitting (set + to NO in your +build.mk), +or to make the module smaller. + + + Host System vs Target System @@ -4424,7 +4454,11 @@ Run both executables (in the order given above) to install them. I put them in Set the following environment variables - PATH: add c:/msys/1.0/bin to your path. (Of course, the version number may differ.) + PATH: add c:/msys/1.0/bin and + c:/msys/1.0/local/bin + to your path. (Of course, the version number may differ.) + MSYS mounts the former as both /bin and + /usr/bin and the latter as /usr/local/bin. HOME: set to your home directory (e.g. c:/userid). @@ -4695,7 +4729,7 @@ Make sure the installation directory is in your - Install Alex. This can be done by building from the + Install an executable Alex. This can be done by building from the source distribution in the same way as Happy. Sources are available from http://www.haskell.org/alex. @@ -4708,7 +4742,13 @@ Just pick up a mingw bundle at http://www.mingw.org/. We install it in c:/mingw. -Do not add any of the mingw binaries to your path. + +On MSYS, add c:/mingw/bin to your PATH. MSYS does not provide gcc, +ld, ar, and so on, because it just uses the MinGW ones. So you need them +in your path. + + +On Cygwin, do not add any of the mingw binaries to your path. They are only going to get used by explicit access (via the --with-gcc flag you give to configure later). If you do add them to your path you are likely to get into a mess because their names overlap with Cygwin binaries.