ghc-9.10.3: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Settings

Contents

- Accessors

Description

Run-time settings

Synopsis

- data Settings = Settings {
  - sGhcNameVersion :: !GhcNameVersion
  - sFileSettings :: !FileSettings
  - sTargetPlatform :: Platform
  - sToolSettings :: !ToolSettings
  - sPlatformMisc :: !PlatformMisc
  - sRawSettings :: [(String, String)]
  }
- data ToolSettings = ToolSettings {
  - toolSettings_ldSupportsCompactUnwind :: Bool
  - toolSettings_ldSupportsFilelist :: Bool
  - toolSettings_ldSupportsSingleModule :: Bool
  - toolSettings_mergeObjsSupportsResponseFiles :: Bool
  - toolSettings_ldIsGnuLd :: Bool
  - toolSettings_ccSupportsNoPie :: Bool
  - toolSettings_useInplaceMinGW :: Bool
  - toolSettings_arSupportsDashL :: Bool
  - toolSettings_cmmCppSupportsG0 :: Bool
  - toolSettings_pgm_L :: String
  - toolSettings_pgm_P :: (String, [Option])
  - toolSettings_pgm_JSP :: (String, [Option])
  - toolSettings_pgm_CmmP :: (String, [Option])
  - toolSettings_pgm_F :: String
  - toolSettings_pgm_c :: String
  - toolSettings_pgm_cxx :: String
  - toolSettings_pgm_cpp :: (String, [Option])
  - toolSettings_pgm_a :: (String, [Option])
  - toolSettings_pgm_l :: (String, [Option])
  - toolSettings_pgm_lm :: Maybe (String, [Option])
  - toolSettings_pgm_windres :: String
  - toolSettings_pgm_ar :: String
  - toolSettings_pgm_otool :: String
  - toolSettings_pgm_install_name_tool :: String
  - toolSettings_pgm_ranlib :: String
  - toolSettings_pgm_lo :: (String, [Option])
  - toolSettings_pgm_lc :: (String, [Option])
  - toolSettings_pgm_las :: (String, [Option])
  - toolSettings_pgm_i :: String
  - toolSettings_opt_L :: [String]
  - toolSettings_opt_P :: [String]
  - toolSettings_opt_JSP :: [String]
  - toolSettings_opt_CmmP :: [String]
  - toolSettings_opt_P_fingerprint :: Fingerprint
  - toolSettings_opt_JSP_fingerprint :: Fingerprint
  - toolSettings_opt_CmmP_fingerprint :: Fingerprint
  - toolSettings_opt_F :: [String]
  - toolSettings_opt_c :: [String]
  - toolSettings_opt_cxx :: [String]
  - toolSettings_opt_a :: [String]
  - toolSettings_opt_l :: [String]
  - toolSettings_opt_lm :: [String]
  - toolSettings_opt_windres :: [String]
  - toolSettings_opt_lo :: [String]
  - toolSettings_opt_lc :: [String]
  - toolSettings_opt_las :: [String]
  - toolSettings_opt_i :: [String]
  - toolSettings_extraGccViaCFlags :: [String]
  }
- data FileSettings = FileSettings {
  - fileSettings_ghcUsagePath :: FilePath
  - fileSettings_ghciUsagePath :: FilePath
  - fileSettings_toolDir :: Maybe FilePath
  - fileSettings_topDir :: FilePath
  - fileSettings_globalPackageDatabase :: FilePath
  }
- data GhcNameVersion = GhcNameVersion {
  - ghcNameVersion_programName :: String
  - ghcNameVersion_projectVersion :: String
  }
- data Platform = Platform {
  - platformArchOS :: !ArchOS
  - platformWordSize :: !PlatformWordSize
  - platformByteOrder :: !ByteOrder
  - platformUnregisterised :: !Bool
  - platformHasGnuNonexecStack :: !Bool
  - platformHasIdentDirective :: !Bool
  - platformHasSubsectionsViaSymbols :: !Bool
  - platformIsCrossCompiling :: !Bool
  - platformLeadingUnderscore :: !Bool
  - platformTablesNextToCode :: !Bool
  - platformHasLibm :: !Bool
  - platform_constants :: !(Maybe PlatformConstants)
  }
- data PlatformMisc = PlatformMisc {
  - platformMisc_targetPlatformString :: String
  - platformMisc_ghcWithInterpreter :: Bool
  - platformMisc_libFFI :: Bool
  - platformMisc_llvmTarget :: String
  }
