diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2020-05-25 11:59:11 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-11 03:20:35 -0500 |
commit | c34a4b98b1f09ea3096d39a839a86f2d7185c796 (patch) | |
tree | bf3700fd70504a5676220df8702b41810e880846 /compiler | |
parent | 584058ddff71460023712a8d816b83b581e6e78f (diff) | |
download | haskell-c34a4b98b1f09ea3096d39a839a86f2d7185c796.tar.gz |
Fix and enable object unloading in GHCi
Fixes #16525 by tracking dependencies between object file symbols and
marking symbol liveness during garbage collection
See Note [Object unloading] in CheckUnload.c for details.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Linker/Loader.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs index 28e74aa2d9..a23a1f735d 100644 --- a/compiler/GHC/Linker/Loader.hs +++ b/compiler/GHC/Linker/Loader.hs @@ -1150,15 +1150,15 @@ unload_wkr hsc_env keep_linkables pls@LoaderState{..} = do where unloadObjs :: Linkable -> IO () unloadObjs lnk + -- The RTS's PEi386 linker currently doesn't support unloading. + | isWindowsHost = return () + | hostIsDynamic = return () -- We don't do any cleanup when linking objects with the -- dynamic linker. Doing so introduces extra complexity for -- not much benefit. - -- Code unloading currently disabled due to instability. - -- See #16841. - -- id False, so that the pattern-match checker doesn't complain - | id False -- otherwise + | otherwise = mapM_ (unloadObj hsc_env) [f | DotO f <- linkableUnlinked lnk] -- The components of a BCO linkable may contain -- dot-o files. Which is very confusing. @@ -1166,7 +1166,6 @@ unload_wkr hsc_env keep_linkables pls@LoaderState{..} = do -- But the BCO parts can be unlinked just by -- letting go of them (plus of course depopulating -- the symbol table which is done in the main body) - | otherwise = return () -- see #16841 {- ********************************************************************** |