Flag reference This 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 (<xref linkend="options-help">) Flag Description Static/Dynamic Reverse help static - help static - verbose mode (equivalent to ) dynamic - n set verbosity level dynamic - display GHC version static - display GHC version (numeric only) static - Which phases to run (<xref linkend="options-order">) Flag Description Static/Dynamic Reverse Stop 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 (<xref linkend="options-output">) Flag Description Static/Dynamic Reverse suffix set the suffix to use for interface files static - filename set output filename static - dir set output directory static - filename set the filename in which to put the interface static suffix set the output file suffix static - Keeping intermediate files (<xref linkend="keeping-intermediates">) Flag Description Static/Dynamic Reverse retain intermediate .hc files static - retain intermediate .s files static - retain intermediate .raw_s files static - retain all intermediate temporary files static - Temporary files (<xref linkend="temp-files">) Flag Description Static/Dynamic Reverse set the directory for temporary files static - Finding imports (<xref linkend="options-finding-imports">) Flag Description Static/Dynamic Reverse dir1:dir2:... add dir, dir2, etc. to import path static - Empty the import directory list static - Interface file options (<xref linkend="hi-options">) Flag Description Static/Dynamic Reverse file Put the interface file in file static - Dump the new interface to stdout dynamic - Show the differences vs. the old interface dynamic - Recompilation checking (<xref linkend="recomp">) Flag Description Static/Dynamic Reverse Turn off recompilation checking static Packages (<xref linkend="packages">) Flag Description Static/Dynamic Reverse Install a new package static - name Delete package entry name static - List installed packages static - name Use package name static - name Compile code for package name static - Language options (<xref linkend="options-language">) Flag Description Static/Dynamic Reverse dynamic Enable undecidable instances dynamic Enable generics dynamic Enable most language extensions dynamic Ignore assertions dynamic Don't implicitly import Prelude dynamic - Disable the monomorphism restriction dynamic Make tuple pattern matching irrefutable dynamic n set the limit for context reduction dynamic Warnings (<xref linkend="options-sanity">) Flag Description Static/Dynamic Reverse enable normal warnings dynamic disable all warnings dynamic - enable all warnings dynamic warn about uses of functions & types that are deprecated dynamic warn when an entity is exported multiple times dynamic warn when a .hi file in the current directory shadows a library dynamic warn when a pattern match could fail dynamic warn when fields of a record are uninitialised dynamic warn when class methods are undefined dynamic warn about top-level functions without signatures dynamic warn when names are shadowed dynamic warn about overlapping patterns dynamic warn about lambda-patterns that can fail dynamic warn when defaulting happens dynamic warn about bindings that are unused dynamic warn about unnecessary imports dynamic warn about variables in patterns that aren't used dynamic Optimisation levels (<xref linkend="options-optimise">) Flag Description Static/Dynamic Reverse Enable default optimisation (level 1) static n Set optimisation level n static Run gcc with static - Individual optimisations (<xref linkend="options-f">) Flag Description Static/Dynamic Reverse Make everything strict dynamic Enable case-merging static Make dictionaries strict dynamic Enable eta-reduction static Enable lambda eta-reduction static Enable excess intermediate precision static Enable foldr-build optimisation static Ignore assertions in the source static Ignore pragmas in interface files static Enable let-no-escape optimisation static Tweak the liberate-case optimisation static Don't generate interface pragmas static Set the max iterations for the simplifier static - Turn off CPR analysis static - Turn off common sub-expression static - Turn off pre-inlining static - Turn off strictness analysis static - Make numbers strict dynamic Flatten strict constructor fields static Tweak unfolding settings static Tweak unfolding settings static Tweak unfolding settings static Tweak unfolding settings static Tweak unfolding settings static Turn on UsageSP analysis static Profiling options (<xref linkend="profiling">) Flag Description Static/Dynamic Reverse Auto-add _scc_s to all exported functions static Auto-add _scc_s to all top-level functions static Auto-add _scc_s to all dictionaries static Auto-add _scc_s to all CAFs static Turn on profiling static - Turn on ticky-ticky profiling static - Parallelism options (<xref linkend="sec-using-parallel">) Flag Description Static/Dynamic Reverse Enable GRANSIM static - Enable Parallel Haskell static - Enable SMP support static - C pre-processor options (<xref linkend="c-pre-processor">) Flag Description Static/Dynamic Reverse Run the C pre-processor on Haskell source files dynamic - symbol=value Define a symbol in the C pre-processor dynamic symbol symbol Undefine a symbol in the C pre-processor dynamic - dir Add dir to the directory search list for #include files static - C compiler options (<xref linkend="options-C-compiler">) Flag Description Static/Dynamic Reverse file Include file when compiling the .hc file dynamic - Code generation options (<xref linkend="options-codegen">) Flag Description Static/Dynamic Reverse Use the native code generator dynamic -fvia-C Compile via C dynamic -fasm Linking options (<xref linkend="options-linker">) Flag Description Static/Dynamic Reverse Use dynamic Haskell libraries (if available) static - lib Link in library lib static - dir Add dir to the list of directories searched for libraries static - name Link in package name static - Split objects (for libraries) static - Use static Haskell libraries static - Don't asssume this program contains main static - Replacing phases (<xref linkend="replacing-phases">) Flag Description Static/Dynamic Reverse cmd Use cmd as the literate pre-processor static - cmd Use cmd as the C pre-processor (with only) static - cmd Use cmd as the C compiler static - cmd Use cmd as the assembler static - cmd Use cmd as the linker static - cmd Use cmd as the DLL generator static - cmd Use cmd as the dependency generator static - Forcing options to particular phases (<xref linkend="forcing-options-through">) Flag Description Static/Dynamic Reverse option pass option to the literate pre-processor dynamic - option pass option to cpp (with only) dynamic - option pass option to the C compiler dynamic - option pass option to the assembler dynamic - option pass option to the linker static - option pass option to the DLL generator static - option pass option to the dependency generator static - Platform-specific options (<xref linkend="options-platform">) Flag Description Static/Dynamic Reverse (SPARC only) enable version 8 support static - (x86 only) give some registers back to the C compiler dynamic - Compiler debugging options (<xref linkend="options-debugging">) Flag Description Static/Dynamic Reverse Turn on internal sanity checking dynamic - Dump abstract C dynamic - Dump assembly dynamic - Dump interpreter byte code dynamic - Dump output from CPR analysis dynamic - Dump CSE output dynamic - Dump deriving output dynamic - Dump desugarer output dynamic - Dump “flat” C dynamic - Dump foreign export stubs dynamic - Dump inlining info dynamic - Dump occurrence analysis output dynamic - Dump parse tree dynamic - Dump “real” C dynamic - Dump renamer output dynamic - Dump rules dynamic - Dump saturated output dynamic - Dump final simplifier output dynamic - Dump output from each simplifier iteration dynamic - Dump specialiser output dynamic - Dump final STG dynamic - Dump strictness analyser output dynamic - Dump typechecker output dynamic - Dump type signatures dynamic - Dump UsageSP analysis output dynamic - Dump worker-wrapper output dynamic - Trace renamer dynamic - Renamer stats dynamic - Native code generator intermediate form dynamic - Dump simplifier stats dynamic - Turn on debug printing (more verbose) static - Don't output pragma info in dumps static - Set the depth for printing expressions in error msgs static - Dump haskell source stats dynamic - STG pass sanity checking dynamic - Dump STG stats dynamic - UsageSP sanity checker dynamic - Show output from each core-to-core pass dynamic - Show output from each STG-to-STG pass dynamic - Enable unregisterised compilation static - Misc compiler options Flag Description Static/Dynamic Reverse Allow casms in unfoldings static - ??? static - Make all top-level names global (for ) static - Don't complain about .hi file mismatches static - Turn off black holing (probably doesn't work) static - Don't share specialisations of overloaded functions static - Renamer: don't prune declarations static - Renamer: don't prune type declarations static - Set simplification history size static - Unregisterised compilation (use instead) static - Turn off assembly mangling (use instead) static -