- dynLibSuffix :: GhcNameVersion -> String
- sProgramName :: Settings -> String
- sProjectVersion :: Settings -> String
- sGhcUsagePath :: Settings -> FilePath
- sGhciUsagePath :: Settings -> FilePath
- sToolDir :: Settings -> Maybe FilePath
- sTopDir :: Settings -> FilePath
- sGlobalPackageDatabasePath :: Settings -> FilePath
- sLdSupportsCompactUnwind :: Settings -> Bool
- sLdSupportsFilelist :: Settings -> Bool
- sMergeObjsSupportsResponseFiles :: Settings -> Bool
- sLdIsGnuLd :: Settings -> Bool
- sGccSupportsNoPie :: Settings -> Bool
- sUseInplaceMinGW :: Settings -> Bool
- sArSupportsDashL :: Settings -> Bool
- sPgm_L :: Settings -> String
- sPgm_P :: Settings -> (String, [Option])
- sPgm_JSP :: Settings -> (String, [Option])
- sPgm_CmmP :: Settings -> (String, [Option])
- sPgm_F :: Settings -> String
- sPgm_c :: Settings -> String
- sPgm_cxx :: Settings -> String
- sPgm_cpp :: Settings -> (String, [Option])
- sPgm_a :: Settings -> (String, [Option])
- sPgm_l :: Settings -> (String, [Option])
- sPgm_lm :: Settings -> Maybe (String, [Option])
- sPgm_windres :: Settings -> String
- sPgm_ar :: Settings -> String
- sPgm_otool :: Settings -> String
- sPgm_install_name_tool :: Settings -> String
- sPgm_ranlib :: Settings -> String
- sPgm_lo :: Settings -> (String, [Option])
- sPgm_lc :: Settings -> (String, [Option])
- sPgm_las :: Settings -> (String, [Option])
- sPgm_i :: Settings -> String
- sOpt_L :: Settings -> [String]
- sOpt_P :: Settings -> [String]
- sOpt_P_fingerprint :: Settings -> Fingerprint
- sOpt_JSP :: Settings -> [String]
- sOpt_JSP_fingerprint :: Settings -> Fingerprint
- sOpt_CmmP :: Settings -> [String]
- sOpt_CmmP_fingerprint :: Settings -> Fingerprint
- sOpt_F :: Settings -> [String]
- sOpt_c :: Settings -> [String]
- sOpt_cxx :: Settings -> [String]
- sOpt_a :: Settings -> [String]
- sOpt_l :: Settings -> [String]
- sOpt_lm :: Settings -> [String]
- sOpt_windres :: Settings -> [String]
- sOpt_lo :: Settings -> [String]
- sOpt_lc :: Settings -> [String]
- sOpt_i :: Settings -> [String]
- sExtraGccViaCFlags :: Settings -> [String]
- sTargetPlatformString :: Settings -> String
- sGhcWithInterpreter :: Settings -> Bool
- sLibFFI :: Settings -> Bool

# Documentation

data Settings Source #

Constructors

Settings |

Fields

- sGhcNameVersion :: !GhcNameVersion
- sFileSettings :: !FileSettings
- sTargetPlatform :: Platform
- sToolSettings :: !ToolSettings
- sPlatformMisc :: !PlatformMisc
- sRawSettings :: [(String, String)]

data ToolSettings Source #

Settings for other executables GHC calls.

Probably should further split down by phase, or split between platform-specific and platform-agnostic.

Constructors

ToolSettings |

Fields

- toolSettings_ldSupportsCompactUnwind :: Bool
- toolSettings_ldSupportsFilelist :: Bool
- toolSettings_ldSupportsSingleModule :: Bool
- toolSettings_mergeObjsSupportsResponseFiles :: Bool
- toolSettings_ldIsGnuLd :: Bool
- toolSettings_ccSupportsNoPie :: Bool
- toolSettings_useInplaceMinGW :: Bool
- toolSettings_arSupportsDashL :: Bool
- toolSettings_cmmCppSupportsG0 :: Bool
- toolSettings_pgm_L :: String
- toolSettings_pgm_P :: (String, [Option])

  The Haskell C preprocessor and default options (not added by -optP)

- toolSettings_pgm_JSP :: (String, [Option])

  The JavaScript C preprocessor and default options (not added by -optP)

- toolSettings_pgm_CmmP :: (String, [Option])

  The C-- C Preprocessor and default options (not added by -optP)

- toolSettings_pgm_F :: String
- toolSettings_pgm_c :: String
- toolSettings_pgm_cxx :: String
- toolSettings_pgm_cpp :: (String, [Option])

  The C preprocessor (distinct from the Haskell C preprocessor!)

- toolSettings_pgm_a :: (String, [Option])
- toolSettings_pgm_l :: (String, [Option])
- toolSettings_pgm_lm :: Maybe (String, [Option])

  N.B. On Windows we don't have a linker which supports object merging, hence the `Maybe`. See Note [Object merging] in GHC.Driver.Pipeline.Execute for details.

- toolSettings_pgm_windres :: String
- toolSettings_pgm_ar :: String
- toolSettings_pgm_otool :: String
- toolSettings_pgm_install_name_tool :: String
- toolSettings_pgm_ranlib :: String
- toolSettings_pgm_lo :: (String, [Option])

  LLVM: opt llvm optimiser

- toolSettings_pgm_lc :: (String, [Option])

  LLVM: llc static compiler

- toolSettings_pgm_las :: (String, [Option])

  LLVM: assembler

- toolSettings_pgm_i :: String
- toolSettings_opt_L :: [String]
- toolSettings_opt_P :: [String]
- toolSettings_opt_JSP :: [String]
- toolSettings_opt_CmmP :: [String]
- toolSettings_opt_P_fingerprint :: Fingerprint

  cached Fingerprint of sOpt_P See Note [Repeated -optP hashing]

- toolSettings_opt_JSP_fingerprint :: Fingerprint

  cached Fingerprint of sOpt_JSP See Note [Repeated -optP hashing]

- toolSettings_opt_CmmP_fingerprint :: Fingerprint

  cached Fingerprint of sOpt_CmmP See Note [Repeated -optP hashing]

- toolSettings_opt_F :: [String]
- toolSettings_opt_c :: [String]
- toolSettings_opt_cxx :: [String]
- toolSettings_opt_a :: [String]
- toolSettings_opt_l :: [String]
- toolSettings_opt_lm :: [String]
- toolSettings_opt_windres :: [String]
- toolSettings_opt_lo :: [String]

  LLVM: llvm optimiser

- toolSettings_opt_lc :: [String]

  LLVM: llc static compiler

- toolSettings_opt_las :: [String]
- toolSettings_opt_i :: [String]

  iserv options

- toolSettings_extraGccViaCFlags :: [String]

data FileSettings Source #

Paths to various files and directories used by GHC, including those that provide more settings.

Constructors

FileSettings |

Fields

- fileSettings_ghcUsagePath :: FilePath
- fileSettings_ghciUsagePath :: FilePath
- fileSettings_toolDir :: Maybe FilePath
- fileSettings_topDir :: FilePath
- fileSettings_globalPackageDatabase :: FilePath

data GhcNameVersion Source #

Settings for what GHC this is.

Constructors

GhcNameVersion |

Fields

- ghcNameVersion_programName :: String
- ghcNameVersion_projectVersion :: String

data Platform Source #

Platform description

This is used to describe platforms so that we can generate code for them.

Constructors

Platform |

Fields

- platformArchOS :: !ArchOS

  Architecture and OS

- platformWordSize :: !PlatformWordSize

  Word size

- platformByteOrder :: !ByteOrder

  Byte order (endianness)

- platformUnregisterised :: !Bool
- platformHasGnuNonexecStack :: !Bool
- platformHasIdentDirective :: !Bool
- platformHasSubsectionsViaSymbols :: !Bool
- platformIsCrossCompiling :: !Bool
- platformLeadingUnderscore :: !Bool

  Symbols need underscore prefix

- platformTablesNextToCode :: !Bool

  Determines whether we will be compiling info tables that reside just before the entry code, or with an indirection to the entry code. See TABLES_NEXT_TO_CODE in `rtsincludertsstorageInfoTables.h`.

- platformHasLibm :: !Bool

  Some platforms require that we explicitly link against `libm` if any math-y things are used (which we assume to include all programs). See #14022.

- platform_constants :: !(Maybe PlatformConstants)

  Constants such as structure offsets, type sizes, etc.

#### Instances

Instances details

