diff -u ghc-6.12.0.20091010/libraries/Cabal/Distribution/Simple/GHC.hs\~ ghc-6.12.0.20091010/libraries/Cabal/Distribution/Simple/GHC.hs
--- ghc-6.12.0.20091010/libraries/Cabal/Distribution/Simple/GHC.hs~	2009-10-11 03:15:02.000000000 +1000
+++ ghc-6.12.0.20091010/libraries/Cabal/Distribution/Simple/GHC.hs	2009-10-20 23:46:58.000000000 +1000
@@ -639,6 +639,9 @@
           :  (if linkExe
                  then ["-o", targetDir </> exeNameReal]
                  else ["-c"])
+          ++ (if (withSharedLib lbi)
+                 then ["-dynamic"]
+                 else [])
           ++ constructGHCCmdLine lbi exeBi clbi exeDir verbosity
           ++ [exeDir </> x | x <- cObjs]
           ++ [srcMainFile]
