Fix and reenable object unloading
In !1130 (closed) we noticed that a significant number of Windows testsuite issues were due to code unloading. In particular, this codepath is not exercised at all on Linux (where we build dynamic GHCs by default) due to this case in compiler/ghci/Linker.hs
:
unloadObjs :: Linkable -> IO ()
unloadObjs lnk
| dynamicGhc = return ()
-- We don't do any cleanup when linking objects with the
-- dynamic linker. Doing so introduces extra complexity for
-- not much benefit.
| otherwise
= mapM_ (unloadObj hsc_env) [f | DotO f <- linkableUnlinked lnk]
In the interest of getting CI green on Windows, I will disable code unloading in the otherwise
case as well until we sort out the remaining issues.