[commit: ghc] wip/nfs-locking: Add extra objects into integerGmp library. (9439336)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:10:20 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/9439336c258c9e1d93b1da57cde1d89e8800fbf0/ghc
>---------------------------------------------------------------
commit 9439336c258c9e1d93b1da57cde1d89e8800fbf0
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Thu Dec 10 00:28:42 2015 +0000
Add extra objects into integerGmp library.
>---------------------------------------------------------------
9439336c258c9e1d93b1da57cde1d89e8800fbf0
src/Rules/Library.hs | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs
index 9e4f7d5..b0afdc6 100644
--- a/src/Rules/Library.hs
+++ b/src/Rules/Library.hs
@@ -1,6 +1,7 @@
module Rules.Library (buildPackageLibrary, cSources, hSources) where
import Expression hiding (splitPath)
+import GHC
import Oracles
import Predicates (splitObjects)
import Rules.Actions
@@ -36,9 +37,12 @@ buildPackageLibrary _ target @ (PartialTarget stage pkg) = do
return . map (splitPath -/-)
. filter (not . all (== '.')) $ contents
+ eObjs <- extraObjects target
+ let objs = cObjs ++ splitObjs ++ eObjs
+
if "//*-0.*" ?== a
- then build $ fullTarget target Ar [] [a]
- else build $ fullTarget target Ar (cObjs ++ splitObjs) [a]
+ then build $ fullTarget target Ar [] [a] -- TODO: scan for dlls
+ else build $ fullTarget target Ar objs [a]
synopsis <- interpretPartial target $ getPkgData Synopsis
putSuccess $ "/--------\n| Successfully built package library '"
@@ -65,3 +69,10 @@ hSources target = do
modules <- interpretPartial target $ getPkgDataList Modules
-- GHC.Prim is special: we do not build it
return . map (replaceEq '.' '/') . filter (/= "GHC.Prim") $ modules
+
+extraObjects :: PartialTarget -> Action [FilePath]
+extraObjects (PartialTarget _ pkg) = do
+ gmpObjs <- getDirectoryFiles "" [pkgPath pkg -/- "gmp/objs/*.o"]
+ if pkg == integerGmp
+ then return gmpObjs
+ else return []
More information about the ghc-commits
mailing list