[commit: ghc] wip/nfs-locking: Duplicate libffi library for each build way (c88fc78)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:29:45 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/c88fc78440eb105ba5fe7d9a8bede47b30de36d6/ghc
>---------------------------------------------------------------
commit c88fc78440eb105ba5fe7d9a8bede47b30de36d6
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Sat Jan 7 02:50:04 2017 +0000
Duplicate libffi library for each build way
>---------------------------------------------------------------
c88fc78440eb105ba5fe7d9a8bede47b30de36d6
src/Rules/Libffi.hs | 4 ++--
src/Settings/Packages/Rts.hs | 11 +++++++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/Rules/Libffi.hs b/src/Rules/Libffi.hs
index 65ec1d7..0f703d9 100644
--- a/src/Rules/Libffi.hs
+++ b/src/Rules/Libffi.hs
@@ -55,8 +55,8 @@ libffiRules = do
forM_ hs $ \header ->
copyFile header (rtsBuildPath -/- takeFileName header)
- libffiName <- rtsLibffiLibraryName
- copyFile libffiLibrary (rtsBuildPath -/- "lib" ++ libffiName <.> "a")
+ ways <- interpretInContext libffiContext (getLibraryWays <> getRtsWays)
+ forM_ ways $ \way -> copyFile libffiLibrary =<< rtsLibffiLibrary way
putSuccess $ "| Successfully built custom library 'libffi'"
diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs
index 8e71c87..e8000c8 100644
--- a/src/Settings/Packages/Rts.hs
+++ b/src/Settings/Packages/Rts.hs
@@ -1,4 +1,4 @@
-module Settings.Packages.Rts (rtsPackageArgs, rtsLibffiLibraryName) where
+module Settings.Packages.Rts (rtsPackageArgs, rtsLibffiLibrary) where
import Base
import GHC
@@ -7,6 +7,7 @@ import Oracles.Config.Setting
import Oracles.Path
import Predicate
import Settings
+import Settings.Path
rtsLibffiLibraryName :: Action FilePath
rtsLibffiLibraryName = do
@@ -17,6 +18,12 @@ rtsLibffiLibraryName = do
(False, False) -> "Cffi"
(_ , True ) -> "Cffi-6"
+rtsLibffiLibrary :: Way -> Action FilePath
+rtsLibffiLibrary way = do
+ name <- rtsLibffiLibraryName
+ suf <- libsuf way
+ return $ rtsBuildPath -/- "lib" ++ name ++ suf
+
rtsPackageArgs :: Args
rtsPackageArgs = package rts ? do
let yesNo = lift . fmap (\x -> if x then "YES" else "NO")
@@ -38,7 +45,7 @@ rtsPackageArgs = package rts ? do
way <- getWay
path <- getBuildPath
top <- getTopDirectory
- libffiName <- lift $ rtsLibffiLibraryName
+ libffiName <- lift rtsLibffiLibraryName
ffiIncludeDir <- getSetting FfiIncludeDir
ffiLibraryDir <- getSetting FfiLibDir
mconcat
More information about the ghc-commits
mailing list