# Build flavours Hadrian supports a few predefined _build flavours_, i.e. collections of build settings that fully define a GHC build (see `src/Flavour.hs`). Users can add their own build flavours if need be, as described [here](https://gitlab.haskell.org/ghc/ghc/blob/master/hadrian/doc/user-settings.md#build-flavour). ## Arguments The following table summarises extra arguments passed to GHC in different build flavours. There are four groups of arguments: arguments in `hsDefault` are passed to GHC for all Haskell source files, `hsLibrary` arguments are added when compiling libraries, `hsCompiler` when compiling the `compiler` library, and `hsGhc` when compiling/linking the GHC program.
Flavour Extra arguments
hsDefault hsLibrary hsCompiler hsGhc
stage0 stage1+ stage0 stage1+ stage0 stage1+ stage0 stage1+
default
-O
-H32m
-O2
-H32m
-haddock
quick -O0
-H64m
-O0
-H64m
-O -O2 -O -O
quick-validate -O0
-H64m
-Werror
-O0
-H64m
-Werror
-O -O2 -O -O
quick-debug -O0
-H64m
-O0
-H64m
-O -O2 -O -O -debug (link)
quickest -O0
-H64m
-O0
-H64m
-O -O
perf -O
-H64m
-O
-H64m
-O2 -O2 -O2 -O -O2
prof -O0
-H64m
-O0
-H64m
-O -O2 -O -O
bench -O
-H64m
-O
-H64m
-O2 -O2 -O0 -O2 -O2
devel1 -O
-H64m
-O
-H64m
-dcore-lint -O0
-DDEBUG
-O0
-DDEBUG
devel2 -O
-H64m
-O
-H64m
-dcore-lint -O2 -O0
-DDEBUG
-O0
-DDEBUG
validate -O0
-H64m
-fllvm-fill-undef-with-garbage -O
-dcore-lint
-dno-debug-output
-O2
-DDEBUG
-O
-dcore-lint
-dno-debug-output
-O -O
slow-validate -O0
-H64m
-fllvm-fill-undef-with-garbage -O
-dcore-lint
-dno-debug-output
-O2
-DDEBUG
-O
-DDEBUG
-dcore-lint
-dno-debug-output
-O -O
### LLVM variants In addition to the above, there are LLVM variants for the flavours `quick`, `prof`, `perf` and `bench`, available by appending a `-llvm` suffix (i.e., `quick-llvm` for the LLVM variant of `quick`). These differ only in that there is an additional `-fllvm` flag in `hsDefault` when the stage0 compiler is GHC. See `src/Settings/Flavours/Llvm.hs` for details. ## Ways Libraries and GHC can be built in different _ways_, e.g. with or without profiling information. The following table lists ways that are built in different flavours.
Flavour Library ways RTS ways Profiled GHC
stage0 stage1+ stage0 stage1+ stage0 stage1+
default
perf
prof
devel1
devel2
perf-llvm
prof-llvm
vanilla vanilla
profiling
dynamic
logging
debug
threaded
threadedDebug
threadedLogging
debugDynamic
threadedDynamic
threadedDebugDynamic
loggingDynamic
threadedLoggingDynamic
logging
debug
threaded
threadedDebug
threadedLogging
threadedProfiling
debugDynamic
threadedDynamic
threadedDebugDynamic
loggingDynamic
threadedLoggingDynamic
Only in
prof
flavour
Only in
prof
flavour
quick
quick-llvm
quick-validate
quick-debug
vanilla vanilla
dynamic
logging
debug
threaded
threadedDebug
threadedLogging
debugDynamic
threadedDynamic
threadedDebugDynamic
loggingDynamic
threadedLoggingDynamic
logging
debug
threaded
threadedDebug
threadedLogging
debugDynamic
threadedDynamic
threadedDebugDynamic
loggingDynamic
threadedLoggingDynamic
No No
quickest
bench
vanilla vanilla vanilla
threaded
vanilla
threaded
No No