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

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 ...@@ -41,6 +41,9 @@ compilePackage rs = do
[ root -/- "**/build/s/**/*." ++ wayPat ++ "o" [ root -/- "**/build/s/**/*." ++ wayPat ++ "o"
| wayPat <- wayPats] |%> compileNonHsObject rs Asm | wayPat <- wayPats] |%> compileNonHsObject rs Asm
[ root -/- "**/build/S/**/*." ++ wayPat ++ "o"
| wayPat <- wayPats] |%> compileNonHsObject rs Asm
-- All else is haskell. -- All else is haskell.
-- This comes last as it overlaps with the above rules' file patterns. -- This comes last as it overlaps with the above rules' file patterns.
forM_ ((,) <$> hsExts <*> wayPats) $ \ ((oExt, hiExt), wayPat) -> forM_ ((,) <$> hsExts <*> wayPats) $ \ ((oExt, hiExt), wayPat) ->
......
...@@ -112,11 +112,13 @@ allObjects context = (++) <$> nonHsObjects context <*> hsObjects context ...@@ -112,11 +112,13 @@ allObjects context = (++) <$> nonHsObjects context <*> hsObjects context
-- (object files built from C, C-- and sometimes other things). -- (object files built from C, C-- and sometimes other things).
nonHsObjects :: Context -> Action [FilePath] nonHsObjects :: Context -> Action [FilePath]
nonHsObjects context = do nonHsObjects context = do
asmSrcs <- interpretInContext context (getContextData asmSrcs)
asmObjs <- mapM (objectPath context) asmSrcs
cObjs <- cObjects context cObjs <- cObjects context
cmmSrcs <- interpretInContext context (getContextData cmmSrcs) cmmSrcs <- interpretInContext context (getContextData cmmSrcs)
cmmObjs <- mapM (objectPath context) cmmSrcs cmmObjs <- mapM (objectPath context) cmmSrcs
eObjs <- extraObjects context 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. -- | Return all the C object files needed to build the given library context.
cObjects :: Context -> Action [FilePath] cObjects :: Context -> Action [FilePath]
......
...@@ -114,10 +114,12 @@ buildBinary rs bin context@Context {..} = do ...@@ -114,10 +114,12 @@ buildBinary rs bin context@Context {..} = do
when (stage > Stage0) $ do when (stage > Stage0) $ do
ways <- interpretInContext context (getLibraryWays <> getRtsWays) ways <- interpretInContext context (getLibraryWays <> getRtsWays)
needLibrary [ (rtsContext stage) { way = w } | w <- ways ] needLibrary [ (rtsContext stage) { way = w } | w <- ways ]
cSrcs <- interpretInContext context (getContextData cSrcs) asmSrcs <- interpretInContext context (getContextData asmSrcs)
cObjs <- mapM (objectPath context) cSrcs asmObjs <- mapM (objectPath context) asmSrcs
hsObjs <- hsObjects context cSrcs <- interpretInContext context (getContextData cSrcs)
let binDeps = cObjs ++ hsObjs cObjs <- mapM (objectPath context) cSrcs
hsObjs <- hsObjects context
let binDeps = asmObjs ++ cObjs ++ hsObjs
need binDeps need binDeps
buildWithResources rs $ target context (Ghc LinkHs stage) binDeps [bin] buildWithResources rs $ target context (Ghc LinkHs stage) binDeps [bin]
synopsis <- pkgSynopsis package 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