Flag referenceThis section is a quick-reference for GHC's command-line
flags. For each flag, we also list its static/dynamic status (see
), and the flag's opposite
(if available).Help and verbosity options ()FlagDescriptionStatic/DynamicReversehelpstatic-helpstatic-verbose mode (equivalent to )dynamic-nset verbosity leveldynamic-display GHC versionstatic-display GHC versionstatic-display GHC version (numeric only)static-display GHC library directorystatic-Which phases to run ()FlagDescriptionStatic/DynamicReverseStop after preprocessing (.hspp file)static-Stop after generating C (.hc file)static-Stop after generating assembly (.s file)static-Stop after compiling to object code (.o file)static-Redirecting output ()FlagDescriptionStatic/DynamicReversesuffixset the suffix to use for intermediate C filesstatic-dirset directory for interface filesstatic-suffixset the suffix to use for interface filesstatic-filenameset output filenamestatic-dirset output directorystatic-filenameset the filename in which to put the interfacestaticsuffixset the output file suffixstatic-Keeping intermediate files ()FlagDescriptionStatic/DynamicReverseretain intermediate .hc filesstatic-retain intermediate .s filesstatic-retain intermediate .raw_s filesstatic-retain all intermediate temporary filesstatic-Temporary files ()FlagDescriptionStatic/DynamicReverseset the directory for temporary filesstatic-Finding imports ()FlagDescriptionStatic/DynamicReversedir1:dir2:...add dir,
dir2, etc. to import pathstatic-Empty the import directory liststatic-Interface file options ()FlagDescriptionStatic/DynamicReverseDump the new interface to stdoutdynamic-Show the differences vs. the old interfacedynamic-Dump a minimal set of importsdynamic-fileRead the interface in
file and dump it as text to
stdout.static-Recompilation checking ()FlagDescriptionStatic/DynamicReverseTurn off recompilation checkingstaticInteractive-mode options ()FlagDescriptionStatic/DynamicReverseDisable reading of .ghci filesstatic-Enable reading of .ghci filesstatic-Packages ()FlagDescriptionStatic/DynamicReversenameUse package namestatic-fileLoad more packages from filestatic-nameCompile code for package namestatic-Language options ()FlagDescriptionStatic/DynamicReverseEnable overlapping instancesdynamicEnable arrow notation extensiondynamicEnable undecidable instancesdynamicnset the limit for context reductionstatic or Enable foreign function interface (implied by
)dynamicEnable genericsdynamicEnable most language extensionsdynamicIgnore assertionsdynamicEnable Implicit ParametersdynamicMake tuple pattern matching irrefutabledynamicDon't implicitly import Preludedynamic-Disable the monomorphism restrictiondynamicEnable Template HaskelldynamicWarnings ()FlagDescriptionStatic/DynamicReverseenable normal warningsdynamicdisable all warningsdynamic-enable all warningsdynamicmake warnings fataldynamicwarn about uses of functions & types that are deprecateddynamicwarn when an entity is exported multiple timesdynamicwarn when a .hi file in the
current directory shadows a librarydynamicwarn when a pattern match could faildynamicenable miscellaneous warningsdynamicwarn when fields of a record are uninitialiseddynamicwarn when class methods are undefineddynamicwarn about top-level functions without signaturesdynamicwarn when names are shadoweddynamicwarn about overlapping patternsdynamicwarn about lambda-patterns that can faildynamicwarn when defaulting happensdynamicwarn about bindings that are unuseddynamicwarn about unnecessary importsdynamicwarn about variables in patterns that aren't useddynamicOptimisation levels ()FlagDescriptionStatic/DynamicReverseEnable default optimisation (level 1)dynamicnSet optimisation level ndynamicIndividual optimisations ()FlagDescriptionStatic/DynamicReverseEnable case-mergingdynamicMake dictionaries strictstaticEnable eta-reductiondynamicEnable lambda eta-reductiondynamicEnable excess intermediate precisionstaticSwitch off all rewrite rules (including rules
generated by automatic specialisation of overloaded functions)staticIgnore assertions in the sourcestaticIgnore pragmas in interface filesstaticTweak the liberate-case optimisation (default: 10)staticDon't generate interface pragmasdynamicIf a worker has that many arguments, none will be
unpacked anymore (default: 10)static-Set the max iterations for the simplifierdynamic-Turn off the "state hack" whereby any lambda with a real-world state token
as argument is considered to be single-entry. Hence OK to inline things inside it.static-Turn off CPR analysisstatic-fcprTurn off common sub-expressiondynamic-Turn off full laziness (floating bindings outwards). It is on by default.dynamic-ffull-lazinessTurn off pre-inliningstatic-Turn off strictness analysisdynamic-Make numbers strictdynamicFlatten strict constructor fieldsdynamicTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticTweak unfolding settingsstaticProfiling options ()FlagDescriptionStatic/DynamicReverseAuto-add _scc_s to all
exported functionsstaticAuto-add _scc_s to all
top-level functionsstaticAuto-add _scc_s to all dictionariesstaticAuto-add _scc_s to all CAFsstaticTurn on profilingstatic-Turn on ticky-ticky profilingstatic-Parallelism options ()FlagDescriptionStatic/DynamicReverseEnable GRANSIMstatic-Enable Parallel Haskellstatic-Enable SMP supportstatic-C pre-processor options ()FlagDescriptionStatic/DynamicReverseRun the C pre-processor on Haskell source filesdynamic-symbol=valueDefine a symbol in the C pre-processordynamicsymbolsymbolUndefine a symbol in the C pre-processordynamic-dirAdd dir to the
directory search list for #include filesstatic-C compiler options ()FlagDescriptionStatic/DynamicReversefileInclude file when
compiling the .hc filedynamic-Code generation options ()FlagDescriptionStatic/DynamicReverseUse the native code generatordynamic-fvia-CCompile via Cdynamic-fasmOmit code generationstatic-Linking options ()FlagDescriptionStatic/DynamicReverseUse dynamic Haskell libraries (if available)static-nameOn Darwin/MacOS X only, link in the framework name.
This option corresponds to the option for Apple's Linker.static-nameOn Darwin/MacOS X only, add dir to the list of
directories searched for frameworks.
This option corresponds to the option for Apple's Linker.static-libLink in library libstatic-dirAdd dir to the list of
directories searched for librariesstatic-Set main functionstatic-Don't asssume this program contains mainstatic-Omit linkingstatic-nameLink in package namestatic-Split objects (for libraries)static-Use static Haskell librariesstatic-Use the threaded runtimestatic-Use the debugging runtimestatic-Replacing phases ()FlagDescriptionStatic/DynamicReversecmdUse cmd as the literate pre-processorstatic-cmdUse cmd as the C
pre-processor (with only)static-cmdUse cmd as the C compilerstatic-cmdUse cmd as the assemblerstatic-cmdUse cmd as the linkerstatic-cmdUse cmd as the DLL generatorstatic-cmdUse cmd as the dependency generatorstatic-cmdUse cmd as the pre-processor
(with only)static-Forcing options to particular phases ()FlagDescriptionStatic/DynamicReverseoptionpass option to the literate pre-processordynamic-optionpass option to cpp (with
only)dynamic-optionpass option to the
custom pre-processordynamic-optionpass option to the C compilerdynamic-optionpass option to the assemblerdynamic-optionpass option to the linkerstatic-optionpass option to the DLL generatorstatic-optionpass option to the dependency generatorstatic-Platform-specific options ()FlagDescriptionStatic/DynamicReverse(SPARC only) enable version 8 supportstatic-(x86 only) give some registers back to the C compilerdynamic-External core file options ()FlagDescriptionStatic/DynamicReverseGenerate .hcr external Core filesstatic-Compiler debugging options ()FlagDescriptionStatic/DynamicReverseTurn on internal sanity checkingdynamic-Dump abstract Cdynamic-Dump assemblydynamic-Dump interpreter byte codedynamic-Dump output from CPR analysisdynamic-Dump CSE outputdynamic-Dump deriving outputdynamic-Dump desugarer outputdynamic-Dump “flat” Cdynamic-Dump foreign export stubsdynamic-Dump inlining infodynamic-Dump occurrence analysis outputdynamic-Dump parse treedynamic-Dump “real” Cdynamic-Dump renamer outputdynamic-Dump rulesdynamic-Dump saturated outputdynamic-Dump final simplifier outputdynamic-Dump output from each simplifier iterationdynamic-Dump specialiser outputdynamic-Dump final STGdynamic-Dump strictness analyser outputdynamic-Dump typechecker outputdynamic-Dump type signaturesdynamic-Dump UsageSP analysis outputdynamic-Dump worker-wrapper outputdynamic-Trace renamerdynamic-Renamer statsdynamic-Native code generator intermediate formdynamic-Dump simplifier statsdynamic-Turn on debug printing (more verbose)static-Don't output pragma info in dumpsstatic-Set the depth for printing expressions in error msgsstatic-Dump haskell source statsdynamic-STG pass sanity checkingdynamic-Dump STG statsdynamic-UsageSP sanity checkerdynamic-Show output from each core-to-core passdynamic-Show output from each STG-to-STG passdynamic-Enable unregisterised compilationstatic-Misc compiler optionsFlagDescriptionStatic/DynamicReverse???static-Make all top-level names global (for )static-Don't complain about .hi file mismatchesstatic-Turn off black holing (probably doesn't work)static-Don't share specialisations of overloaded functionsstatic-Renamer: don't prune declarationsstatic-Set simplification history sizestatic-Unregisterised compilation (use instead)static-Turn off assembly mangling (use instead)static-