summaryrefslogtreecommitdiffstats
path: root/Cabal-fix-dynamic-exec-for-TH.patch
blob: fb95f83fecb0e3dbb791c528cf4984a50dcc82f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- ghc-7.6.3/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs~	2013-04-19 06:32:04.000000000 +0900
+++ ghc-7.6.3/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs	2013-06-12 11:35:39.832840754 +0900
@@ -837,6 +837,8 @@
 
       dynamicOpts = vanillaOpts `mappend` mempty {
                       ghcOptDynamic        = toFlag True,
+                      ghcOptHiSuffix       = toFlag "dyn_hi",
+                      ghcOptObjSuffix      = toFlag "dyn_o",
                       ghcOptExtra          = ghcSharedOptions exeBi
                     }
 
@@ -855,9 +857,9 @@
   -- with profiling. This is because the code that TH needs to
   -- run at compile time needs to be the vanilla ABI so it can
   -- be loaded up and run by the compiler.
-  when (withProfExe lbi &&
+  when ((withProfExe lbi || withDynExe lbi) &&
         EnableExtension TemplateHaskell `elem` allExtensions exeBi) $
-    runGhcProg exeProfOpts { ghcOptNoLink = toFlag True }
+    runGhcProg vanillaOpts { ghcOptNoLink = toFlag True }
 
   runGhcProg exeOpts { ghcOptOutputFile = toFlag (targetDir </> exeNameReal) }