enable LinkDynLib in compilier phase
authory.zhuang5@lse.ac.uk <unknown>
Wed, 22 Apr 2009 20:19:37 +0000 (20:19 +0000)
committery.zhuang5@lse.ac.uk <unknown>
Wed, 22 Apr 2009 20:19:37 +0000 (20:19 +0000)
compiler/main/DriverPipeline.hs

index 6557c05..973495e 100644 (file)
@@ -296,6 +296,24 @@ link NoLink _ _ _
    = return Succeeded
 
 link LinkBinary dflags batch_attempt_linking hpt
+   = link' dflags batch_attempt_linking hpt
+
+link LinkDynLib dflags batch_attempt_linking hpt
+   = link' dflags batch_attempt_linking hpt
+
+-- warning suppression
+link other _ _ _ = panicBadLink other
+
+panicBadLink :: GhcLink -> a
+panicBadLink other = panic ("link: GHC not built to link this way: " ++
+                            show other)
+
+link' :: DynFlags                -- dynamic flags
+      -> Bool                    -- attempt linking in batch mode?
+      -> HomePackageTable        -- what to link
+      -> IO SuccessFlag
+
+link' dflags batch_attempt_linking hpt
    | batch_attempt_linking
    = do
         let
@@ -347,13 +365,6 @@ link LinkBinary dflags batch_attempt_linking hpt
                                 text "   Main.main not exported; not linking.")
         return Succeeded
 
--- warning suppression
-link other _ _ _ = panicBadLink other
-
-panicBadLink :: GhcLink -> a
-panicBadLink other = panic ("link: GHC not built to link this way: " ++
-                            show other)
-
 
 linkingNeeded :: DynFlags -> [Linkable] -> [PackageId] -> IO Bool
 linkingNeeded dflags linkables pkg_deps = do