Read Platform Source # |
Instance details Defined in GHC.Platform Methods readsPrec :: Int -> ReadS Platform # readList :: ReadS [Platform] # readPrec :: ReadPrec Platform # readListPrec :: ReadPrec [Platform] #
Show Platform Source # |
Instance details Defined in GHC.Platform Methods showsPrec :: Int -> Platform -> ShowS # show :: Platform -> String # showList :: [Platform] -> ShowS #
Eq Platform Source # |
Instance details Defined in GHC.Platform Methods (==) :: Platform -> Platform -> Bool # (/=) :: Platform -> Platform -> Bool #
Ord Platform Source # |
Instance details Defined in GHC.Platform Methods compare :: Platform -> Platform -> Ordering # (<) :: Platform -> Platform -> Bool # (<=) :: Platform -> Platform -> Bool # (>) :: Platform -> Platform -> Bool # (>=) :: Platform -> Platform -> Bool # max :: Platform -> Platform -> Platform # min :: Platform -> Platform -> Platform #
OutputableP Platform CmmGraph Source # |
Instance details Defined in GHC.Cmm Methods pdoc :: Platform -> CmmGraph -> SDoc Source #
OutputableP Platform CmmInfoTable Source # |
Instance details Defined in GHC.Cmm Methods pdoc :: Platform -> CmmInfoTable -> SDoc Source #
OutputableP Platform CmmStatic Source # |
Instance details Defined in GHC.Cmm Methods pdoc :: Platform -> CmmStatic -> SDoc Source #
OutputableP Platform CmmTopInfo Source # |
Instance details Defined in GHC.Cmm Methods pdoc :: Platform -> CmmTopInfo -> SDoc Source #
OutputableP Platform CLabel Source # |
Instance details Defined in GHC.Cmm.CLabel Methods pdoc :: Platform -> CLabel -> SDoc Source #
OutputableP Platform InfoProvEnt Source # |
Instance details Defined in GHC.Cmm.CLabel Methods pdoc :: Platform -> InfoProvEnt -> SDoc Source #
OutputableP Platform DebugBlock Source # |
Instance details Defined in GHC.Cmm.DebugBlock Methods pdoc :: Platform -> DebugBlock -> SDoc Source #
OutputableP Platform UnwindExpr Source # |
Instance details Defined in GHC.Cmm.DebugBlock Methods pdoc :: Platform -> UnwindExpr -> SDoc Source #
OutputableP Platform UnwindPoint Source # |
Instance details Defined in GHC.Cmm.DebugBlock Methods pdoc :: Platform -> UnwindPoint -> SDoc Source #
OutputableP Platform CmmExpr Source # |
Instance details Defined in GHC.Cmm.Expr Methods pdoc :: Platform -> CmmExpr -> SDoc Source #
OutputableP Platform CmmLit Source # |
Instance details Defined in GHC.Cmm.Expr Methods pdoc :: Platform -> CmmLit -> SDoc Source #
OutputableP Platform ForeignTarget Source # |
Instance details Defined in GHC.Cmm.Node Methods pdoc :: Platform -> ForeignTarget -> SDoc Source #
OutputableP Platform DwarfFrameBlock Source # |
Instance details Defined in GHC.CmmToAsm.Dwarf.Types Methods pdoc :: Platform -> DwarfFrameBlock -> SDoc Source #
OutputableP Platform LiveInfo Source # |
Instance details Defined in GHC.CmmToAsm.Reg.Liveness Methods pdoc :: Platform -> LiveInfo -> SDoc Source #
OutputableP Platform CgLoc Source # |
Instance details Defined in GHC.StgToCmm.Closure Methods pdoc :: Platform -> CgLoc -> SDoc Source #
OutputableP Platform CgIdInfo Source # |
Instance details Defined in GHC.StgToCmm.Monad Methods pdoc :: Platform -> CgIdInfo -> SDoc Source #
OutputableP Platform (GenCmmStatics a) Source # |
Instance details Defined in GHC.Cmm Methods pdoc :: Platform -> GenCmmStatics a -> SDoc Source #
OutputableP Platform (CmmNode e x) Source # |
Instance details Defined in GHC.Cmm.Node Methods pdoc :: Platform -> CmmNode e x -> SDoc Source #
(OutputableP Platform d, OutputableP Platform info, OutputableP Platform i) => OutputableP Platform (GenCmmDecl d info i) Source # |
Instance details Defined in GHC.Cmm Methods pdoc :: Platform -> GenCmmDecl d info i -> SDoc Source #
OutputableP Platform (Block CmmNode C C) Source # |
Instance details Defined in GHC.Cmm.Node Methods pdoc :: Platform -> Block CmmNode C C -> SDoc Source #
OutputableP Platform (Block CmmNode C O) Source # |
Instance details Defined in GHC.Cmm.Node Methods pdoc :: Platform -> Block CmmNode C O -> SDoc Source #
OutputableP Platform (Block CmmNode O C) Source # |
Instance details Defined in GHC.Cmm.Node Methods pdoc :: Platform -> Block CmmNode O C -> SDoc Source #
OutputableP Platform (Block CmmNode O O) Source # |
Instance details Defined in GHC.Cmm.Node Methods pdoc :: Platform -> Block CmmNode O O -> SDoc Source #
OutputableP Platform (Graph CmmNode e x) Source # |
Instance details Defined in GHC.Cmm.Node Methods pdoc :: Platform -> Graph CmmNode e x -> SDoc Source #

