GHC.Toolchain.Target

ghc-toolchain-0.1.0.0: Utility for managing GHC target toolchains

Safe Haskell | None
Language | Haskell2010

GHC.Toolchain.Target

Contents

- llc command
- opt command
- install_name_tool
- otool command

Synopsis

- data WordSize
  - = WS4
  - | WS8
- data Endianness
  - = LittleEndian
  - | BigEndian
- data Target = Target {
  - tgtArchOs :: ArchOS
  - tgtVendor :: Maybe String
  - tgtLocallyExecutable :: Bool
  - tgtSupportsGnuNonexecStack :: Bool
  - tgtSupportsSubsectionsViaSymbols :: Bool
  - tgtSupportsIdentDirective :: Bool
  - tgtWordSize :: WordSize
  - tgtEndianness :: Endianness
  - tgtSymbolsHaveLeadingUnderscore :: Bool
  - tgtLlvmTarget :: String
  - tgtUnregisterised :: Bool
  - tgtTablesNextToCode :: Bool
  - tgtUseLibffiForAdjustors :: Bool
  - tgtCCompiler :: Cc
  - tgtCxxCompiler :: Cxx
  - tgtCPreprocessor :: Cpp
  - tgtHsCPreprocessor :: HsCpp
  - tgtCCompilerLink :: CcLink
  - tgtAr :: Ar
  - tgtRanlib :: Maybe Ranlib
  - tgtNm :: Nm
  - tgtMergeObjs :: Maybe MergeObjs
  - tgtWindres :: Maybe Program
  }
- wordSize2Bytes :: WordSize -> Int
- targetPlatformTriple :: Target -> String

# Documentation

data WordSize Source #

Constructors

WS4 |
WS8 |

#### Instances

Instances details

Read WordSize Source # |
Instance details Defined in GHC.Toolchain.Target Methods readsPrec :: Int -> ReadS WordSize # readList :: ReadS [WordSize] # readPrec :: ReadPrec WordSize # readListPrec :: ReadPrec [WordSize] #
Show WordSize Source # |
Instance details Defined in GHC.Toolchain.Target Methods showsPrec :: Int -> WordSize -> ShowS # show :: WordSize -> String # showList :: [WordSize] -> ShowS #
Eq WordSize Source # |
Instance details Defined in GHC.Toolchain.Target Methods (==) :: WordSize -> WordSize -> Bool # (/=) :: WordSize -> WordSize -> Bool #
Ord WordSize Source # |
Instance details Defined in GHC.Toolchain.Target Methods compare :: WordSize -> WordSize -> Ordering # (<) :: WordSize -> WordSize -> Bool # (<=) :: WordSize -> WordSize -> Bool # (>) :: WordSize -> WordSize -> Bool # (>=) :: WordSize -> WordSize -> Bool # max :: WordSize -> WordSize -> WordSize # min :: WordSize -> WordSize -> WordSize #

data Endianness Source #

Constructors

LittleEndian |
BigEndian |

#### Instances

Instances details

Read Endianness Source # |
Instance details Defined in GHC.Toolchain.Target Methods readsPrec :: Int -> ReadS Endianness # readList :: ReadS [Endianness] # readPrec :: ReadPrec Endianness # readListPrec :: ReadPrec [Endianness] #
Show Endianness Source # |
Instance details Defined in GHC.Toolchain.Target Methods showsPrec :: Int -> Endianness -> ShowS # show :: Endianness -> String # showList :: [Endianness] -> ShowS #
Eq Endianness Source # |
Instance details Defined in GHC.Toolchain.Target Methods (==) :: Endianness -> Endianness -> Bool # (/=) :: Endianness -> Endianness -> Bool #
Ord Endianness Source # |
Instance details Defined in GHC.Toolchain.Target Methods compare :: Endianness -> Endianness -> Ordering # (<) :: Endianness -> Endianness -> Bool # (<=) :: Endianness -> Endianness -> Bool # (>) :: Endianness -> Endianness -> Bool # (>=) :: Endianness -> Endianness -> Bool # max :: Endianness -> Endianness -> Endianness # min :: Endianness -> Endianness -> Endianness #

# llc command

# opt command

# install_name_tool

# otool command

data Target Source #

A `Target` consists of:

- a target architecture and operating system
- various bits of information about the platform
- various toolchain components targetting that platform

Constructors

Target |
Fields tgtArchOs :: ArchOS tgtVendor :: Maybe String This is the vendor component of the triple, the other two components are found in ``tgtArchOs`` tgtLocallyExecutable :: Bool tgtSupportsGnuNonexecStack :: Bool tgtSupportsSubsectionsViaSymbols :: Bool tgtSupportsIdentDirective :: Bool tgtWordSize :: WordSize tgtEndianness :: Endianness tgtSymbolsHaveLeadingUnderscore :: Bool tgtLlvmTarget :: String tgtUnregisterised :: Bool tgtTablesNextToCode :: Bool tgtUseLibffiForAdjustors :: Bool We need to know whether or not to include libffi headers, and generate additional code for it tgtCCompiler :: Cc tgtCxxCompiler :: Cxx tgtCPreprocessor :: Cpp tgtHsCPreprocessor :: HsCpp tgtCCompilerLink :: CcLink tgtAr :: Ar tgtRanlib :: Maybe Ranlib N.B. Most `ar` implementations will add an index by default without `ranlib` so this is often optional tgtNm :: Nm tgtMergeObjs :: Maybe MergeObjs We don't need a merge objects tool if we `Ar` supports `-L` tgtWindres :: Maybe Program

#### Instances

Instances details

Read Target Source # |
Instance details Defined in GHC.Toolchain.Target Methods readsPrec :: Int -> ReadS Target # readList :: ReadS [Target] # readPrec :: ReadPrec Target # readListPrec :: ReadPrec [Target] #
Show Target Source # | Handwritten Show instance to have have better diffs against the toolchain targets generated by configure
Instance details Defined in GHC.Toolchain.Target Methods showsPrec :: Int -> Target -> ShowS # show :: Target -> String # showList :: [Target] -> ShowS #
Eq Target Source # |
Instance details Defined in GHC.Toolchain.Target Methods (==) :: Target -> Target -> Bool # (/=) :: Target -> Target -> Bool #
Ord Target Source # |
Instance details Defined in GHC.Toolchain.Target Methods compare :: Target -> Target -> Ordering # (<) :: Target -> Target -> Bool # (<=) :: Target -> Target -> Bool # (>) :: Target -> Target -> Bool # (>=) :: Target -> Target -> Bool # max :: Target -> Target -> Target # min :: Target -> Target -> Target #

wordSize2Bytes :: WordSize -> Int Source #

The word size as an integer representing the number of bytes

targetPlatformTriple :: Target -> String Source #

Reconstruct the platform triple from a toolchain target (specifically from tgtArchOs and tgtVendor)