summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTito Sacchi <tito.sakki@gmail.com>2021-08-02 14:56:27 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-03 17:19:14 -0400
commit9744c6f5c37c8b85f95e53f109b7ce6c25881c29 (patch)
tree8890b4e80c2f7dbc7f6556ea8ce5a7d7bf29ebba
parent5155eafaef2d0cbecd58a808b5b357002a656ffe (diff)
downloadhaskell-9744c6f5c37c8b85f95e53f109b7ce6c25881c29.tar.gz
Correctly unload libs on GHCi with external iserv
Fix #17669 `hostIsDynamic` is basically a compile-time constant embedded in the RTS. Therefore, GHCi didn't unload object files properly when used with an external interpreter built in a different way.
-rw-r--r--compiler/GHC/Linker/Loader.hs2
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T3
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs
index 2c2e724d68..45ef0b3daa 100644
--- a/compiler/GHC/Linker/Loader.hs
+++ b/compiler/GHC/Linker/Loader.hs
@@ -1189,7 +1189,7 @@ unload_wkr interp keep_linkables pls@LoaderState{..} = do
where
unloadObjs :: Linkable -> IO ()
unloadObjs lnk
- | hostIsDynamic = return ()
+ | interpreterDynamic interp = return ()
-- We don't do any cleanup when linking objects with the
-- dynamic linker. Doing so introduces extra complexity for
-- not much benefit.
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index ec137685ef..3856dde227 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -318,8 +318,7 @@ test('T17403', normal, ghci_script, ['T17403.script'])
test('T17431', normal, ghci_script, ['T17431.script'])
test('T17500', [extra_run_opts('-ddump-to-file -ddump-bcos')], ghci_script, ['T17500.script'])
test('T17549', normal, ghci_script, ['T17549.script'])
-test('T17669', [extra_run_opts('-fexternal-interpreter -fobject-code'),
- unless(opsys('mingw32'), expect_broken(17669))], ghci_script, ['T17669.script'])
+test('T17669', [extra_run_opts('-fexternal-interpreter -fobject-code')], ghci_script, ['T17669.script'])
test('T18330', [copy_files, extra_files(['../shell.hs', 'T18330.extra', 'T18330.hs'])
, filter_stdout_lines(r'ghci>.*')
, extra_hc_opts('-v1')]