Commit 166e1c2a authored by Stefan Schulze Frielinghaus's avatar Stefan Schulze Frielinghaus Committed by Marge Bot

Hadrian: Take care of assembler source files

Fixes #17286.
parent 30f5ac07
Pipeline #11280 failed with stages
in 882 minutes and 12 seconds
......@@ -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) ->
......
......@@ -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]
......
......@@ -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
......
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