1 -----------------------------------------------------------------------------
2 -- $Id: DriverState.hs,v 1.89 2002/12/19 18:43:53 wolfgang Exp $
4 -- Settings for the driver
6 -- (c) The University of Glasgow 2002
8 -----------------------------------------------------------------------------
10 module DriverState where
12 #include "../includes/config.h"
13 #include "HsVersions.h"
15 import ParsePkgConf ( loadPackageConfig )
16 import SysTools ( getTopDir )
21 import UniqFM ( eltsUFM )
26 import DATA_IOREF ( IORef, readIORef, writeIORef )
32 import Maybe ( fromJust, isJust )
33 import Directory ( doesDirectoryExist )
35 -----------------------------------------------------------------------------
36 -- non-configured things
38 cHaskell1Version = "5" -- i.e., Haskell 98
40 -----------------------------------------------------------------------------
41 -- GHC modes of operation
44 = DoMkDependHS -- ghc -M
45 | DoMkDLL -- ghc --mk-dll
46 | StopBefore Phase -- ghc -E | -C | -S | -c
47 | DoMake -- ghc --make
48 | DoInteractive -- ghc --interactive
49 | DoLink -- [ the default ]
52 GLOBAL_VAR(v_GhcMode, DoLink, GhcMode)
53 GLOBAL_VAR(v_GhcModeFlag, "", String)
55 setMode :: GhcMode -> String -> IO ()
57 old_mode <- readIORef v_GhcMode
58 old_flag <- readIORef v_GhcModeFlag
59 when (notNull old_flag && flag /= old_flag) $
61 ("cannot use `" ++ old_flag ++ "' with `" ++ flag ++ "'"))
62 writeIORef v_GhcMode m
63 writeIORef v_GhcModeFlag flag
65 isCompManagerMode DoMake = True
66 isCompManagerMode DoInteractive = True
67 isCompManagerMode _ = False
69 -----------------------------------------------------------------------------
70 -- Global compilation flags
73 v_Hs_source_cpp_opts = global
74 [ "-D__HASKELL1__="++cHaskell1Version
75 , "-D__GLASGOW_HASKELL__="++cProjectVersionInt
77 , "-D__CONCURRENT_HASKELL__"
79 {-# NOINLINE v_Hs_source_cpp_opts #-}
82 -- Keep output from intermediate phases
83 GLOBAL_VAR(v_Keep_hi_diffs, False, Bool)
84 GLOBAL_VAR(v_Keep_hc_files, False, Bool)
85 GLOBAL_VAR(v_Keep_s_files, False, Bool)
86 GLOBAL_VAR(v_Keep_raw_s_files, False, Bool)
87 GLOBAL_VAR(v_Keep_tmp_files, False, Bool)
89 GLOBAL_VAR(v_Keep_il_files, False, Bool)
90 GLOBAL_VAR(v_Keep_ilx_files, False, Bool)
94 GLOBAL_VAR(v_Scale_sizes_by, 1.0, Double)
95 GLOBAL_VAR(v_Static, True, Bool)
96 GLOBAL_VAR(v_NoLink, False, Bool)
97 GLOBAL_VAR(v_NoHsMain, False, Bool)
98 GLOBAL_VAR(v_Recomp, True, Bool)
99 GLOBAL_VAR(v_Collect_ghc_timing, False, Bool)
100 GLOBAL_VAR(v_Do_asm_mangling, True, Bool)
101 GLOBAL_VAR(v_Excess_precision, False, Bool)
102 GLOBAL_VAR(v_Read_DotGHCi, True, Bool)
104 -- Preprocessor flags
105 GLOBAL_VAR(v_Hs_source_pp_opts, [], [String])
107 -----------------------------------------------------------------------------
108 -- Splitting object files (for libraries)
110 GLOBAL_VAR(v_Split_object_files, False, Bool)
111 GLOBAL_VAR(v_Split_info, ("",0), (String,Int))
112 -- The split prefix and number of files
116 can_split = prefixMatch "i386" cTARGETPLATFORM
117 || prefixMatch "alpha" cTARGETPLATFORM
118 || prefixMatch "hppa" cTARGETPLATFORM
119 || prefixMatch "m68k" cTARGETPLATFORM
120 || prefixMatch "mips" cTARGETPLATFORM
121 || prefixMatch "powerpc" cTARGETPLATFORM
122 || prefixMatch "rs6000" cTARGETPLATFORM
123 || prefixMatch "sparc" cTARGETPLATFORM
125 -----------------------------------------------------------------------------
126 -- Compiler output options
128 GLOBAL_VAR(v_Output_dir, Nothing, Maybe String)
129 GLOBAL_VAR(v_Output_file, Nothing, Maybe String)
130 GLOBAL_VAR(v_Output_hi, Nothing, Maybe String)
132 -- called to verify that the output files & directories
133 -- point somewhere valid.
135 -- The assumption is that the directory portion of these output
136 -- options will have to exist by the time 'verifyOutputFiles'
139 verifyOutputFiles :: IO ()
140 verifyOutputFiles = do
141 odir <- readIORef v_Output_dir
142 when (isJust odir) $ do
143 let dir = fromJust odir
144 flg <- doesDirectoryExist dir
145 when (not flg) (nonExistentDir "-odir" dir)
146 ofile <- readIORef v_Output_file
147 when (isJust ofile) $ do
148 let fn = fromJust ofile
149 flg <- doesDirNameExist fn
150 when (not flg) (nonExistentDir "-o" fn)
151 ohi <- readIORef v_Output_hi
152 when (isJust ohi) $ do
153 let hi = fromJust ohi
154 flg <- doesDirNameExist hi
155 when (not flg) (nonExistentDir "-ohi" hi)
157 nonExistentDir flg dir =
158 throwDyn (CmdLineError ("error: directory portion of " ++
159 show dir ++ " does not exist (used with " ++
160 show flg ++ " option.)"))
162 GLOBAL_VAR(v_Object_suf, phaseInputExt Ln, String)
163 GLOBAL_VAR(v_HC_suf, Nothing, Maybe String)
164 GLOBAL_VAR(v_Hi_dir, Nothing, Maybe String)
165 GLOBAL_VAR(v_Hi_suf, "hi", String)
167 GLOBAL_VAR(v_Ld_inputs, [], [String])
169 odir_ify :: String -> IO String
171 odir_opt <- readIORef v_Output_dir
174 Just d -> return (replaceFilenameDirectory f d)
176 osuf_ify :: String -> IO String
178 osuf <- readIORef v_Object_suf
179 return (replaceFilenameSuffix f osuf)
181 -----------------------------------------------------------------------------
182 -- Compiler optimisation options
184 GLOBAL_VAR(v_OptLevel, 0, Int)
186 setOptLevel :: Int -> IO ()
188 when (n >= 1) $ setLang HscC -- turn on -fvia-C with -O
189 writeIORef v_OptLevel n
191 GLOBAL_VAR(v_minus_o2_for_C, False, Bool)
192 GLOBAL_VAR(v_MaxSimplifierIterations, 4, Int)
193 GLOBAL_VAR(v_StgStats, False, Bool)
194 GLOBAL_VAR(v_UsageSPInf, False, Bool) -- Off by default
195 GLOBAL_VAR(v_Strictness, True, Bool)
196 GLOBAL_VAR(v_CSE, True, Bool)
197 GLOBAL_VAR(v_RuleCheck, Nothing, Maybe String)
199 -- these are the static flags you get without -O.
202 "-fignore-interface-pragmas",
203 "-fomit-interface-pragmas",
204 "-fdo-lambda-eta-expansion", -- This one is important for a tiresome reason:
205 -- we want to make sure that the bindings for data
206 -- constructors are eta-expanded. This is probably
207 -- a good thing anyway, but it seems fragile.
211 -- these are the static flags you get when -O is on.
216 "-fdo-eta-reduction",
217 "-fdo-lambda-eta-expansion",
223 hsc_minusO2_flags = hsc_minusO_flags -- for now
225 getStaticOptimisationFlags 0 = hsc_minusNoO_flags
226 getStaticOptimisationFlags 1 = hsc_minusO_flags
227 getStaticOptimisationFlags n = hsc_minusO2_flags
229 buildCoreToDo :: IO [CoreToDo]
231 opt_level <- readIORef v_OptLevel
232 max_iter <- readIORef v_MaxSimplifierIterations
233 usageSP <- readIORef v_UsageSPInf
234 strictness <- readIORef v_Strictness
235 cse <- readIORef v_CSE
236 rule_check <- readIORef v_RuleCheck
238 if opt_level == 0 then return
240 CoreDoSimplify (SimplPhase 0) [
241 MaxSimplifierIterations max_iter
245 else {- opt_level >= 1 -} return [
247 -- initial simplify: mk specialiser happy: minimum effort please
248 CoreDoSimplify SimplGently [
250 -- Don't inline anything till full laziness has bitten
251 -- In particular, inlining wrappers inhibits floating
252 -- e.g. ...(case f x of ...)...
253 -- ==> ...(case (case x of I# x# -> fw x#) of ...)...
254 -- ==> ...(case x of I# x# -> case fw x# of ...)...
255 -- and now the redex (f x) isn't floatable any more
256 -- Similarly, don't apply any rules until after full
257 -- laziness. Notably, list fusion can prevent floating.
260 -- Don't do case-of-case transformations.
261 -- This makes full laziness work better
262 MaxSimplifierIterations max_iter
265 -- Specialisation is best done before full laziness
266 -- so that overloaded functions have all their dictionary lambdas manifest
269 CoreDoFloatOutwards (FloatOutSw False False),
272 CoreDoSimplify (SimplPhase 2) [
273 -- Want to run with inline phase 2 after the specialiser to give
274 -- maximum chance for fusion to work before we inline build/augment
275 -- in phase 1. This made a difference in 'ansi' where an
276 -- overloaded function wasn't inlined till too late.
277 MaxSimplifierIterations max_iter
279 case rule_check of { Just pat -> CoreDoRuleCheck 2 pat; Nothing -> CoreDoNothing },
281 -- infer usage information here in case we need it later.
282 -- (add more of these where you need them --KSW 1999-04)
283 if usageSP then CoreDoUSPInf else CoreDoNothing,
285 CoreDoSimplify (SimplPhase 1) [
286 -- Need inline-phase2 here so that build/augment get
287 -- inlined. I found that spectral/hartel/genfft lost some useful
288 -- strictness in the function sumcode' if augment is not inlined
289 -- before strictness analysis runs
290 MaxSimplifierIterations max_iter
292 case rule_check of { Just pat -> CoreDoRuleCheck 1 pat; Nothing -> CoreDoNothing },
294 CoreDoSimplify (SimplPhase 0) [
295 -- Phase 0: allow all Ids to be inlined now
296 -- This gets foldr inlined before strictness analysis
298 MaxSimplifierIterations 3
299 -- At least 3 iterations because otherwise we land up with
300 -- huge dead expressions because of an infelicity in the
302 -- let k = BIG in foldr k z xs
303 -- ==> let k = BIG in letrec go = \xs -> ...(k x).... in go xs
304 -- ==> let k = BIG in letrec go = \xs -> ...(BIG x).... in go xs
308 case rule_check of { Just pat -> CoreDoRuleCheck 0 pat; Nothing -> CoreDoNothing },
310 #ifdef OLD_STRICTNESS
313 if strictness then CoreDoStrictness else CoreDoNothing,
317 CoreDoSimplify (SimplPhase 0) [
318 MaxSimplifierIterations max_iter
321 CoreDoFloatOutwards (FloatOutSw False -- Not lambdas
322 True), -- Float constants
323 -- nofib/spectral/hartel/wang doubles in speed if you
324 -- do full laziness late in the day. It only happens
325 -- after fusion and other stuff, so the early pass doesn't
326 -- catch it. For the record, the redex is
327 -- f_el22 (f_el21 r_midblock)
330 -- We want CSE to follow the final full-laziness pass, because it may
331 -- succeed in commoning up things floated out by full laziness.
332 -- CSE used to rely on the no-shadowing invariant, but it doesn't any more
334 if cse then CoreCSE else CoreDoNothing,
338 -- Case-liberation for -O2. This should be after
339 -- strictness analysis and the simplification which follows it.
341 case rule_check of { Just pat -> CoreDoRuleCheck 0 pat; Nothing -> CoreDoNothing },
343 if opt_level >= 2 then
347 if opt_level >= 2 then
352 -- Final clean-up simplification:
353 CoreDoSimplify (SimplPhase 0) [
354 MaxSimplifierIterations max_iter
358 buildStgToDo :: IO [ StgToDo ]
360 stg_stats <- readIORef v_StgStats
361 let flags1 | stg_stats = [ D_stg_stats ]
365 ways_ <- readIORef v_Ways
366 let flags2 | WayProf `elem` ways_ = StgDoMassageForProfiling : flags1
371 -----------------------------------------------------------------------------
374 split_marker = ':' -- not configurable (ToDo)
376 v_Import_paths, v_Include_paths, v_Library_paths :: IORef [String]
377 GLOBAL_VAR(v_Import_paths, ["."], [String])
378 GLOBAL_VAR(v_Include_paths, ["."], [String])
379 GLOBAL_VAR(v_Library_paths, [], [String])
381 #ifdef darwin_TARGET_OS
382 GLOBAL_VAR(v_Framework_paths, [], [String])
383 GLOBAL_VAR(v_Cmdline_frameworks, [], [String])
386 addToDirList :: IORef [String] -> String -> IO ()
387 addToDirList ref path
388 = do paths <- readIORef ref
389 shiny_new_ones <- splitUp path
390 writeIORef ref (paths ++ filter notNull shiny_new_ones)
391 -- empty paths are ignored: there might be a trailing
392 -- ':' in the initial list, for example. Empty paths can
393 -- cause confusion when they are translated into -I options
394 -- for passing to gcc.
396 splitUp ::String -> IO [String]
397 #ifdef mingw32_TARGET_OS
398 -- 'hybrid' support for DOS-style paths in directory lists.
400 -- That is, if "foo:bar:baz" is used, this interpreted as
401 -- consisting of three entries, 'foo', 'bar', 'baz'.
402 -- However, with "c:/foo:c:\\foo;x:/bar", this is interpreted
403 -- as four elts, "c:/foo", "c:\\foo", "x", and "/bar" --
404 -- *provided* c:/foo exists and x:/bar doesn't.
406 -- Notice that no attempt is made to fully replace the 'standard'
407 -- split marker ':' with the Windows / DOS one, ';'. The reason being
408 -- that this will cause too much breakage for users & ':' will
409 -- work fine even with DOS paths, if you're not insisting on being silly.
411 splitUp [] = return []
412 splitUp (x:':':div:xs)
413 | div `elem` dir_markers = do
414 let (p,rs) = findNextPath xs
417 Consult the file system to check the interpretation
418 of (x:':':div:p) -- this is arguably excessive, we
419 could skip this test & just say that it is a valid
422 flg <- doesDirectoryExist (x:':':div:p)
424 return ((x:':':div:p):ps)
426 return ([x]:(div:p):ps)
428 let (p,rs) = findNextPath xs
435 -- will be called either when we've consumed nought or the "<Drive>:/" part of
436 -- a DOS path, so splitting is just a Q of finding the next split marker.
438 case break (`elem` split_markers) xs of
442 split_markers :: [Char]
443 split_markers = [':', ';']
445 dir_markers :: [Char]
446 dir_markers = ['/', '\\']
449 splitUp xs = return (split split_marker xs)
452 -- ----------------------------------------------------------------------------
453 -- Loading the package config file
455 readPackageConf :: String -> IO ()
456 readPackageConf conf_file = do
457 proto_pkg_configs <- loadPackageConfig conf_file
459 let pkg_configs = mungePackagePaths top_dir proto_pkg_configs
460 extendPackageConfigMap pkg_configs
462 mungePackagePaths :: String -> [PackageConfig] -> [PackageConfig]
463 -- Replace the string "$libdir" at the beginning of a path
464 -- with the current libdir (obtained from the -B option).
465 mungePackagePaths top_dir ps = map munge_pkg ps
467 munge_pkg p = p{ import_dirs = munge_paths (import_dirs p),
468 include_dirs = munge_paths (include_dirs p),
469 library_dirs = munge_paths (library_dirs p),
470 framework_dirs = munge_paths (framework_dirs p) }
472 munge_paths = map munge_path
475 | Just p' <- my_prefix_match "$libdir" p = top_dir ++ p'
479 -- -----------------------------------------------------------------------------
480 -- The list of packages requested on the command line
482 -- The package list reflects what packages were given as command-line options,
483 -- plus their dependent packages. It is maintained in dependency order;
484 -- earlier packages may depend on later ones, but not vice versa
485 GLOBAL_VAR(v_ExplicitPackages, initPackageList, [PackageName])
487 initPackageList = [rtsPackage]
489 -- add a package requested from the command-line
490 addPackage :: String -> IO ()
491 addPackage package = do
492 pkg_details <- getPackageConfigMap
493 ps <- readIORef v_ExplicitPackages
494 ps' <- add_package pkg_details ps (mkPackageName package)
495 -- Throws an exception if it fails
496 writeIORef v_ExplicitPackages ps'
499 add_package :: PackageConfigMap -> [PackageName]
500 -> PackageName -> IO [PackageName]
501 add_package pkg_details ps p
502 | p `elem` ps -- Check if we've already added this package
504 | Just details <- lookupPkg pkg_details p
505 -- Add the package's dependents also
506 = do ps' <- foldM (add_package pkg_details) ps (packageDependents details)
509 = throwDyn (CmdLineError ("unknown package name: " ++ packageNameString p))
512 -- -----------------------------------------------------------------------------
513 -- Extracting information from the packages in scope
515 -- Many of these functions take a list of packages: in those cases,
516 -- the list is expected to contain the "dependent packages",
517 -- i.e. those packages that were found to be depended on by the
518 -- current module/program. These can be auto or non-auto packages, it
519 -- doesn't really matter. The list is always combined with the list
520 -- of explicit (command-line) packages to determine which packages to
523 getPackageImportPath :: IO [String]
524 getPackageImportPath = do
525 ps <- getExplicitAndAutoPackageConfigs
526 -- import dirs are always derived from the 'auto'
527 -- packages as well as the explicit ones
528 return (nub (filter notNull (concatMap import_dirs ps)))
530 getPackageIncludePath :: [PackageName] -> IO [String]
531 getPackageIncludePath pkgs = do
532 ps <- getExplicitPackagesAnd pkgs
533 return (nub (filter notNull (concatMap include_dirs ps)))
535 -- includes are in reverse dependency order (i.e. rts first)
536 getPackageCIncludes :: [PackageConfig] -> IO [String]
537 getPackageCIncludes pkg_configs = do
538 return (reverse (nub (filter notNull (concatMap c_includes pkg_configs))))
540 getPackageLibraryPath :: [PackageName] -> IO [String]
541 getPackageLibraryPath pkgs = do
542 ps <- getExplicitPackagesAnd pkgs
543 return (nub (filter notNull (concatMap library_dirs ps)))
545 getPackageLinkOpts :: [PackageName] -> IO [String]
546 getPackageLinkOpts pkgs = do
547 ps <- getExplicitPackagesAnd pkgs
548 tag <- readIORef v_Build_tag
549 static <- readIORef v_Static
551 imp = if static then "" else "_imp"
552 suffix = if null tag then "" else '_':tag
553 libs p = map (++suffix) (hACK (hs_libraries p)) ++ extra_libraries p
554 imp_libs p = map (++imp) (libs p)
555 all_opts p = map ("-l" ++) (imp_libs p) ++ extra_ld_opts p
557 return (concat (map all_opts ps))
559 -- This is a totally horrible (temporary) hack, for Win32. Problem is
560 -- that package.conf for Win32 says that the main prelude lib is
561 -- split into HSbase1, HSbase2 and HSbase3, which is needed due to a bug
562 -- in the GNU linker (PEi386 backend). However, we still only
563 -- have HSbase.a for static linking, not HSbase{1,2,3}.a
564 -- getPackageLibraries is called to find the .a's to add to the static
565 -- link line. On Win32, this hACK detects HSbase{1,2,3} and
566 -- replaces them with HSbase, so static linking still works.
567 -- Libraries needed for dynamic (GHCi) linking are discovered via
568 -- different route (in InteractiveUI.linkPackage).
569 -- See driver/PackageSrc.hs for the HSbase1/HSbase2 split definition.
570 -- THIS IS A STRICTLY TEMPORARY HACK (famous last words ...)
571 -- JRS 04 Sept 01: Same appalling hack for HSwin32[1,2]
572 -- KAA 29 Mar 02: Same appalling hack for HSobjectio[1,2,3,4]
574 # if !defined(mingw32_TARGET_OS) && !defined(cygwin32_TARGET_OS)
577 = if "HSbase1" `elem` libs && "HSbase2" `elem` libs && "HSbase3" `elem` libs
578 then "HSbase" : filter (not.(isPrefixOf "HSbase")) libs
580 if "HSwin321" `elem` libs && "HSwin322" `elem` libs
581 then "HSwin32" : filter (not.(isPrefixOf "HSwin32")) libs
583 if "HSobjectio1" `elem` libs && "HSobjectio2" `elem` libs && "HSobjectio3" `elem` libs && "HSobjectio4" `elem` libs
584 then "HSobjectio" : filter (not.(isPrefixOf "HSobjectio")) libs
589 getPackageExtraGhcOpts :: IO [String]
590 getPackageExtraGhcOpts = do
591 ps <- getExplicitAndAutoPackageConfigs
592 return (concatMap extra_ghc_opts ps)
594 getPackageExtraCcOpts :: [PackageName] -> IO [String]
595 getPackageExtraCcOpts pkgs = do
596 ps <- getExplicitPackagesAnd pkgs
597 return (concatMap extra_cc_opts ps)
599 #ifdef darwin_TARGET_OS
600 getPackageFrameworkPath :: [PackageName] -> IO [String]
601 getPackageFrameworkPath pkgs = do
602 ps <- getExplicitPackagesAnd pkgs
603 return (nub (filter notNull (concatMap framework_dirs ps)))
605 getPackageFrameworks :: [PackageName] -> IO [String]
606 getPackageFrameworks pkgs = do
607 ps <- getExplicitPackagesAnd pkgs
608 return (concatMap extra_frameworks ps)
611 -- -----------------------------------------------------------------------------
614 getExplicitPackagesAnd :: [PackageName] -> IO [PackageConfig]
615 getExplicitPackagesAnd pkg_names = do
616 pkg_map <- getPackageConfigMap
617 expl <- readIORef v_ExplicitPackages
618 all_pkgs <- foldM (add_package pkg_map) expl pkg_names
619 getPackageDetails all_pkgs
621 -- return all packages, including both the auto packages and the explicit ones
622 getExplicitAndAutoPackageConfigs :: IO [PackageConfig]
623 getExplicitAndAutoPackageConfigs = do
624 pkg_map <- getPackageConfigMap
625 let auto_packages = [ mkPackageName (name p) | p <- eltsUFM pkg_map, auto p ]
626 getExplicitPackagesAnd auto_packages
628 -----------------------------------------------------------------------------
631 -- The central concept of a "way" is that all objects in a given
632 -- program must be compiled in the same "way". Certain options change
633 -- parameters of the virtual machine, eg. profiling adds an extra word
634 -- to the object header, so profiling objects cannot be linked with
635 -- non-profiling objects.
637 -- After parsing the command-line options, we determine which "way" we
638 -- are building - this might be a combination way, eg. profiling+ticky-ticky.
640 -- We then find the "build-tag" associated with this way, and this
641 -- becomes the suffix used to find .hi files and libraries used in
644 GLOBAL_VAR(v_Build_tag, "", String)
674 GLOBAL_VAR(v_Ways, [] ,[WayName])
676 allowed_combination way = way `elem` combs
677 where -- the sub-lists must be ordered according to WayName,
678 -- because findBuildTag sorts them
679 combs = [ [WayProf, WayUnreg],
683 findBuildTag :: IO [String] -- new options
685 way_names <- readIORef v_Ways
686 case sort way_names of
687 [] -> do -- writeIORef v_Build_tag ""
690 [w] -> do let details = lkupWay w
691 writeIORef v_Build_tag (wayTag details)
692 return (wayOpts details)
694 ws -> if not (allowed_combination ws)
695 then throwDyn (CmdLineError $
696 "combination not supported: " ++
697 foldr1 (\a b -> a ++ '/':b)
698 (map (wayName . lkupWay) ws))
699 else let stuff = map lkupWay ws
700 tag = concat (map wayTag stuff)
701 flags = map wayOpts stuff
703 writeIORef v_Build_tag tag
704 return (concat flags)
707 case lookup w way_details of
708 Nothing -> error "findBuildTag"
709 Just details -> details
717 way_details :: [ (WayName, Way) ]
719 [ (WayProf, Way "p" "Profiling"
725 (WayTicky, Way "t" "Ticky-ticky Profiling"
728 , "-optc-DTICKY_TICKY"
731 (WayUnreg, Way "u" "Unregisterised"
734 -- optl's below to tell linker where to find the PVM library -- HWL
735 (WayPar, Way "mp" "Parallel"
737 , "-D__PARALLEL_HASKELL__"
739 , "-package concurrent"
741 , "-optl-L${PVM_ROOT}/lib/${PVM_ARCH}"
746 -- at the moment we only change the RTS and could share compiler and libs!
747 (WayPar, Way "mt" "Parallel ticky profiling"
749 , "-D__PARALLEL_HASKELL__"
752 , "-package concurrent"
754 , "-optl-L${PVM_ROOT}/lib/${PVM_ARCH}"
759 (WayPar, Way "md" "Distributed"
761 , "-D__PARALLEL_HASKELL__"
762 , "-D__DISTRIBUTED_HASKELL__"
765 , "-package concurrent"
767 , "-optl-L${PVM_ROOT}/lib/${PVM_ARCH}"
772 (WayGran, Way "mg" "GranSim"
776 , "-package concurrent"
779 (WaySMP, Way "s" "SMP"
786 (WayNDP, Way "ndp" "Nested data parallelism"
790 (WayUser_a, Way "a" "User way 'a'" ["$WAY_a_REAL_OPTS"]),
791 (WayUser_b, Way "b" "User way 'b'" ["$WAY_b_REAL_OPTS"]),
792 (WayUser_c, Way "c" "User way 'c'" ["$WAY_c_REAL_OPTS"]),
793 (WayUser_d, Way "d" "User way 'd'" ["$WAY_d_REAL_OPTS"]),
794 (WayUser_e, Way "e" "User way 'e'" ["$WAY_e_REAL_OPTS"]),
795 (WayUser_f, Way "f" "User way 'f'" ["$WAY_f_REAL_OPTS"]),
796 (WayUser_g, Way "g" "User way 'g'" ["$WAY_g_REAL_OPTS"]),
797 (WayUser_h, Way "h" "User way 'h'" ["$WAY_h_REAL_OPTS"]),
798 (WayUser_i, Way "i" "User way 'i'" ["$WAY_i_REAL_OPTS"]),
799 (WayUser_j, Way "j" "User way 'j'" ["$WAY_j_REAL_OPTS"]),
800 (WayUser_k, Way "k" "User way 'k'" ["$WAY_k_REAL_OPTS"]),
801 (WayUser_l, Way "l" "User way 'l'" ["$WAY_l_REAL_OPTS"]),
802 (WayUser_m, Way "m" "User way 'm'" ["$WAY_m_REAL_OPTS"]),
803 (WayUser_n, Way "n" "User way 'n'" ["$WAY_n_REAL_OPTS"]),
804 (WayUser_o, Way "o" "User way 'o'" ["$WAY_o_REAL_OPTS"]),
805 (WayUser_A, Way "A" "User way 'A'" ["$WAY_A_REAL_OPTS"]),
806 (WayUser_B, Way "B" "User way 'B'" ["$WAY_B_REAL_OPTS"])
811 , "-optc-DUSE_MINIINTERPRETER"
812 , "-fno-asm-mangling"
816 -----------------------------------------------------------------------------
817 -- Options for particular phases
819 GLOBAL_VAR(v_Opt_dep, [], [String])
820 GLOBAL_VAR(v_Anti_opt_C, [], [String])
821 GLOBAL_VAR(v_Opt_C, [], [String])
822 GLOBAL_VAR(v_Opt_l, [], [String])
823 GLOBAL_VAR(v_Opt_dll, [], [String])
825 getStaticOpts :: IORef [String] -> IO [String]
826 getStaticOpts ref = readIORef ref >>= return . reverse