Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix the logic for building profiled executables with TemplateHaskell.

This was broken in 5f50fb1: Instead of a vanilla version, the code would
build a profiling version of the objects for TH.
  • Loading branch information...
commit 51ba2b4d0b903f1c7604b2c4c3e951bf38f97dcd 1 parent 96c3f33
Bertram Felgenhauer int-e authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 Cabal/Distribution/Simple/GHC.hs
13 Cabal/Distribution/Simple/GHC.hs
View
@@ -840,16 +840,17 @@ buildExe verbosity _pkg_descr lbi
ghcOptExtra = ghcSharedOptions exeBi
}
- exeOpts | withDynExe lbi = dynamicOpts
- | otherwise = vanillaOpts
+ exeNoProfOpts | withDynExe lbi = dynamicOpts
+ | otherwise = vanillaOpts
- exeProfOpts = exeOpts `mappend` mempty {
+ exeOpts | withProfExe lbi = vanillaOpts `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptHiSuffix = toFlag "p_hi",
ghcOptObjSuffix = toFlag "p_o",
- ghcOptExtra = ghcProfOptions exeBi,
- ghcOptNoLink = toFlag True
+ ghcOptExtra = ghcProfOptions exeBi
}
+ | otherwise = exeNoProfOpts
+
-- For building exe's for profiling that use TH we actually
-- have to build twice, once without profiling and the again
-- with profiling. This is because the code that TH needs to
@@ -857,7 +858,7 @@ buildExe verbosity _pkg_descr lbi
-- be loaded up and run by the compiler.
when (withProfExe lbi &&
EnableExtension TemplateHaskell `elem` allExtensions exeBi) $
- runGhcProg exeProfOpts { ghcOptNoLink = toFlag True }
+ runGhcProg exeNoProfOpts { ghcOptNoLink = toFlag True }
runGhcProg exeOpts { ghcOptOutputFile = toFlag (targetDir </> exeNameReal) }
Please sign in to comment.
Something went wrong with that request. Please try again.