... | @@ -130,62 +130,69 @@ communicates these snippets of information in two ways: |
... | @@ -130,62 +130,69 @@ communicates these snippets of information in two ways: |
|
to get a list of the available arguments. Here are some of
|
|
to get a list of the available arguments. Here are some of
|
|
the ones you might need:
|
|
the ones you might need:
|
|
|
|
|
|
<table><tr><th>`--host=<platform>`</th>
|
|
|
|
|
|
<table><tr><th><tt>--host=<platform></tt></th>
|
|
<td>
|
|
<td>
|
|
Set the "host platform" (see [platform names](building/architecture/idiom/platform-names)).
|
|
Set the "host platform" (see <a href="building/architecture/idiom/platform-names">platform names</a>).
|
|
Usually only necessary if cross-compiling.
|
|
Usually only necessary if cross-compiling.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`--target=<platform>`</th>
|
|
|
|
|
|
<table><tr><th><tt>--target=<platform></tt></th>
|
|
<td>
|
|
<td>
|
|
Set the "target platform" (see [platform names](building/architecture/idiom/platform-names)).
|
|
Set the "target platform" (see <a href="building/architecture/idiom/platform-names">platform names</a>).
|
|
Usually only necessary if cross-compiling.
|
|
Usually only necessary if cross-compiling.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`--with-ghc=<path>`</th>
|
|
|
|
|
|
<table><tr><th><tt>--with-ghc=<path></tt></th>
|
|
<td>
|
|
<td>
|
|
Specifies the path to an installed GHC which you would like to use.
|
|
Specifies the path to an installed GHC which you would like to use.
|
|
This compiler will be used for compiling GHC-specific code (eg. GHC
|
|
This compiler will be used for compiling GHC-specific code (eg. GHC
|
|
itself). This option *cannot* be specified using `build.mk`
|
|
itself). This option <i>cannot</i> be specified using <tt>build.mk</tt>
|
|
(see later), because `configure` needs to auto-detect the
|
|
(see later), because <tt>configure</tt> needs to auto-detect the
|
|
version of GHC you're using. The default is to look for a compiler
|
|
version of GHC you're using. The default is to look for a compiler
|
|
named `ghc` in your `$PATH`.
|
|
named <tt>ghc</tt> in your <tt>$PATH</tt>.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`--with-gcc=<path>`</th>
|
|
|
|
|
|
<table><tr><th><tt>--with-gcc=<path></tt></th>
|
|
<td>
|
|
<td>
|
|
Specifies the path to the installed GCC. This compiler will be used
|
|
Specifies the path to the installed GCC. This compiler will be used
|
|
to compile all C files, *except* any generated by the installed
|
|
to compile all C files, <i>except</i> any generated by the installed
|
|
Haskell compiler, which will have its own idea of which C compiler
|
|
Haskell compiler, which will have its own idea of which C compiler
|
|
(if any) to use. The default is to use `gcc`. On Windows, this
|
|
(if any) to use. The default is to use <tt>gcc</tt>. On Windows, this
|
|
should be set to the gcc that comes with MinGW, which by default
|
|
should be set to the gcc that comes with MinGW, which by default
|
|
is `c:/mingw/bin/gcc`.
|
|
is <tt>c:/mingw/bin/gcc</tt>.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`--with-ld=<path>`</th>
|
|
|
|
|
|
<table><tr><th><tt>--with-ld=<path></tt></th>
|
|
<td>
|
|
<td>
|
|
Specifies which `ld` program to use. Normally only necessary on
|
|
Specifies which <tt>ld</tt> program to use. Normally only necessary on
|
|
Windows, where you should set it to the `ld` that comes with MinGW,
|
|
Windows, where you should set it to the <tt>ld</tt> that comes with MinGW,
|
|
which is usually `c:/mingw/bin/ld`.
|
|
which is usually <tt>c:/mingw/bin/ld</tt>.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`--prefix`</th>
|
|
|
|
|
|
<table><tr><th><tt>--prefix</tt></th>
|
|
<td>
|
|
<td>
|
|
Tells the build system where you would like GHC to be eventually
|
|
Tells the build system where you would like GHC to be eventually
|
|
installed. You don't have to install GHC in order to use it: it is
|
|
installed. You don't have to install GHC in order to use it: it is
|
|
entirely possible to work on GHC and test it without ever modifying
|
|
entirely possible to work on GHC and test it without ever modifying
|
|
anything outside the build tree. However, if you do want to install
|
|
anything outside the build tree. However, if you do want to install
|
|
GHC, then the `--prefix` directory is the root of the install tree.
|
|
GHC, then the <tt>--prefix</tt> directory is the root of the install tree.
|
|
Typically on Unix systems the default for `--prefix` is
|
|
Typically on Unix systems the default for <tt>--prefix</tt> is
|
|
`/usr/local`. See also [Building/Installing](building/installing) for more details.
|
|
<tt>/usr/local</tt>. See also <a href="building/installing">Building/Installing</a> for more details.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`--enable-tarballs-autodownload`</th>
|
|
|
|
|
|
<table><tr><th><tt>--enable-tarballs-autodownload</tt></th>
|
|
<td>
|
|
<td>
|
|
On Windows in order to build GHC and to be able to create a binary
|
|
On Windows in order to build GHC and to be able to create a binary
|
|
distribution package some extra binaries are needed. These binaries
|
|
distribution package some extra binaries are needed. These binaries
|
|
only have to be downloaded once. This flag serves as
|
|
only have to be downloaded once. This flag serves as
|
|
[ consent](https://phabricator.haskell.org/D339#7799) to allow the
|
|
<a href="https://phabricator.haskell.org/D339#7799"> consent</a> to allow the
|
|
automatic download of dependencies if they are missing. It is
|
|
automatic download of dependencies if they are missing. It is
|
|
fine to leave the flag in even if you already have the tarballs.
|
|
fine to leave the flag in even if you already have the tarballs.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
... | @@ -193,8 +200,9 @@ fine to leave the flag in even if you already have the tarballs. |
... | @@ -193,8 +200,9 @@ fine to leave the flag in even if you already have the tarballs. |
|
### Build configuration
|
|
### Build configuration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Next, you say how this build of GHC is to differ from the standard
|
|
Next, you say how this build of GHC is to differ from the standard
|
|
defaults by creating a new file `mk/build.mk`*in the build tree*.
|
|
defaults by creating a new file `mk/build.mk` *in the build tree*.
|
|
This file is the one and only file you edit in the build tree,
|
|
This file is the one and only file you edit in the build tree,
|
|
precisely because it says how this build differs from the source.
|
|
precisely because it says how this build differs from the source.
|
|
(Just in case your build tree does die, you might want to keep a
|
|
(Just in case your build tree does die, you might want to keep a
|
... | @@ -223,139 +231,149 @@ The following are some common variables that you might want to set in |
... | @@ -223,139 +231,149 @@ The following are some common variables that you might want to set in |
|
your `mk/build.mk`. For other variables that you can override,
|
|
your `mk/build.mk`. For other variables that you can override,
|
|
take a look in [mk/config.mk.in](/trac/ghc/browser/ghc/mk/config.mk.in).
|
|
take a look in [mk/config.mk.in](/trac/ghc/browser/ghc/mk/config.mk.in).
|
|
|
|
|
|
<table><tr><th>`SRC_HC_OPTS`</th>
|
|
|
|
<td>
|
|
|
|
(default: `-H32m -O`)
|
|
|
|
|
|
|
|
|
|
<table><tr><th><tt>SRC_HC_OPTS</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>-H32m -O</tt>)<br>
|
|
Options passed to GHC for all Haskell compilations.
|
|
Options passed to GHC for all Haskell compilations.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcHcOpts`</th>
|
|
|
|
<td>
|
|
|
|
(default: `-Rghc-timing`)
|
|
|
|
|
|
|
|
|
|
<table><tr><th><tt>GhcHcOpts</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>-Rghc-timing</tt>)<br>
|
|
Options added when compiling GHC (all
|
|
Options added when compiling GHC (all
|
|
[stages](building/architecture/idiom/stages))
|
|
<a href="building/architecture/idiom/stages">stages</a>)
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
> `-Rghc-timing` prints out a line of timing info about each compilation. It is not set when `V=0`, but handy to keep an eye on otherwise.
|
|
> `-Rghc-timing` prints out a line of timing info about each compilation. It is not set when `V=0`, but handy to keep an eye on otherwise.
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
<table><tr><th>`GhcStage1HcOpts`</th>
|
|
<table><tr><th><tt>GhcStage1HcOpts</tt></th>
|
|
<td>
|
|
<td>
|
|
(default: *empty*)
|
|
(default: <i>empty</i>)<br>
|
|
|
|
|
|
Options added when compiling the stage 1 GHC.
|
|
Options added when compiling the stage 1 GHC.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcStage2HcOpts`</th>
|
|
|
|
<td>
|
|
|
|
(default: `-O2`)
|
|
|
|
|
|
|
|
|
|
<table><tr><th><tt>GhcStage2HcOpts</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>-O2</tt>)<br>
|
|
Options added when compiling the stage 2 GHC.
|
|
Options added when compiling the stage 2 GHC.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcStage3HcOpts`</th>
|
|
|
|
<td>
|
|
|
|
(default: `-O2`)
|
|
|
|
|
|
|
|
|
|
<table><tr><th><tt>GhcStage3HcOpts</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>-O2</tt>)<br>
|
|
Options added when compiling the stage 3 GHC.
|
|
Options added when compiling the stage 3 GHC.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcLibHcOpts`</th>
|
|
|
|
<td>
|
|
|
|
(default: `-O2`)
|
|
|
|
|
|
|
|
|
|
<table><tr><th><tt>GhcLibHcOpts</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>-O2</tt>)<br>
|
|
Options added when compiling the libraries.
|
|
Options added when compiling the libraries.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcProfiled`</th>
|
|
|
|
<td>
|
|
|
|
(default: `NO`)
|
|
|
|
|
|
|
|
Set to `YES` to enable profiling for GHC itself (stage 2). You'll also need to add `GhcLibWays += p` to make this work.
|
|
<table><tr><th><tt>GhcProfiled</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>NO</tt>)<br>
|
|
|
|
Set to <tt>YES</tt> to enable profiling for GHC itself (stage 2). You'll also need to add <tt>GhcLibWays += p</tt> to make this work.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcDebugged`</th>
|
|
|
|
<td>
|
|
|
|
(default: `NO`)
|
|
|
|
|
|
|
|
Set to `YES` to pass `-debug` when building GHC (stage 1, 2 and 3).
|
|
<table><tr><th><tt>GhcDebugged</tt></th>
|
|
This links GHC (stage 1, 2 and 3) with the [debugging RTS](debugging/runtime-system).
|
|
<td>
|
|
(It does not imply `GhcStage2HcOpts+=-DDEBUG`, see below for that)
|
|
(default: <tt>NO</tt>)<br>
|
|
|
|
Set to <tt>YES</tt> to pass <tt>-debug</tt> when building GHC (stage 1, 2 and 3).
|
|
|
|
This links GHC (stage 1, 2 and 3) with the <a href="debugging/runtime-system">debugging RTS</a>.
|
|
|
|
(It does not imply <tt>GhcStage2HcOpts+=-DDEBUG</tt>, see below for that)
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcLibWays`</th>
|
|
|
|
<td>
|
|
|
|
(default: `v p`)
|
|
|
|
|
|
|
|
|
|
<table><tr><th><tt>GhcLibWays</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>v p</tt>)<br>
|
|
Ways in which to build the libraries. Must contain
|
|
Ways in which to build the libraries. Must contain
|
|
at least `v` ([the vanilla way](building/architecture/idiom/vanilla-way)). Also contains `p` by default (profiling). For other
|
|
at least <tt>v</tt> (<a href="building/architecture/idiom/vanilla-way">the vanilla way</a>). Also contains <tt>p</tt> by default (profiling). For other
|
|
ways, see `mk/ways.mk`.
|
|
ways, see <tt>mk/ways.mk</tt>.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`SplitObjs`</th>
|
|
|
|
<td>
|
|
|
|
(default: `YES` if supported, `NO` otherwise)
|
|
|
|
|
|
|
|
When set to `YES`, static library object files are split into smaller
|
|
<table><tr><th><tt>SplitObjs</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>YES</tt> if supported, <tt>NO</tt> otherwise)<br>
|
|
|
|
When set to <tt>YES</tt>, static library object files are split into smaller
|
|
pieces. This means that less of the library code needs to be linked
|
|
pieces. This means that less of the library code needs to be linked
|
|
into the final application, which makes smaller binaries. It takes
|
|
into the final application, which makes smaller binaries. It takes
|
|
longer to build libraries this way, though.
|
|
longer to build libraries this way, though.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`LAX_DEPENDENCIES`</th>
|
|
|
|
<td>
|
|
|
|
(default: `NO`)
|
|
|
|
|
|
|
|
When set to `YES`, dependencies on the ghc executable will be turned into
|
|
<table><tr><th><tt>LAX_DEPENDENCIES</tt></th>
|
|
order-only dependencies (c.f. [ relevant make documentation](http://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html)).
|
|
<td>
|
|
|
|
(default: <tt>NO</tt>)<br>
|
|
|
|
When set to <tt>YES</tt>, dependencies on the ghc executable will be turned into
|
|
|
|
order-only dependencies (c.f. <a href="http://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html"> relevant make documentation</a>).
|
|
What this means in practice is that less needless recompilation will be
|
|
What this means in practice is that less needless recompilation will be
|
|
done while you are making changes to ghc's sources, but for certain types
|
|
done while you are making changes to ghc's sources, but for certain types
|
|
of changes it means the build will fail.
|
|
of changes it means the build will fail.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`HADDOCK_DOCS`</th>
|
|
|
|
<td>
|
|
|
|
(default: `YES`)
|
|
|
|
|
|
|
|
Build `haddock` and run it on the compiler and libraries source?
|
|
<table><tr><th><tt>HADDOCK_DOCS</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>YES</tt>)<br>
|
|
|
|
Build <tt>haddock</tt> and run it on the compiler and libraries source?
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`BUILD_SPHINX_HTML`</th>
|
|
|
|
<td></td></tr>
|
|
|
|
<tr><th>`BUILD_SPHINX_PDF`</th>
|
|
|
|
<td>
|
|
|
|
(default: `YES` if supported, `NO` otherwise)
|
|
|
|
|
|
|
|
When set to `YES`, these build the sphinx documentation (e.g. the
|
|
<table><tr><th><tt>BUILD_SPHINX_HTML</tt></th>
|
|
|
|
<td>
|
|
|
|
</td></tr>
|
|
|
|
<tr><th><tt>BUILD_SPHINX_PDF</tt></th>
|
|
|
|
<td>
|
|
|
|
(default: <tt>YES</tt> if supported, <tt>NO</tt> otherwise)<br>
|
|
|
|
When set to <tt>YES</tt>, these build the sphinx documentation (e.g. the
|
|
users guide) as HTML and PDF respectively.
|
|
users guide) as HTML and PDF respectively.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`INTEGER_LIBRARY`</th>
|
|
|
|
|
|
<table><tr><th><tt>INTEGER_LIBRARY</tt></th>
|
|
<td>
|
|
<td>
|
|
By default this is set to `integer-gmp`, which means Integer is implemented
|
|
By default this is set to <tt>integer-gmp</tt>, which means Integer is implemented
|
|
on top of the C GMP library. If you set it to `integer-simple` then a
|
|
on top of the C GMP library. If you set it to <tt>integer-simple</tt> then a
|
|
simple, BSD-licensed Haskell implementation will be used instead.
|
|
simple, BSD-licensed Haskell implementation will be used instead.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`BUILD_DPH`</th>
|
|
|
|
|
|
<table><tr><th><tt>BUILD_DPH</tt></th>
|
|
<td>
|
|
<td>
|
|
(default: `NO`)
|
|
(default: <tt>NO</tt>)
|
|
Enable building of DPH libraries (no longer supported since GHC 8.6)
|
|
Enable building of DPH libraries (no longer supported since GHC 8.6)
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`BUILD_EXTRA_PKGS`</th>
|
|
|
|
|
|
<table><tr><th><tt>BUILD_EXTRA_PKGS</tt></th>
|
|
<td>
|
|
<td>
|
|
(default: `NO`)
|
|
(default: <tt>NO</tt>)
|
|
Enable building of the extra libraries: those packages that have an `'extra'` tag in the `./packages` file. To quick way to see what those packages are, is to run `make show VALUE=PACKAGES_STAGE2 BUILD_EXTRA_PKGS=YES` (although `BUILD_DPH=YES` adds packages to that list as well).
|
|
Enable building of the extra libraries: those packages that have an <tt>'extra'</tt> tag in the <tt>./packages</tt> file. To quick way to see what those packages are, is to run <tt>make show VALUE=PACKAGES_STAGE2 BUILD_EXTRA_PKGS=YES</tt> (although <tt>BUILD_DPH=YES</tt> adds packages to that list as well).
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`V`</th>
|
|
|
|
|
|
<table><tr><th><tt>V</tt></th>
|
|
<td>
|
|
<td>
|
|
(default: `1`)
|
|
(default: <tt>1</tt>)
|
|
Set `V=0` to get prettier build output. See [Building/Using\#Verbosebuild](building/using#verbose-build) below.
|
|
Set <tt>V=0</tt> to get prettier build output. See <a href="building/using#verbose-build">Building/Using#Verbosebuild</a> below.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
|
|
|
|
## Building things
|
|
## Building things
|
|
|
|
|
|
|
|
|
... | @@ -401,12 +419,15 @@ Here is a high level view of what happens when you build GHC: |
... | @@ -401,12 +419,15 @@ Here is a high level view of what happens when you build GHC: |
|
from source code in `ghc/`. This source code is just a small Haskell
|
|
from source code in `ghc/`. This source code is just a small Haskell
|
|
program that depends on package `ghc`.
|
|
program that depends on package `ghc`.
|
|
|
|
|
|
|
|
>
|
|
>
|
|
>
|
|
> The resulting executable is
|
|
> The resulting executable is
|
|
> called the "stage 1" compiler (see
|
|
> called the "stage 1" compiler (see
|
|
> [stages](building/architecture/idiom/stages)). You can run the
|
|
> [stages](building/architecture/idiom/stages)). You can run the
|
|
> stage 1 compiler by invoking `inplace/bin/ghc-stage1`. The stage 1
|
|
> stage 1 compiler by invoking `inplace/bin/ghc-stage1`. The stage 1
|
|
> build of GHC happens in `compiler/stage1`.
|
|
> build of GHC happens in `compiler/stage1`.
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
- The stage 1 compiler is now used to build all the packages in the
|
|
- The stage 1 compiler is now used to build all the packages in the
|
|
`libraries` subdirectory, and the runtime system in `rts`.
|
|
`libraries` subdirectory, and the runtime system in `rts`.
|
... | @@ -515,48 +536,60 @@ In the `build.mk` file, select `BuildFlavour = devel2` to make the |
... | @@ -515,48 +536,60 @@ In the `build.mk` file, select `BuildFlavour = devel2` to make the |
|
build fast, and suitable for working on the stage2 compiler.
|
|
build fast, and suitable for working on the stage2 compiler.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Here's the reasoning behind some of the `devel2` settings:
|
|
Here's the reasoning behind some of the `devel2` settings:
|
|
|
|
|
|
<table><tr><th>`GhcStage1HcOpts = -O`</th>
|
|
|
|
|
|
<table><tr><th><tt>GhcStage1HcOpts = -O</tt></th>
|
|
<td>
|
|
<td>
|
|
Build stage 1 optimised: we're going to be rebuilding stage 2 a lot,
|
|
Build stage 1 optimised: we're going to be rebuilding stage 2 a lot,
|
|
so we want the compiler that does the building to be fast.
|
|
so we want the compiler that does the building to be fast.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcStage2HcOpts = -O0 -DDEBUG`</th>
|
|
|
|
|
|
<table><tr><th><tt>GhcStage2HcOpts = -O0 -DDEBUG</tt></th>
|
|
<td>
|
|
<td>
|
|
We turn off optimisation here, assuming you'll be modifying and
|
|
We turn off optimisation here, assuming you'll be modifying and
|
|
testing stage 2. With optimisation off, rebuilding GHC after
|
|
testing stage 2. With optimisation off, rebuilding GHC after
|
|
modifying it will be *much* quicker, not only because the
|
|
modifying it will be <i>much</i> quicker, not only because the
|
|
individual compilations will be quicker, but also there will be
|
|
individual compilations will be quicker, but also there will be
|
|
fewer dependencies between modules, so much less stuff is recompiled
|
|
fewer dependencies between modules, so much less stuff is recompiled
|
|
after each modification.
|
|
after each modification.
|
|
|
|
<br><br>
|
|
Also we turn on `-DDEBUG`, because that enables assertions and
|
|
Also we turn on <tt>-DDEBUG</tt>, because that enables assertions and
|
|
debugging code in the compiler itself (Haskell source files only,
|
|
debugging code in the compiler itself (Haskell source files only,
|
|
use `GhcDebugged=YES` to link GHC with the debugging RTS, see above).
|
|
use <tt>GhcDebugged=YES</tt> to link GHC with the debugging RTS, see above).
|
|
Turning on DEBUG makes the compiler about 30% slower.
|
|
Turning on DEBUG makes the compiler about 30% slower.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
<table><tr><th>`GhcLibHcOpts = -O -dcore-lint`</th>
|
|
|
|
|
|
<table><tr><th><tt>GhcLibHcOpts = -O -dcore-lint</tt></th>
|
|
<td>
|
|
<td>
|
|
You almost certainly want optimisation *on* when building
|
|
You almost certainly want optimisation <i>on</i> when building
|
|
libraries, otherwise the code you build with this compiler
|
|
libraries, otherwise the code you build with this compiler
|
|
goes really slowly.
|
|
goes really slowly.
|
|
|
|
<br><br>
|
|
When building the libraries, also turn on heavyweight intra-pass
|
|
When building the libraries, also turn on heavyweight intra-pass
|
|
sanity-checking within GHC, at the Core level.
|
|
sanity-checking within GHC, at the Core level.
|
|
</td></tr></table>
|
|
</td></tr></table>
|
|
|
|
|
|
|
|
|
|
### Working on an optimized stage 2 compiler.
|
|
### Working on an optimized stage 2 compiler.
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
>
|
|
>
|
|
> If you are going to rebuild an optimized stage 2 compiler more often
|
|
> If you are going to rebuild an optimized stage 2 compiler more often
|
|
> you should use -O2 to speed up the build.
|
|
> you should use -O2 to speed up the build.
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
>
|
|
>
|
|
>
|
|
> A full build with `GhcStage1HcOpts = -O2` and `GhcStage2HcOpts = -O` will be slower by \~3% than the default.
|
|
> A full build with `GhcStage1HcOpts = -O2` and `GhcStage2HcOpts = -O` will be slower by \~3% than the default.
|
|
> But each rebuild off stage2 afterwards will be faster.
|
|
> But each rebuild off stage2 afterwards will be faster.
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
### Building a single sub-component
|
|
### Building a single sub-component
|
|
|
|
|
... | @@ -704,10 +737,15 @@ You will then be able to run `make 3`. |
... | @@ -704,10 +737,15 @@ You will then be able to run `make 3`. |
|
## Verbose build
|
|
## Verbose build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
From [Design/BuildSystem](design/build-system):
|
|
From [Design/BuildSystem](design/build-system):
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|
>
|
|
>
|
|
> "The build system should clearly report what it's doing (and sometimes why), without being too verbose. It should emit actual command lines as much as possible, so that they can be inspected and cut & pasted."
|
|
> "The build system should clearly report what it's doing (and sometimes why), without being too verbose. It should emit actual command lines as much as possible, so that they can be inspected and cut & pasted."
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
That's why, by default, the build log is printed with the full command lines that are being used, so you can copy/paste and rerun them on build failures/warnings.
|
|
That's why, by default, the build log is printed with the full command lines that are being used, so you can copy/paste and rerun them on build failures/warnings.
|
... | | ... | |