Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- newtype Loader = Loader {
- loader_state :: MVar (Maybe LoaderState)
- data LoaderState = LoaderState {
- linker_env :: !LinkerEnv
- bcos_loaded :: !LinkableSet
- objs_loaded :: !LinkableSet
- pkgs_loaded :: !PkgsLoaded
- temp_sos :: ![(FilePath, String)]
- uninitializedLoader :: IO Loader
- modifyClosureEnv :: LoaderState -> (ClosureEnv -> ClosureEnv) -> LoaderState
- data LinkerEnv = LinkerEnv {
- closure_env :: !ClosureEnv
- itbl_env :: !ItblEnv
- addr_env :: !AddrEnv
- filterLinkerEnv :: (Name -> Bool) -> LinkerEnv -> LinkerEnv
- type ClosureEnv = NameEnv (Name, ForeignHValue)
- emptyClosureEnv :: ClosureEnv
- extendClosureEnv :: ClosureEnv -> [(Name, ForeignHValue)] -> ClosureEnv
- type LinkableSet = ModuleEnv Linkable
- mkLinkableSet :: [Linkable] -> LinkableSet
- unionLinkableSet :: LinkableSet -> LinkableSet -> LinkableSet
- type ObjFile = FilePath
- data SptEntry = SptEntry Id Fingerprint
- data LibrarySpec
- data LoadedPkgInfo = LoadedPkgInfo {}
- type PkgsLoaded = UniqDFM UnitId LoadedPkgInfo
- data Linkable = Linkable {}
- data LinkablePart
- data LinkableObjectSort
- linkableIsNativeCodeOnly :: Linkable -> Bool
- linkableObjs :: Linkable -> [FilePath]
- linkableLibs :: Linkable -> [LinkablePart]
- linkableFiles :: Linkable -> [FilePath]
- linkableBCOs :: Linkable -> [CompiledByteCode]
- linkableNativeParts :: Linkable -> [LinkablePart]
- linkablePartitionParts :: Linkable -> ([LinkablePart], [LinkablePart])
- linkablePartPath :: LinkablePart -> Maybe FilePath
- linkablePartAllBCOs :: LinkablePart -> [CompiledByteCode]
- isNativeCode :: LinkablePart -> Bool
- isNativeLib :: LinkablePart -> Bool
- linkableFilterByteCode :: Linkable -> Maybe Linkable
- linkableFilterNative :: Linkable -> Maybe Linkable
- partitionLinkables :: [Linkable] -> ([Linkable], [Linkable])
Documentation
data LoaderState Source #
LoaderState | |
|
modifyClosureEnv :: LoaderState -> (ClosureEnv -> ClosureEnv) -> LoaderState Source #
LinkerEnv | |
|
type ClosureEnv = NameEnv (Name, ForeignHValue) Source #
extendClosureEnv :: ClosureEnv -> [(Name, ForeignHValue)] -> ClosureEnv Source #
type LinkableSet = ModuleEnv Linkable Source #
mkLinkableSet :: [Linkable] -> LinkableSet Source #
unionLinkableSet :: LinkableSet -> LinkableSet -> LinkableSet Source #
Union of LinkableSets.
In case of conflict, keep the most recent Linkable (as per linkableTime)
An entry to be inserted into a module's static pointer table. See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable.
Instances
data LibrarySpec Source #
Instances
Outputable LibrarySpec Source # | |
Defined in GHC.Linker.Types ppr :: LibrarySpec -> SDoc Source # |
data LoadedPkgInfo Source #
LoadedPkgInfo | |
|
Instances
Outputable LoadedPkgInfo Source # | |
Defined in GHC.Linker.Types ppr :: LoadedPkgInfo -> SDoc Source # |
type PkgsLoaded = UniqDFM UnitId LoadedPkgInfo Source #
Linkable
Information we can use to dynamically link modules into the compiler
Linkable | |
|
Instances
data LinkablePart Source #
Objects which have yet to be linked by the compiler
DotO | |
| |
DotA FilePath | Static archive file (.a) |
DotDLL FilePath | Dynamically linked library file (.so, .dll, .dylib) |
CoreBindings WholeCoreBindings | Serialised core which we can turn into BCOs (or object files), or used by some other backend See Note [Interface Files with Core Definitions] |
LazyBCOs | |
| |
BCOs CompiledByteCode | A byte-code object, lives only in memory. |
Instances
Outputable LinkablePart Source # | |
Defined in GHC.Linker.Types ppr :: LinkablePart -> SDoc Source # |
data LinkableObjectSort Source #
Classify the provenance of .o
products.
ModuleObject | The object is the final product for a module. When linking splices, its file extension will be adapted to the interpreter's way if needed. |
ForeignObject | The object was created from generated code for foreign stubs or foreign sources added by the user. Its file extension must be preserved, since there are no objects for alternative ways available. |
linkableIsNativeCodeOnly :: Linkable -> Bool Source #
Return true if the linkable only consists of native code (no BCO)
linkableObjs :: Linkable -> [FilePath] Source #
List the native objects (.o) of a linkable
linkableLibs :: Linkable -> [LinkablePart] Source #
List the native libraries (.so/.dll) of a linkable
linkableFiles :: Linkable -> [FilePath] Source #
List the paths of the native objects and libraries (.o.so.dll)
linkableBCOs :: Linkable -> [CompiledByteCode] Source #
List the BCOs parts of a linkable.
This excludes the LazyBCOs and the CoreBindings parts
linkableNativeParts :: Linkable -> [LinkablePart] Source #
List the native linkable parts (.o.so.dll) of a linkable
linkablePartitionParts :: Linkable -> ([LinkablePart], [LinkablePart]) Source #
Split linkable parts into (native code parts, BCOs parts)
linkablePartPath :: LinkablePart -> Maybe FilePath Source #
Get the FilePath of linkable part (if applicable)
linkablePartAllBCOs :: LinkablePart -> [CompiledByteCode] Source #
Retrieve the compiled byte-code from the linkable part.
Contrary to linkableBCOs, this includes byte-code from LazyBCOs.
isNativeCode :: LinkablePart -> Bool Source #
Is the part a native object or library? (.o.so.dll)
isNativeLib :: LinkablePart -> Bool Source #
Is the part a native library? (.so/.dll)
linkableFilterByteCode :: Linkable -> Maybe Linkable Source #
Transform the LinkablePart
list in this Linkable
to contain only byte
code without LazyBCOs
.
If no LinkablePart
remains, return Nothing
.
linkableFilterNative :: Linkable -> Maybe Linkable Source #
Transform the LinkablePart
list in this Linkable
to contain only
object code files (.o, .a, .so) without LazyBCOs
.
If no LinkablePart
remains, return Nothing
.
partitionLinkables :: [Linkable] -> ([Linkable], [Linkable]) Source #
Split the LinkablePart
lists in each Linkable
into only object code
files (.o, .a, .so) and only byte code, without LazyBCOs
, and return two
lists containing the nonempty Linkable
s for each.