[commit: ghc] wip/nfs-locking: Add build rules for *.S sources, add rts/*.S files. (b6bb19c)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:44:39 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/b6bb19c87edc0e36e1322af12622493a61f48386/ghc

>---------------------------------------------------------------

commit b6bb19c87edc0e36e1322af12622493a61f48386
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Jan 7 23:53:44 2016 +0000

    Add build rules for *.S sources, add rts/*.S files.
    
    See #126.


>---------------------------------------------------------------

b6bb19c87edc0e36e1322af12622493a61f48386
 src/Rules/Data.hs         | 11 ++++++++---
 src/Rules/Dependencies.hs |  9 +++++----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/Rules/Data.hs b/src/Rules/Data.hs
index 46072ce..de4f8c0 100644
--- a/src/Rules/Data.hs
+++ b/src/Rules/Data.hs
@@ -95,13 +95,18 @@ buildPackageData rs target @ (PartialTarget stage pkg) = do
                           ++ [ "posix" | not windows ]
                           ++ [ "win32" |     windows ]
                 -- TODO: rts/dist/build/sm/Evac_thr.c, rts/dist/build/sm/Scav_thr.c
-                -- TODO: adding cmm sources to C_SRCS is a hack; rethink after #18
+                -- TODO: adding cmm/S sources to C_SRCS is a hack; rethink after #18
                 cSrcs    <- getDirectoryFiles (pkgPath pkg) (map (-/- "*.c") dirs)
                 cmmSrcs  <- getDirectoryFiles (pkgPath pkg) ["*.cmm"]
-                let extraSrcs = [ targetDirectory Stage1 rts -/- "build/AutoApply.cmm" ]
+                buildAdjustor   <- anyTargetArch ["i386", "powerpc", "powerpc64"]
+                buildStgCRunAsm <- anyTargetArch ["powerpc64le"]
+                let sSrcs = [ "AdjustorAsm.S" | buildAdjustor   ]
+                         ++ [ "StgCRunAsm.S"  | buildStgCRunAsm ]
+                    extraSrcs = [ targetDirectory Stage1 rts -/- "build/AutoApply.cmm" ]
                 includes <- interpretPartial target $ fromDiffExpr includesArgs
                 let contents = unlines $ map (prefix++)
-                        [ "C_SRCS = "   ++ unwords (cSrcs ++ cmmSrcs ++ extraSrcs)
+                        [ "C_SRCS = "
+                          ++ unwords (cSrcs ++ cmmSrcs ++ sSrcs ++ extraSrcs)
                         , "CC_OPTS = "  ++ unwords includes
                         , "COMPONENT_ID = " ++ "rts" ]
                 writeFileChanged mk contents
diff --git a/src/Rules/Dependencies.hs b/src/Rules/Dependencies.hs
index 79bcdb2..2da9549 100644
--- a/src/Rules/Dependencies.hs
+++ b/src/Rules/Dependencies.hs
@@ -15,10 +15,11 @@ buildPackageDependencies _ target @ (PartialTarget stage pkg) =
         dropBuild = (pkgPath pkg ++) . drop (length buildPath)
         hDepFile  = buildPath -/- ".hs-dependencies"
     in do
-        [ buildPath ++ "//*.c.deps", buildPath ++ "//*.cmm.deps" ] |%> \out -> do
-            let srcFile = dropBuild . dropExtension $ out
-            need [srcFile]
-            build $ fullTarget target (GccM stage) [srcFile] [out]
+        fmap (buildPath++)
+            [ "//*.c.deps", "//*.cmm.deps", "//*.S.deps" ] |%> \out -> do
+                let srcFile = dropBuild . dropExtension $ out
+                need [srcFile]
+                build $ fullTarget target (GccM stage) [srcFile] [out]
 
         hDepFile %> \out -> do
             srcs <- interpretPartial target getPackageSources



More information about the ghc-commits mailing list