From 2647ab17019ec1dc85ddef5072549aef4a1043cf Mon Sep 17 00:00:00 2001 From: "y.zhuang5@lse.ac.uk" Date: Wed, 22 Apr 2009 20:19:37 +0000 Subject: [PATCH] enable LinkDynLib in compilier phase --- compiler/main/DriverPipeline.hs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 6557c05..973495e 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -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 -- 1.7.10.4