025408a
--- ghc-7.6.3/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs~	2013-04-19 06:32:04.000000000 +0900
025408a
+++ ghc-7.6.3/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs	2013-06-12 11:35:39.832840754 +0900
025408a
@@ -837,6 +837,8 @@
025408a
 
025408a
       dynamicOpts = vanillaOpts `mappend` mempty {
025408a
                       ghcOptDynamic        = toFlag True,
025408a
+                      ghcOptHiSuffix       = toFlag "dyn_hi",
025408a
+                      ghcOptObjSuffix      = toFlag "dyn_o",
025408a
                       ghcOptExtra          = ghcSharedOptions exeBi
025408a
                     }
025408a
 
025408a
@@ -855,9 +857,9 @@
025408a
   -- with profiling. This is because the code that TH needs to
025408a
   -- run at compile time needs to be the vanilla ABI so it can
025408a
   -- be loaded up and run by the compiler.
025408a
-  when (withProfExe lbi &&
025408a
+  when ((withProfExe lbi || withDynExe lbi) &&
025408a
         EnableExtension TemplateHaskell `elem` allExtensions exeBi) $
025408a
-    runGhcProg exeProfOpts { ghcOptNoLink = toFlag True }
4d0408e
+    runGhcProg vanillaOpts { ghcOptNoLink = toFlag True }
025408a
 
025408a
   runGhcProg exeOpts { ghcOptOutputFile = toFlag (targetDir  exeNameReal) }
025408a