Skip to content
Snippets Groups Projects
Commit 20b702b5 authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot
Browse files

Javascript: Don't filter out rtsDeps list

This logic appears to be incorrect as it would drop any dependency which
was not in a direct dependency of the package being linked.

In the ghc-internals split this started to cause errors because
`ghc-internal` is not a direct dependency of most packages, and hence
important symbols to keep which are hard coded into the js runtime were
getting dropped.
parent 3c9ddf97
No related branches found
No related tags found
No related merge requests found
......@@ -328,7 +328,7 @@ computeLinkDependencies cfg unit_env link_spec finder_opts finder_cache = do
let obj_roots = S.fromList . filter obj_is_root $ concatMap (M.keys . bi_exports . lbi_info) (M.elems objs_block_info)
obj_units = map moduleUnitId $ nub (M.keys objs_block_info)
let (rts_wired_units, rts_wired_functions) = rtsDeps units
let (rts_wired_units, rts_wired_functions) = rtsDeps
-- all the units we want to link together, without their dependencies
let root_units = filter (/= ue_currentUnit unit_env)
......@@ -802,24 +802,9 @@ readArObject ar_state mod ar_file = do
go_entries entries
-- | A helper function to read system dependencies that are hardcoded
diffDeps
:: [UnitId] -- ^ Packages that are already Linked
-> ([UnitId], Set ExportedFun) -- ^ New units and functions to link
-> ([UnitId], Set ExportedFun) -- ^ Diff
diffDeps pkgs (deps_pkgs,deps_funs) =
( filter linked_pkg deps_pkgs
, S.filter linked_fun deps_funs
)
where
linked_fun f = moduleUnitId (funModule f) `S.member` linked_pkgs
linked_pkg p = S.member p linked_pkgs
linked_pkgs = S.fromList pkgs
-- | dependencies for the RTS, these need to be always linked
rtsDeps :: [UnitId] -> ([UnitId], Set ExportedFun)
rtsDeps pkgs = diffDeps pkgs $
rtsDeps :: ([UnitId], Set ExportedFun)
rtsDeps =
( [baseUnitId, primUnitId]
, S.fromList $ concat
[ mkBaseFuns "GHC.Conc.Sync"
......
test('MergeObjsMode',
[ extra_files(['A.hs', 'B.hs', 'Main.hs'])
, js_broken(22261)
],
makefile_test,
[])
test('T1959', [extra_files(['B.hs', 'C.hs', 'D.hs', 'E1.hs', 'E2.hs']), js_broken(22374)], makefile_test, ['dotest'])
test('T1959', [extra_files(['B.hs', 'C.hs', 'D.hs', 'E1.hs', 'E2.hs'])], makefile_test, ['dotest'])
......@@ -3,6 +3,5 @@
test('recomp008',
[extra_files(['A1.hs', 'A2.hs', 'B.hs', 'Main.hs'])
, when(fast(), skip)
, normalise_slashes
, js_broken(22261)],
, normalise_slashes],
makefile_test, [])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment