Commit b5962977 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Merge pull request #2119 from gelisam/generate-object-files

Generate object files for older versions of GHC
parents 9e907bde d9075362
......@@ -572,6 +572,20 @@ configure (pkg_descr0, pbi) cfg
"--enable-split-objs; ignoring")
return False
let ghciLibByDefault =
case compilerId comp of
CompilerId GHC _ ->
-- If ghc is non-dynamic, then ghci needs object files,
-- so we build one by default.
--
-- Technically, archive files should be sufficient for ghci,
-- but because of GHC bug #8942, it has never been safe to
-- rely on them. By the time that bug was fixed, ghci had
-- been changed to read shared libraries instead of archive
-- files (see next code block).
not (GHC.ghcDynamic comp)
_ -> False
let sharedLibsByDefault =
case compilerId comp of
CompilerId GHC _ ->
......@@ -605,7 +619,8 @@ configure (pkg_descr0, pbi) cfg
withDynExe = fromFlag $ configDynExe cfg,
withProfExe = fromFlag $ configProfExe cfg,
withOptimization = fromFlag $ configOptimization cfg,
withGHCiLib = fromFlag $ configGHCiLib cfg,
withGHCiLib = fromFlagOrDefault ghciLibByDefault $
configGHCiLib cfg,
splitObjs = split_objs,
stripExes = fromFlag $ configStripExes cfg,
stripLibs = fromFlag $ configStripLibs cfg,
......
......@@ -333,7 +333,7 @@ defaultConfigFlags progConf = emptyConfigFlags {
-- See #1589.
configGHCiLib = Flag True,
#else
configGHCiLib = Flag False,
configGHCiLib = NoFlag,
#endif
configSplitObjs = Flag False, -- takes longer, so turn off by default
configStripExes = Flag True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment