diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2019-03-10 17:34:42 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-12 09:04:52 -0400 |
commit | 61264556d5c817b55332a199b03fa1f559e92ee2 (patch) | |
tree | 3d192347a3e380aee62b93c806d8513fc4dd3cbd /hadrian/src/Oracles | |
parent | b232231065f5e40ae3a6bd515bb42330cf484fcc (diff) | |
download | haskell-61264556d5c817b55332a199b03fa1f559e92ee2.tar.gz |
Hadrian: Make libsuf and distDir stage aware
The version suffix needs to be the version of the stage 0 compiler
when building shared libraries with the stage 0 compiler.
Diffstat (limited to 'hadrian/src/Oracles')
-rw-r--r-- | hadrian/src/Oracles/Setting.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs index 02ac42e0c9..4666539f93 100644 --- a/hadrian/src/Oracles/Setting.hs +++ b/hadrian/src/Oracles/Setting.hs @@ -210,6 +210,10 @@ ghcCanonVersion = do topDirectory :: Action FilePath topDirectory = fixAbsolutePathOnWindows =<< setting GhcSourcePath +ghcVersionStage :: Stage -> Action String +ghcVersionStage Stage0 = setting GhcVersion +ghcVersionStage _ = setting ProjectVersion + -- | The file suffix used for libraries of a given build 'Way'. For example, -- @_p.a@ corresponds to a static profiled library, and @-ghc7.11.20141222.so@ -- is a dynamic vanilly library. Why do we need GHC version number in the @@ -219,11 +223,11 @@ topDirectory = fixAbsolutePathOnWindows =<< setting GhcSourcePath -- live in their own per-package directory and hence do not need a unique -- filename. We also need to respect the system's dynamic extension, e.g. @.dll@ -- or @.so@. -libsuf :: Way -> Action String -libsuf way +libsuf :: Stage -> Way -> Action String +libsuf st way | not (wayUnit Dynamic way) = return (waySuffix way ++ ".a") -- e.g., _p.a | otherwise = do extension <- setting DynamicExtension -- e.g., .dll or .so - version <- setting ProjectVersion -- e.g., 7.11.20141222 + version <- ghcVersionStage st -- e.g. 8.4.4 or 8.9.xxxx let suffix = waySuffix (removeWayUnit Dynamic way) return (suffix ++ "-ghc" ++ version ++ extension) |