summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2019-10-08 10:23:21 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-11 22:10:51 -0400
commit166e1c2adf73b69bfbbec81e98a78814a031ddc7 (patch)
tree5c778508a75477df55757158b4df787032db5dc9
parent30f5ac07a4843b42ed479462661e9d79f038cf09 (diff)
downloadhaskell-166e1c2adf73b69bfbbec81e98a78814a031ddc7.tar.gz
Hadrian: Take care of assembler source files
Fixes #17286.
-rw-r--r--hadrian/src/Rules/Compile.hs3
-rw-r--r--hadrian/src/Rules/Library.hs4
-rw-r--r--hadrian/src/Rules/Program.hs10
3 files changed, 12 insertions, 5 deletions
diff --git a/hadrian/src/Rules/Compile.hs b/hadrian/src/Rules/Compile.hs
index 92a94fe611..546ce08cb6 100644
--- a/hadrian/src/Rules/Compile.hs
+++ b/hadrian/src/Rules/Compile.hs
@@ -41,6 +41,9 @@ compilePackage rs = do
[ root -/- "**/build/s/**/*." ++ wayPat ++ "o"
| wayPat <- wayPats] |%> compileNonHsObject rs Asm
+ [ root -/- "**/build/S/**/*." ++ wayPat ++ "o"
+ | wayPat <- wayPats] |%> compileNonHsObject rs Asm
+
-- All else is haskell.
-- This comes last as it overlaps with the above rules' file patterns.
forM_ ((,) <$> hsExts <*> wayPats) $ \ ((oExt, hiExt), wayPat) ->
diff --git a/hadrian/src/Rules/Library.hs b/hadrian/src/Rules/Library.hs
index 0daf4681d1..320f45a878 100644
--- a/hadrian/src/Rules/Library.hs
+++ b/hadrian/src/Rules/Library.hs
@@ -112,11 +112,13 @@ allObjects context = (++) <$> nonHsObjects context <*> hsObjects context
-- (object files built from C, C-- and sometimes other things).
nonHsObjects :: Context -> Action [FilePath]
nonHsObjects context = do
+ asmSrcs <- interpretInContext context (getContextData asmSrcs)
+ asmObjs <- mapM (objectPath context) asmSrcs
cObjs <- cObjects context
cmmSrcs <- interpretInContext context (getContextData cmmSrcs)
cmmObjs <- mapM (objectPath context) cmmSrcs
eObjs <- extraObjects context
- return $ cObjs ++ cmmObjs ++ eObjs
+ return $ asmObjs ++ cObjs ++ cmmObjs ++ eObjs
-- | Return all the C object files needed to build the given library context.
cObjects :: Context -> Action [FilePath]
diff --git a/hadrian/src/Rules/Program.hs b/hadrian/src/Rules/Program.hs
index 6273f3da4d..df542c0f1e 100644
--- a/hadrian/src/Rules/Program.hs
+++ b/hadrian/src/Rules/Program.hs
@@ -114,10 +114,12 @@ buildBinary rs bin context@Context {..} = do
when (stage > Stage0) $ do
ways <- interpretInContext context (getLibraryWays <> getRtsWays)
needLibrary [ (rtsContext stage) { way = w } | w <- ways ]
- cSrcs <- interpretInContext context (getContextData cSrcs)
- cObjs <- mapM (objectPath context) cSrcs
- hsObjs <- hsObjects context
- let binDeps = cObjs ++ hsObjs
+ asmSrcs <- interpretInContext context (getContextData asmSrcs)
+ asmObjs <- mapM (objectPath context) asmSrcs
+ cSrcs <- interpretInContext context (getContextData cSrcs)
+ cObjs <- mapM (objectPath context) cSrcs
+ hsObjs <- hsObjects context
+ let binDeps = asmObjs ++ cObjs ++ hsObjs
need binDeps
buildWithResources rs $ target context (Ghc LinkHs stage) binDeps [bin]
synopsis <- pkgSynopsis package