summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-05-22 19:45:23 -0400
committerBen Gamari <ben@well-typed.com>2019-05-27 21:04:20 -0400
commit726cd5d660f29b7e1649bec8cbd842eb2d873954 (patch)
treeab5016fdf91bd60343923d06056be15748dfef1c
parent2d0cf6252957b8980d89481ecd0b79891da4b14b (diff)
downloadhaskell-wip/T16685.tar.gz
hadrian: Place non-Haskell objects last when linkingwip/T16685
In general Haskell objects will contain references to non-Haskell objects, not the other way around. Consequently non-Haskell objects should be placed last. This should fix #16685.
-rw-r--r--hadrian/src/Rules/Library.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/hadrian/src/Rules/Library.hs b/hadrian/src/Rules/Library.hs
index aea855df11..356af1f566 100644
--- a/hadrian/src/Rules/Library.hs
+++ b/hadrian/src/Rules/Library.hs
@@ -106,7 +106,7 @@ buildGhciLibO root ghcilibPath = do
-- | Return all Haskell and non-Haskell object files for the given 'Context'.
allObjects :: Context -> Action [FilePath]
-allObjects context = (++) <$> nonHsObjects context <*> hsObjects context
+allObjects context = (++) <$> hsObjects context <*> nonHsObjects context
-- | Return all the non-Haskell object files for the given library context
-- (object files built from C, C-- and sometimes other things).
@@ -139,10 +139,10 @@ extraObjects context
-- the given 'Context'.
libraryObjects :: Context -> Action [FilePath]
libraryObjects context@Context{..} = do
- hsObjs <- hsObjects context
noHsObjs <- nonHsObjects context
- need $ noHsObjs ++ hsObjs
- return (noHsObjs ++ hsObjs)
+ hsObjs <- hsObjects context
+ need $ hsObjs ++ noHsObjs
+ return (hsObjs ++ noHsObjs)
-- | Return extra library targets.
extraTargets :: Context -> Action [FilePath]