Skip to content
Snippets Groups Projects
Commit d6f4af6a authored by Cheng Shao's avatar Cheng Shao :beach:
Browse files

ghc-bin: enforce dynamic way when the target requires so

This commit makes ghc-bin use dynamic way when it is doing interactive
stuff on certain targets whose RTS linker can only handle dynamic
code.

(cherry picked from commit 88e99248)
parent 6db8159a
No related branches found
No related tags found
No related merge requests found
......@@ -224,9 +224,26 @@ main' postLoadMode units dflags0 args flagWarnings = do
-- The rest of the arguments are "dynamic"
-- Leftover ones are presumably files
(dflags3, fileish_args, dynamicFlagWarnings) <-
(dflags3', fileish_args, dynamicFlagWarnings) <-
GHC.parseDynamicFlags logger2 dflags2 args'
-- When we do ghci, force using dyn ways if the target RTS linker
-- only supports dynamic code
let dflags3
| LinkInMemory <- link,
sTargetRTSLinkerOnlySupportsSharedLibs $ settings dflags3'
= setDynamicNow $
-- See checkOptions below, -fexternal-interpreter is
-- required when using --interactive with a non-standard
-- way (-prof, -static, or -dynamic).
setGeneralFlag' Opt_ExternalInterpreter $
-- Use .o for dynamic object, otherwise it gets dropped
-- with "Warning: ignoring unrecognised input", see
-- objish_suffixes
dflags3' { dynObjectSuf_ = objectSuf dflags3' }
| otherwise
= dflags3'
let dflags4 = if backendNeedsFullWays bcknd &&
not (gopt Opt_ExternalInterpreter dflags3)
then
......
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