1 -----------------------------------------------------------------------------
2 -- $Id: DriverState.hs,v 1.9 2000/10/27 14:56:00 sewardj Exp $
4 -- Settings for the driver
6 -- (c) The University of Glasgow 2000
8 -----------------------------------------------------------------------------
10 module DriverState where
12 #include "HsVersions.h"
29 -----------------------------------------------------------------------------
32 -- certain flags can be specified on a per-file basis, in an OPTIONS
33 -- pragma at the beginning of the source file. This means that when
34 -- compiling mulitple files, we have to restore the global option
35 -- settings before compiling a new file.
37 -- The DriverState record contains the per-file-mutable state.
39 data DriverState = DriverState {
41 -- are we runing cpp on this file?
45 stolen_x86_regs :: Int,
46 cmdline_hc_includes :: [String],
48 -- options for a particular phase
56 initDriverState = DriverState {
59 cmdline_hc_includes = [],
67 GLOBAL_VAR(v_Driver_state, initDriverState, DriverState)
69 readState :: (DriverState -> a) -> IO a
70 readState f = readIORef v_Driver_state >>= return . f
72 updateState :: (DriverState -> DriverState) -> IO ()
73 updateState f = readIORef v_Driver_state >>= writeIORef v_Driver_state . f
75 addOpt_L a = updateState (\s -> s{opt_L = a : opt_L s})
76 addOpt_P a = updateState (\s -> s{opt_P = a : opt_P s})
77 addOpt_c a = updateState (\s -> s{opt_c = a : opt_c s})
78 addOpt_a a = updateState (\s -> s{opt_a = a : opt_a s})
79 addOpt_m a = updateState (\s -> s{opt_m = a : opt_m s})
81 addCmdlineHCInclude a =
82 updateState (\s -> s{cmdline_hc_includes = a : cmdline_hc_includes s})
84 -- we add to the options from the front, so we need to reverse the list
85 getOpts :: (DriverState -> [a]) -> IO [a]
86 getOpts opts = readState opts >>= return . reverse
88 -----------------------------------------------------------------------------
89 -- non-configured things
91 cHaskell1Version = "5" -- i.e., Haskell 98
93 -----------------------------------------------------------------------------
94 -- Global compilation flags
96 -- location of compiler-related files
97 GLOBAL_VAR(v_TopDir, clibdir, String)
98 GLOBAL_VAR(v_Inplace, False, Bool)
101 v_Hs_source_cpp_opts = global
102 [ "-D__HASKELL1__="++cHaskell1Version
103 , "-D__GLASGOW_HASKELL__="++cProjectVersionInt
105 , "-D__CONCURRENT_HASKELL__"
107 {-# NOINLINE v_Hs_source_cpp_opts #-}
110 GLOBAL_VAR(v_Verbose, False, Bool)
111 is_verbose = do v <- readIORef v_Verbose; if v then return "-v" else return ""
113 -- Keep output from intermediate phases
114 GLOBAL_VAR(v_Keep_hi_diffs, False, Bool)
115 GLOBAL_VAR(v_Keep_hc_files, False, Bool)
116 GLOBAL_VAR(v_Keep_s_files, False, Bool)
117 GLOBAL_VAR(v_Keep_raw_s_files, False, Bool)
118 GLOBAL_VAR(v_Keep_tmp_files, False, Bool)
121 GLOBAL_VAR(v_Scale_sizes_by, 1.0, Double)
122 GLOBAL_VAR(v_Dry_run, False, Bool)
123 #if !defined(HAVE_WIN32_DLL_SUPPORT) || defined(DONT_WANT_WIN32_DLL_SUPPORT)
124 GLOBAL_VAR(v_Static, True, Bool)
126 GLOBAL_VAR(v_Static, False, Bool)
128 GLOBAL_VAR(v_Recomp, True, Bool)
129 GLOBAL_VAR(v_Collect_ghc_timing, False, Bool)
130 GLOBAL_VAR(v_Do_asm_mangling, True, Bool)
131 GLOBAL_VAR(v_Excess_precision, False, Bool)
133 -----------------------------------------------------------------------------
134 -- Splitting object files (for libraries)
136 GLOBAL_VAR(v_Split_object_files, False, Bool)
137 GLOBAL_VAR(v_Split_prefix, "", String)
138 GLOBAL_VAR(v_N_split_files, 0, Int)
141 can_split = prefixMatch "i386" cTARGETPLATFORM
142 || prefixMatch "alpha" cTARGETPLATFORM
143 || prefixMatch "hppa" cTARGETPLATFORM
144 || prefixMatch "m68k" cTARGETPLATFORM
145 || prefixMatch "mips" cTARGETPLATFORM
146 || prefixMatch "powerpc" cTARGETPLATFORM
147 || prefixMatch "rs6000" cTARGETPLATFORM
148 || prefixMatch "sparc" cTARGETPLATFORM
150 -----------------------------------------------------------------------------
151 -- Compiler output options
153 GLOBAL_VAR(v_Hsc_Lang, if cGhcWithNativeCodeGen == "YES" &&
154 (prefixMatch "i386" cTARGETPLATFORM ||
155 prefixMatch "sparc" cTARGETPLATFORM)
160 GLOBAL_VAR(v_Output_dir, Nothing, Maybe String)
161 GLOBAL_VAR(v_Output_suf, Nothing, Maybe String)
162 GLOBAL_VAR(v_Output_file, Nothing, Maybe String)
163 GLOBAL_VAR(v_Output_hi, Nothing, Maybe String)
165 GLOBAL_VAR(v_Ld_inputs, [], [String])
167 odir_ify :: String -> IO String
169 odir_opt <- readIORef v_Output_dir
172 Just d -> return (newdir d f)
174 osuf_ify :: String -> IO String
176 osuf_opt <- readIORef v_Output_suf
179 Just s -> return (newsuf s f)
181 -----------------------------------------------------------------------------
184 GLOBAL_VAR(v_ProduceHi, True, Bool)
185 GLOBAL_VAR(v_Hi_on_stdout, False, Bool)
186 GLOBAL_VAR(v_Hi_suf, "hi", String)
188 -----------------------------------------------------------------------------
189 -- Warnings & sanity checking
191 -- Warning packages that are controlled by -W and -Wall. The 'standard'
192 -- warnings that you get all the time are
194 -- -fwarn-overlapping-patterns
195 -- -fwarn-missing-methods
196 -- -fwarn-missing-fields
197 -- -fwarn-deprecations
198 -- -fwarn-duplicate-exports
200 -- these are turned off by -Wnot.
203 standardWarnings = [ "-fwarn-overlapping-patterns"
204 , "-fwarn-missing-methods"
205 , "-fwarn-missing-fields"
206 , "-fwarn-deprecations"
207 , "-fwarn-duplicate-exports"
209 minusWOpts = standardWarnings ++
210 [ "-fwarn-unused-binds"
211 , "-fwarn-unused-matches"
212 , "-fwarn-incomplete-patterns"
213 , "-fwarn-unused-imports"
215 minusWallOpts = minusWOpts ++
216 [ "-fwarn-type-defaults"
217 , "-fwarn-name-shadowing"
218 , "-fwarn-missing-signatures"
219 , "-fwarn-hi-shadowing"
222 data WarningState = W_default | W_ | W_all | W_not
223 GLOBAL_VAR(v_Warning_opt, W_default, WarningState)
225 -----------------------------------------------------------------------------
226 -- Compiler optimisation options
228 GLOBAL_VAR(v_OptLevel, 0, Int)
230 setOptLevel :: String -> IO ()
231 setOptLevel "" = do { writeIORef v_OptLevel 1; go_via_C }
232 setOptLevel "not" = writeIORef v_OptLevel 0
233 setOptLevel [c] | isDigit c = do
234 let level = ord c - ord '0'
235 writeIORef v_OptLevel level
236 when (level >= 1) go_via_C
237 setOptLevel s = unknownFlagErr ("-O"++s)
240 l <- readIORef v_Hsc_Lang
241 case l of { HscAsm -> writeIORef v_Hsc_Lang HscC;
242 _other -> return () }
244 GLOBAL_VAR(v_minus_o2_for_C, False, Bool)
246 GLOBAL_VAR(v_MaxSimplifierIterations, 4, Int)
247 GLOBAL_VAR(v_StgStats, False, Bool)
248 GLOBAL_VAR(v_UsageSPInf, False, Bool) -- Off by default
249 GLOBAL_VAR(v_Strictness, True, Bool)
250 GLOBAL_VAR(v_CPR, True, Bool)
251 GLOBAL_VAR(v_CSE, True, Bool)
253 hsc_minusO2_flags = hsc_minusO_flags -- for now
257 "-fignore-interface-pragmas",
258 "-fomit-interface-pragmas"
264 "-fdo-eta-reduction",
265 "-fdo-lambda-eta-expansion",
271 buildCoreToDo :: IO [CoreToDo]
273 opt_level <- readIORef v_OptLevel
274 max_iter <- readIORef v_MaxSimplifierIterations
275 usageSP <- readIORef v_UsageSPInf
276 strictness <- readIORef v_Strictness
277 cpr <- readIORef v_CPR
278 cse <- readIORef v_CSE
280 if opt_level == 0 then return
282 CoreDoSimplify (isAmongSimpl [
283 MaxSimplifierIterations max_iter
287 else {- level >= 1 -} return [
289 -- initial simplify: mk specialiser happy: minimum effort please
290 CoreDoSimplify (isAmongSimpl [
292 -- Don't inline anything till full laziness has bitten
293 -- In particular, inlining wrappers inhibits floating
294 -- e.g. ...(case f x of ...)...
295 -- ==> ...(case (case x of I# x# -> fw x#) of ...)...
296 -- ==> ...(case x of I# x# -> case fw x# of ...)...
297 -- and now the redex (f x) isn't floatable any more
299 -- Similarly, don't apply any rules until after full
300 -- laziness. Notably, list fusion can prevent floating.
302 -- Don't do case-of-case transformations.
303 -- This makes full laziness work better
304 MaxSimplifierIterations max_iter
307 -- Specialisation is best done before full laziness
308 -- so that overloaded functions have all their dictionary lambdas manifest
311 CoreDoFloatOutwards False{-not full-},
314 CoreDoSimplify (isAmongSimpl [
316 -- Want to run with inline phase 1 after the specialiser to give
317 -- maximum chance for fusion to work before we inline build/augment
318 -- in phase 2. This made a difference in 'ansi' where an
319 -- overloaded function wasn't inlined till too late.
320 MaxSimplifierIterations max_iter
323 -- infer usage information here in case we need it later.
324 -- (add more of these where you need them --KSW 1999-04)
325 if usageSP then CoreDoUSPInf else CoreDoNothing,
327 CoreDoSimplify (isAmongSimpl [
328 -- Need inline-phase2 here so that build/augment get
329 -- inlined. I found that spectral/hartel/genfft lost some useful
330 -- strictness in the function sumcode' if augment is not inlined
331 -- before strictness analysis runs
333 MaxSimplifierIterations max_iter
336 CoreDoSimplify (isAmongSimpl [
337 MaxSimplifierIterations 2
338 -- No -finline-phase: allow all Ids to be inlined now
339 -- This gets foldr inlined before strictness analysis
342 if strictness then CoreDoStrictness else CoreDoNothing,
343 if cpr then CoreDoCPResult else CoreDoNothing,
347 CoreDoSimplify (isAmongSimpl [
348 MaxSimplifierIterations max_iter
349 -- No -finline-phase: allow all Ids to be inlined now
352 CoreDoFloatOutwards False{-not full-},
353 -- nofib/spectral/hartel/wang doubles in speed if you
354 -- do full laziness late in the day. It only happens
355 -- after fusion and other stuff, so the early pass doesn't
356 -- catch it. For the record, the redex is
357 -- f_el22 (f_el21 r_midblock)
359 -- Leave out lambda lifting for now
360 -- "-fsimplify", -- Tidy up results of full laziness
362 -- "-fmax-simplifier-iterations2",
364 -- "-ffloat-outwards-full",
366 -- We want CSE to follow the final full-laziness pass, because it may
367 -- succeed in commoning up things floated out by full laziness.
369 -- CSE must immediately follow a simplification pass, because it relies
370 -- on the no-shadowing invariant. See comments at the top of CSE.lhs
371 -- So it must NOT follow float-inwards, which can give rise to shadowing,
372 -- even if its input doesn't have shadows. Hence putting it between
374 if cse then CoreCSE else CoreDoNothing,
378 -- Case-liberation for -O2. This should be after
379 -- strictness analysis and the simplification which follows it.
381 -- ( ($OptLevel != 2)
383 -- : "-fliberate-case -fsimplify [ $Oopt_FB_Support -ffloat-lets-exposing-whnf -ffloat-primops-ok -fcase-of-case -fdo-case-elim -fcase-merge -fdo-lambda-eta-expansion -freuse-con -flet-to-case $Oopt_PedanticBottoms $Oopt_MaxSimplifierIterations $Oopt_ShowSimplifierProgress ]" ),
385 -- "-fliberate-case",
387 -- Final clean-up simplification:
388 CoreDoSimplify (isAmongSimpl [
389 MaxSimplifierIterations max_iter
390 -- No -finline-phase: allow all Ids to be inlined now
394 buildStgToDo :: IO [ StgToDo ]
396 stg_stats <- readIORef v_StgStats
397 let flags1 | stg_stats = [ D_stg_stats ]
401 ways_ <- readIORef v_Ways
402 let flags2 | WayProf `elem` ways_ = StgDoMassageForProfiling : flags1
407 -----------------------------------------------------------------------------
410 split_marker = ':' -- not configurable (ToDo)
412 v_Import_paths, v_Include_paths, v_Library_paths :: IORef [String]
413 GLOBAL_VAR(v_Import_paths, ["."], [String])
414 GLOBAL_VAR(v_Include_paths, ["."], [String])
415 GLOBAL_VAR(v_Library_paths, [], [String])
417 GLOBAL_VAR(v_Cmdline_libraries, [], [String])
419 addToDirList :: IORef [String] -> String -> IO ()
420 addToDirList ref path
421 = do paths <- readIORef ref
422 writeIORef ref (paths ++ split split_marker path)
424 -----------------------------------------------------------------------------
427 GLOBAL_VAR(v_Path_package_config, error "path_package_config", String)
429 -- package list is maintained in dependency order
430 GLOBAL_VAR(v_Packages, ("std":"rts":"gmp":[]), [String])
432 addPackage :: String -> IO ()
434 = do pkg_details <- readIORef v_Package_details
435 case lookupPkg package pkg_details of
436 Nothing -> throwDyn (OtherError ("unknown package name: " ++ package))
438 ps <- readIORef v_Packages
439 unless (package `elem` ps) $ do
440 mapM_ addPackage (package_deps details)
441 ps <- readIORef v_Packages
442 writeIORef v_Packages (package:ps)
444 getPackageImportPath :: IO [String]
445 getPackageImportPath = do
446 ps <- readIORef v_Packages
447 ps' <- getPackageDetails ps
448 return (nub (concat (map import_dirs ps')))
450 getPackageIncludePath :: IO [String]
451 getPackageIncludePath = do
452 ps <- readIORef v_Packages
453 ps' <- getPackageDetails ps
454 return (nub (filter (not.null) (concatMap include_dirs ps')))
456 -- includes are in reverse dependency order (i.e. rts first)
457 getPackageCIncludes :: IO [String]
458 getPackageCIncludes = do
459 ps <- readIORef v_Packages
460 ps' <- getPackageDetails ps
461 return (reverse (nub (filter (not.null) (concatMap c_includes ps'))))
463 getPackageLibraryPath :: IO [String]
464 getPackageLibraryPath = do
465 ps <- readIORef v_Packages
466 ps' <- getPackageDetails ps
467 return (nub (concat (map library_dirs ps')))
469 getPackageLibraries :: IO [String]
470 getPackageLibraries = do
471 ps <- readIORef v_Packages
472 ps' <- getPackageDetails ps
473 tag <- readIORef v_Build_tag
474 let suffix = if null tag then "" else '_':tag
476 map (\p -> map (++suffix) (hs_libraries p) ++ extra_libraries p) ps'
479 getPackageExtraGhcOpts :: IO [String]
480 getPackageExtraGhcOpts = do
481 ps <- readIORef v_Packages
482 ps' <- getPackageDetails ps
483 return (concatMap extra_ghc_opts ps')
485 getPackageExtraCcOpts :: IO [String]
486 getPackageExtraCcOpts = do
487 ps <- readIORef v_Packages
488 ps' <- getPackageDetails ps
489 return (concatMap extra_cc_opts ps')
491 getPackageExtraLdOpts :: IO [String]
492 getPackageExtraLdOpts = do
493 ps <- readIORef v_Packages
494 ps' <- getPackageDetails ps
495 return (concatMap extra_ld_opts ps')
497 getPackageDetails :: [String] -> IO [Package]
498 getPackageDetails ps = do
499 pkg_details <- readIORef v_Package_details
500 return [ pkg | p <- ps, Just pkg <- [ lookupPkg p pkg_details ] ]
502 GLOBAL_VAR(v_Package_details, (error "package_details"), [Package])
504 lookupPkg :: String -> [Package] -> Maybe Package
506 = case [p | p <- ps, name p == nm] of
509 -----------------------------------------------------------------------------
512 -- The central concept of a "way" is that all objects in a given
513 -- program must be compiled in the same "way". Certain options change
514 -- parameters of the virtual machine, eg. profiling adds an extra word
515 -- to the object header, so profiling objects cannot be linked with
516 -- non-profiling objects.
518 -- After parsing the command-line options, we determine which "way" we
519 -- are building - this might be a combination way, eg. profiling+ticky-ticky.
521 -- We then find the "build-tag" associated with this way, and this
522 -- becomes the suffix used to find .hi files and libraries used in
525 GLOBAL_VAR(v_Build_tag, "", String)
555 GLOBAL_VAR(v_Ways, [] ,[WayName])
557 -- ToDo: allow WayDll with any other allowed combination
559 allowed_combinations =
560 [ [WayProf,WayUnreg],
561 [WayProf,WaySMP] -- works???
564 findBuildTag :: IO [String] -- new options
566 way_names <- readIORef v_Ways
567 case sort way_names of
568 [] -> do writeIORef v_Build_tag ""
571 [w] -> do let details = lkupWay w
572 writeIORef v_Build_tag (wayTag details)
573 return (wayOpts details)
575 ws -> if ws `notElem` allowed_combinations
576 then throwDyn (OtherError $
577 "combination not supported: " ++
578 foldr1 (\a b -> a ++ '/':b)
579 (map (wayName . lkupWay) ws))
580 else let stuff = map lkupWay ws
581 tag = concat (map wayTag stuff)
582 flags = map wayOpts stuff
584 writeIORef v_Build_tag tag
585 return (concat flags)
588 case lookup w way_details of
589 Nothing -> error "findBuildTag"
590 Just details -> details
598 way_details :: [ (WayName, Way) ]
600 [ (WayProf, Way "p" "Profiling"
606 (WayTicky, Way "t" "Ticky-ticky Profiling"
609 , "-optc-DTICKY_TICKY"
612 (WayUnreg, Way "u" "Unregisterised"
614 , "-optc-DUSE_MINIINTERPRETER"
615 , "-fno-asm-mangling"
619 (WayDll, Way "dll" "DLLized"
622 (WayPar, Way "mp" "Parallel"
624 , "-D__PARALLEL_HASKELL__"
626 , "-package concurrent"
629 (WayGran, Way "mg" "Gransim"
633 , "-package concurrent"
636 (WaySMP, Way "s" "SMP"
643 (WayUser_a, Way "a" "User way 'a'" ["$WAY_a_REAL_OPTS"]),
644 (WayUser_b, Way "b" "User way 'b'" ["$WAY_b_REAL_OPTS"]),
645 (WayUser_c, Way "c" "User way 'c'" ["$WAY_c_REAL_OPTS"]),
646 (WayUser_d, Way "d" "User way 'd'" ["$WAY_d_REAL_OPTS"]),
647 (WayUser_e, Way "e" "User way 'e'" ["$WAY_e_REAL_OPTS"]),
648 (WayUser_f, Way "f" "User way 'f'" ["$WAY_f_REAL_OPTS"]),
649 (WayUser_g, Way "g" "User way 'g'" ["$WAY_g_REAL_OPTS"]),
650 (WayUser_h, Way "h" "User way 'h'" ["$WAY_h_REAL_OPTS"]),
651 (WayUser_i, Way "i" "User way 'i'" ["$WAY_i_REAL_OPTS"]),
652 (WayUser_j, Way "j" "User way 'j'" ["$WAY_j_REAL_OPTS"]),
653 (WayUser_k, Way "k" "User way 'k'" ["$WAY_k_REAL_OPTS"]),
654 (WayUser_l, Way "l" "User way 'l'" ["$WAY_l_REAL_OPTS"]),
655 (WayUser_m, Way "m" "User way 'm'" ["$WAY_m_REAL_OPTS"]),
656 (WayUser_n, Way "n" "User way 'n'" ["$WAY_n_REAL_OPTS"]),
657 (WayUser_o, Way "o" "User way 'o'" ["$WAY_o_REAL_OPTS"]),
658 (WayUser_A, Way "A" "User way 'A'" ["$WAY_A_REAL_OPTS"]),
659 (WayUser_B, Way "B" "User way 'B'" ["$WAY_B_REAL_OPTS"])
662 -----------------------------------------------------------------------------
663 -- Programs for particular phases
665 GLOBAL_VAR(v_Pgm_L, error "pgm_L", String)
666 GLOBAL_VAR(v_Pgm_P, cRAWCPP, String)
667 GLOBAL_VAR(v_Pgm_c, cGCC, String)
668 GLOBAL_VAR(v_Pgm_m, error "pgm_m", String)
669 GLOBAL_VAR(v_Pgm_s, error "pgm_s", String)
670 GLOBAL_VAR(v_Pgm_a, cGCC, String)
671 GLOBAL_VAR(v_Pgm_l, cGCC, String)
673 GLOBAL_VAR(v_Opt_dep, [], [String])
674 GLOBAL_VAR(v_Anti_opt_C, [], [String])
675 GLOBAL_VAR(v_Opt_C, [], [String])
676 GLOBAL_VAR(v_Opt_l, [], [String])
677 GLOBAL_VAR(v_Opt_dll, [], [String])
679 getStaticOpts :: IORef [String] -> IO [String]
680 getStaticOpts ref = readIORef ref >>= return . reverse
682 -----------------------------------------------------------------------------
683 -- Via-C compilation stuff
685 -- flags returned are: ( all C compilations
686 -- , registerised HC compilations
690 | prefixMatch "alpha" cTARGETPLATFORM
691 = return ( ["-static"], [] )
693 | prefixMatch "hppa" cTARGETPLATFORM
694 -- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!
695 -- (very nice, but too bad the HP /usr/include files don't agree.)
696 = return ( ["-static", "-D_HPUX_SOURCE"], [] )
698 | prefixMatch "m68k" cTARGETPLATFORM
699 -- -fno-defer-pop : for the .hc files, we want all the pushing/
700 -- popping of args to routines to be explicit; if we let things
701 -- be deferred 'til after an STGJUMP, imminent death is certain!
703 -- -fomit-frame-pointer : *don't*
704 -- It's better to have a6 completely tied up being a frame pointer
705 -- rather than let GCC pick random things to do with it.
706 -- (If we want to steal a6, then we would try to do things
707 -- as on iX86, where we *do* steal the frame pointer [%ebp].)
708 = return ( [], ["-fno-defer-pop", "-fno-omit-frame-pointer"] )
710 | prefixMatch "i386" cTARGETPLATFORM
711 -- -fno-defer-pop : basically the same game as for m68k
713 -- -fomit-frame-pointer : *must* in .hc files; because we're stealing
714 -- the fp (%ebp) for our register maps.
715 = do n_regs <- readState stolen_x86_regs
716 sta <- readIORef v_Static
717 return ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else "" ],
718 [ "-fno-defer-pop", "-fomit-frame-pointer",
719 "-DSTOLEN_X86_REGS="++show n_regs ]
722 | prefixMatch "mips" cTARGETPLATFORM
723 = return ( ["static"], [] )
725 | prefixMatch "powerpc" cTARGETPLATFORM || prefixMatch "rs6000" cTARGETPLATFORM
726 = return ( ["static"], ["-finhibit-size-directive"] )
732 -----------------------------------------------------------------------------
733 -- Running an external program
735 run_something phase_name cmd
737 verb <- readIORef v_Verbose
745 n <- readIORef v_Dry_run
749 #ifndef mingw32_TARGET_OS
750 exit_code <- system cmd `catchAllIO`
751 (\_ -> throwDyn (PhaseFailed phase_name (ExitFailure 1)))
753 tmp <- newTempName "sh"
754 h <- openFile tmp WriteMode
757 exit_code <- system ("sh - " ++ tmp) `catchAllIO`
758 (\e -> throwDyn (PhaseFailed phase_name (ExitFailure 1)))
762 if exit_code /= ExitSuccess
763 then throwDyn (PhaseFailed phase_name exit_code)
764 else do when verb (putStr "\n")