summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadrian/src/Rules/Generate.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 1736405a15..ef3d8aa3b4 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -209,8 +209,9 @@ emptyTarget = vanillaContext (error "Rules.Generate.emptyTarget: unknown stage")
ghcWrapper :: Stage -> Expr String
ghcWrapper Stage0 = error "Stage0 GHC does not require a wrapper script to run."
ghcWrapper stage = do
- dbPath <- expr $ packageDbPath stage
- ghcPath <- expr $ programPath (vanillaContext (pred stage) ghc)
+ dbPath <- expr $ (</>) <$> topDirectory <*> packageDbPath stage
+ ghcPath <- expr $ (</>) <$> topDirectory
+ <*> programPath (vanillaContext (pred stage) ghc)
return $ unwords $ map show $ [ ghcPath ]
++ [ "-package-db " ++ dbPath | stage == Stage1 ]
++ [ "$@" ]