data PlatformMisc Source #

Platform-specific settings formerly hard-coded in Config.hs.

These should probably be all be triaged whether they can be computed from other settings or belong in another another place (like `Platform` above).

Constructors

PlatformMisc |

Fields

- platformMisc_targetPlatformString :: String
- platformMisc_ghcWithInterpreter :: Bool
- platformMisc_libFFI :: Bool
- platformMisc_llvmTarget :: String

# Accessors

dynLibSuffix :: GhcNameVersion -> String Source #

Dynamic library suffix

sProgramName :: Settings -> String Source #

sProjectVersion :: Settings -> String Source #

sGhcUsagePath :: Settings -> FilePath Source #

sGhciUsagePath :: Settings -> FilePath Source #

sToolDir :: Settings -> Maybe FilePath Source #

sTopDir :: Settings -> FilePath Source #

sGlobalPackageDatabasePath :: Settings -> FilePath Source #

sLdSupportsCompactUnwind :: Settings -> Bool Source #

sLdSupportsFilelist :: Settings -> Bool Source #

sMergeObjsSupportsResponseFiles :: Settings -> Bool Source #

sLdIsGnuLd :: Settings -> Bool Source #

sGccSupportsNoPie :: Settings -> Bool Source #

sUseInplaceMinGW :: Settings -> Bool Source #

sArSupportsDashL :: Settings -> Bool Source #

sPgm_L :: Settings -> String Source #

sPgm_P :: Settings -> (String, [Option]) Source #

sPgm_JSP :: Settings -> (String, [Option]) Source #

sPgm_CmmP :: Settings -> (String, [Option]) Source #

sPgm_F :: Settings -> String Source #

sPgm_c :: Settings -> String Source #

sPgm_cxx :: Settings -> String Source #

sPgm_cpp :: Settings -> (String, [Option]) Source #

sPgm_a :: Settings -> (String, [Option]) Source #

sPgm_l :: Settings -> (String, [Option]) Source #

sPgm_lm :: Settings -> Maybe (String, [Option]) Source #

sPgm_windres :: Settings -> String Source #

sPgm_ar :: Settings -> String Source #

sPgm_otool :: Settings -> String Source #

sPgm_install_name_tool :: Settings -> String Source #

sPgm_ranlib :: Settings -> String Source #

sPgm_lo :: Settings -> (String, [Option]) Source #

sPgm_lc :: Settings -> (String, [Option]) Source #

sPgm_las :: Settings -> (String, [Option]) Source #

sPgm_i :: Settings -> String Source #

sOpt_L :: Settings -> [String] Source #

sOpt_P :: Settings -> [String] Source #

sOpt_P_fingerprint :: Settings -> Fingerprint Source #

sOpt_JSP :: Settings -> [String] Source #

sOpt_JSP_fingerprint :: Settings -> Fingerprint Source #

sOpt_CmmP :: Settings -> [String] Source #

sOpt_CmmP_fingerprint :: Settings -> Fingerprint Source #

sOpt_F :: Settings -> [String] Source #

sOpt_c :: Settings -> [String] Source #

sOpt_cxx :: Settings -> [String] Source #

sOpt_a :: Settings -> [String] Source #

sOpt_l :: Settings -> [String] Source #

sOpt_lm :: Settings -> [String] Source #

sOpt_windres :: Settings -> [String] Source #

sOpt_lo :: Settings -> [String] Source #

sOpt_lc :: Settings -> [String] Source #

sOpt_i :: Settings -> [String] Source #

sExtraGccViaCFlags :: Settings -> [String] Source #

sTargetPlatformString :: Settings -> String Source #

sGhcWithInterpreter :: Settings -> Bool Source #

sLibFFI :: Settings -> Bool Source #