Commit 9be618cd authored by Ian Lynagh's avatar Ian Lynagh

Remove dead code, now that -fvia-c is a no-op

parent af5e0344
......@@ -1069,18 +1069,9 @@ AC_SUBST([GhcPkgCmd])
# Determine which extra flags we need to pass gcc when we invoke it
# to compile .hc code.
#
# Some OSs (Mandrake Linux, in particular) configure GCC with
# -momit-leaf-frame-pointer on by default. If this is the case, we
# need to turn it off for mangling to work. The test is currently a
# bit crude, using only the version number of gcc.
#
# -fwrapv is needed for gcc to emit well-behaved code in the presence of
# integer wrap around. (Trac #952)
#
# -fno-unit-at-a-time or -fno-toplevel-reoder is necessary to avoid gcc
# reordering things in the module and confusing the manger and/or splitter.
# (eg. Trac #1427)
#
AC_DEFUN([FP_GCC_EXTRA_FLAGS],
[AC_REQUIRE([FP_HAVE_GCC])
AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_extra_opts],
......@@ -1088,24 +1079,6 @@ AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-ge], [3.4],
[fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fwrapv"],
[])
case $TargetPlatform in
i386-*|x86_64-*)
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-ge], [3.2],
[fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -mno-omit-leaf-frame-pointer"],
[])
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-ge], [3.4],
[FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-ge], [4.2],
[fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fno-toplevel-reorder"],
[fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fno-unit-at-a-time"]
)],
[])
;;
sparc-*-solaris2)
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-ge], [4.2],
[fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fno-toplevel-reorder"],
[])
;;
esac
])
AC_SUBST([GccExtraViaCOpts],$fp_cv_gcc_extra_opts)
])
......
......@@ -152,10 +152,6 @@ compiler/stage%/build/Config.hs : mk/config.mk mk/project.mk | $$(dir $$@)/.
@echo 'cGHC_UNLIT_PGM = "$(GHC_UNLIT_PGM)"' >> $@
@echo 'cGHC_UNLIT_DIR :: String' >> $@
@echo 'cGHC_UNLIT_DIR = "$(GHC_UNLIT_DIR)"' >> $@
@echo 'cGHC_MANGLER_PGM :: String' >> $@
@echo 'cGHC_MANGLER_PGM = "$(GHC_MANGLER_PGM)"' >> $@
@echo 'cGHC_MANGLER_DIR :: String' >> $@
@echo 'cGHC_MANGLER_DIR = "$(GHC_MANGLER_DIR)"' >> $@
@echo 'cGHC_SPLIT_PGM :: String' >> $@
@echo 'cGHC_SPLIT_PGM = "$(GHC_SPLIT_PGM)"' >> $@
@echo 'cGHC_SPLIT_DIR :: String' >> $@
......
......@@ -76,7 +76,6 @@ data Phase
| Ccpp
| Cc
| HCc -- Haskellised C (as opposed to vanilla C) compilation
| Mangle -- assembly mangling, now done by a separate script.
| SplitMangle -- after mangler if splitting
| SplitAs
| As
......@@ -111,7 +110,6 @@ eqPhase (Hsc _) (Hsc _) = True
eqPhase Ccpp Ccpp = True
eqPhase Cc Cc = True
eqPhase HCc HCc = True
eqPhase Mangle Mangle = True
eqPhase SplitMangle SplitMangle = True
eqPhase SplitAs SplitAs = True
eqPhase As As = True
......@@ -138,8 +136,6 @@ nextPhase (Unlit sf) = Cpp sf
nextPhase (Cpp sf) = HsPp sf
nextPhase (HsPp sf) = Hsc sf
nextPhase (Hsc _) = HCc
nextPhase HCc = Mangle
nextPhase Mangle = SplitMangle
nextPhase SplitMangle = As
nextPhase As = SplitAs
nextPhase LlvmOpt = LlvmLlc
......@@ -154,6 +150,7 @@ nextPhase Ccpp = As
nextPhase Cc = As
nextPhase CmmCpp = Cmm
nextPhase Cmm = HCc
nextPhase HCc = As
nextPhase StopLn = panic "nextPhase: nothing after StopLn"
-- the first compilation phase for a given file is determined
......@@ -172,7 +169,6 @@ startPhase "cpp" = Ccpp
startPhase "C" = Cc
startPhase "cc" = Ccpp
startPhase "cxx" = Ccpp
startPhase "raw_s" = Mangle
startPhase "split_s" = SplitMangle
startPhase "s" = As
startPhase "S" = As
......@@ -200,7 +196,6 @@ phaseInputExt (Hsc _) = "hspp" -- intermediate only
phaseInputExt HCc = "hc"
phaseInputExt Ccpp = "cpp"
phaseInputExt Cc = "c"
phaseInputExt Mangle = "raw_s"
phaseInputExt SplitMangle = "split_s" -- not really generated
phaseInputExt As = "s"
phaseInputExt LlvmOpt = "ll"
......
......@@ -141,7 +141,7 @@ compile' (nothingCompiler, interactiveCompiler, batchCompiler)
hsc_env = hsc_env0 {hsc_dflags = dflags}
-- Figure out what lang we're generating
let hsc_lang = hscMaybeAdjustTarget dflags StopLn src_flavour (hscTarget dflags)
let hsc_lang = hscTarget dflags
-- ... and what the next phase should be
let next_phase = hscNextPhase dflags src_flavour hsc_lang
-- ... and what file to generate the output into
......@@ -585,7 +585,6 @@ getOutputFilename stop_phase output basename
odir = objectDir dflags
osuf = objectSuf dflags
keep_hc = dopt Opt_KeepHcFiles dflags
keep_raw_s = dopt Opt_KeepRawSFiles dflags
keep_s = dopt Opt_KeepSFiles dflags
keep_bc = dopt Opt_KeepLlvmFiles dflags
......@@ -599,7 +598,6 @@ getOutputFilename stop_phase output basename
keep_this_output =
case next_phase of
StopLn -> True
Mangle | keep_raw_s -> True
As | keep_s -> True
LlvmOpt | keep_bc -> True
HCc | keep_hc -> True
......@@ -809,7 +807,7 @@ runPhase (Hsc src_flavour) stop hsc_env basename suff input_fn get_output_fn _ma
src_timestamp <- getModificationTime (basename <.> suff)
let force_recomp = dopt Opt_ForceRecomp dflags
hsc_lang = hscMaybeAdjustTarget dflags stop src_flavour (hscTarget dflags)
hsc_lang = hscTarget dflags
source_unchanged <-
if force_recomp || not (isStopLn stop)
-- Set source_unchanged to False unconditionally if
......@@ -884,10 +882,10 @@ runPhase CmmCpp _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
doCpp dflags False{-not raw-} True{-include CC opts-} input_fn output_fn
return (Cmm, dflags, maybe_loc, output_fn)
runPhase Cmm stop hsc_env basename _ input_fn get_output_fn maybe_loc
runPhase Cmm _ hsc_env basename _ input_fn get_output_fn maybe_loc
= do
let dflags = hsc_dflags hsc_env
let hsc_lang = hscMaybeAdjustTarget dflags stop HsSrcFile (hscTarget dflags)
let hsc_lang = hscTarget dflags
let next_phase = hscNextPhase dflags HsSrcFile hsc_lang
output_fn <- get_output_fn dflags next_phase maybe_loc
......@@ -929,7 +927,7 @@ runPhase cc_phase _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
let include_paths = foldr (\ x xs -> "-I" : x : xs) []
(cmdline_include_paths ++ pkg_include_dirs)
let (md_c_flags, md_regd_c_flags) = machdepCCOpts dflags
let md_c_flags = machdepCCOpts dflags
gcc_extra_viac_flags <- getExtraViaCOpts dflags
let pic_c_flags = picCCOpts dflags
......@@ -959,10 +957,7 @@ runPhase cc_phase _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
-- Decide next phase
let mangle = dopt Opt_DoAsmMangling dflags
next_phase
| hcc && mangle = Mangle
| otherwise = As
let next_phase = As
output_fn <- get_output_fn dflags next_phase maybe_loc
let
......@@ -1019,18 +1014,8 @@ runPhase cc_phase _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
-- This is a temporary hack.
++ ["-mcpu=v9"]
#endif
++ (if hcc && mangle
then md_regd_c_flags
else [])
++ (if hcc
then if mangle
then gcc_extra_viac_flags
else filter (=="-fwrapv")
gcc_extra_viac_flags
-- still want -fwrapv even for unreg'd
else [])
++ (if hcc
then more_hcc_opts
then gcc_extra_viac_flags ++ more_hcc_opts
else [])
++ [ verb, "-S", "-Wimplicit", cc_opt ]
++ [ "-D__GLASGOW_HASKELL__="++cProjectVersionInt ]
......@@ -1047,33 +1032,6 @@ runPhase cc_phase _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
-- ToDo: postprocess the output from gcc
-----------------------------------------------------------------------------
-- Mangle phase
runPhase Mangle _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
= do let dflags = hsc_dflags hsc_env
let mangler_opts = getOpts dflags opt_m
#if i386_TARGET_ARCH
machdep_opts <- return [ show (stolen_x86_regs dflags) ]
#else
machdep_opts <- return []
#endif
let split = dopt Opt_SplitObjs dflags
next_phase
| split = SplitMangle
| otherwise = As
output_fn <- get_output_fn dflags next_phase maybe_loc
SysTools.runMangle dflags (map SysTools.Option mangler_opts
++ [ SysTools.FileOption "" input_fn
, SysTools.FileOption "" output_fn
]
++ map SysTools.Option machdep_opts)
return (next_phase, dflags, maybe_loc, output_fn)
-----------------------------------------------------------------------------
-- Splitting phase
......@@ -1116,7 +1074,7 @@ runPhase As _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
-- might be a hierarchical module.
createDirectoryHierarchy (takeDirectory output_fn)
let (md_c_flags, _) = machdepCCOpts dflags
let md_c_flags = machdepCCOpts dflags
SysTools.runAs dflags
(map SysTools.Option as_opts
++ [ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ]
......@@ -1166,7 +1124,7 @@ runPhase SplitAs _stop hsc_env _basename _suff _input_fn get_output_fn maybe_loc
split_obj n = split_odir </>
takeFileName base_o ++ "__" ++ show n <.> osuf
let (md_c_flags, _) = machdepCCOpts dflags
let md_c_flags = machdepCCOpts dflags
let assemble_file n
= SysTools.runAs dflags
(map SysTools.Option as_opts ++
......@@ -1312,7 +1270,7 @@ mkExtraCObj dflags xs
oFile <- newTempName dflags "o"
writeFile cFile $ unlines xs
let rtsDetails = getPackageDetails (pkgState dflags) rtsPackageId
(md_c_flags, _) = machdepCCOpts dflags
md_c_flags = machdepCCOpts dflags
SysTools.runCc dflags
([Option "-c",
FileOption "" cFile,
......@@ -1504,7 +1462,7 @@ linkBinary dflags o_files dep_packages = do
rc_objs <- maybeCreateManifest dflags output_fn
let (md_c_flags, _) = machdepCCOpts dflags
let md_c_flags = machdepCCOpts dflags
SysTools.runLink dflags (
[ SysTools.Option verb
, SysTools.Option "-o"
......@@ -1657,7 +1615,7 @@ linkDynLib dflags o_files dep_packages = do
-- probably _stub.o files
extra_ld_inputs <- readIORef v_Ld_inputs
let (md_c_flags, _) = machdepCCOpts dflags
let md_c_flags = machdepCCOpts dflags
let extra_ld_opts = getOpts dflags opt_l
rtsEnabledObj <- mkRtsOptionsLevelObj dflags
......@@ -1804,7 +1762,7 @@ doCpp dflags raw include_cc_opts input_fn output_fn = do
| otherwise = (optc ++ md_c_flags)
where
optc = getOpts dflags opt_c
(md_c_flags, _) = machdepCCOpts dflags
md_c_flags = machdepCCOpts dflags
let cpp_prog args | raw = SysTools.runCpp dflags args
| otherwise = SysTools.runCc dflags (SysTools.Option "-E" : args)
......@@ -1860,7 +1818,7 @@ joinObjectFiles dflags o_files output_fn = do
ld_x_flag | null cLD_X = ""
| otherwise = "-Wl,-x"
(md_c_flags, _) = machdepCCOpts dflags
md_c_flags = machdepCCOpts dflags
if cLdIsGNULd == "YES"
then do
......@@ -1885,19 +1843,3 @@ hscNextPhase dflags _ hsc_lang =
HscInterpreted -> StopLn
_other -> StopLn
hscMaybeAdjustTarget :: DynFlags -> Phase -> HscSource -> HscTarget -> HscTarget
hscMaybeAdjustTarget dflags stop _ current_hsc_lang
= hsc_lang
where
keep_hc = dopt Opt_KeepHcFiles dflags
hsc_lang
-- don't change the lang if we're interpreting
| current_hsc_lang == HscInterpreted = current_hsc_lang
-- force -fvia-C if we are being asked for a .hc file
| HCc <- stop = HscC
| keep_hc = HscC
-- otherwise, stick to the plan
| otherwise = current_hsc_lang
......@@ -252,7 +252,6 @@ data DynFlag
| Opt_Pp
| Opt_ForceRecomp
| Opt_DryRun
| Opt_DoAsmMangling
| Opt_ExcessPrecision
| Opt_EagerBlackHoling
| Opt_ReadUserPackageConf
......@@ -289,7 +288,6 @@ data DynFlag
| Opt_KeepHiDiffs
| Opt_KeepHcFiles
| Opt_KeepSFiles
| Opt_KeepRawSFiles
| Opt_KeepTmpFiles
| Opt_KeepRawTokenStream
| Opt_KeepLlvmFiles
......@@ -398,7 +396,6 @@ data DynFlags = DynFlags {
#ifndef OMIT_NATIVE_CODEGEN
targetPlatform :: Platform, -- ^ The platform we're compiling for. Used by the NCG.
#endif
stolen_x86_regs :: Int,
cmdlineHcIncludes :: [String], -- ^ @\-\#includes@
importPaths :: [FilePath],
mainModIs :: Module,
......@@ -469,7 +466,6 @@ data DynFlags = DynFlags {
pgm_P :: (String,[Option]),
pgm_F :: String,
pgm_c :: (String,[Option]),
pgm_m :: (String,[Option]),
pgm_s :: (String,[Option]),
pgm_a :: (String,[Option]),
pgm_l :: (String,[Option]),
......@@ -668,7 +664,6 @@ defaultDynFlags =
#ifndef OMIT_NATIVE_CODEGEN
targetPlatform = defaultTargetPlatform,
#endif
stolen_x86_regs = 4,
cmdlineHcIncludes = [],
importPaths = ["."],
mainModIs = mAIN,
......@@ -733,7 +728,6 @@ defaultDynFlags =
pgm_P = panic "defaultDynFlags: No pgm_P",
pgm_F = panic "defaultDynFlags: No pgm_F",
pgm_c = panic "defaultDynFlags: No pgm_c",
pgm_m = panic "defaultDynFlags: No pgm_m",
pgm_s = panic "defaultDynFlags: No pgm_s",
pgm_a = panic "defaultDynFlags: No pgm_a",
pgm_l = panic "defaultDynFlags: No pgm_l",
......@@ -1106,7 +1100,7 @@ dynamic_flags = [
, Flag "pgmP" (hasArg setPgmP)
, Flag "pgmF" (hasArg (\f d -> d{ pgm_F = f}))
, Flag "pgmc" (hasArg (\f d -> d{ pgm_c = (f,[])}))
, Flag "pgmm" (hasArg (\f d -> d{ pgm_m = (f,[])}))
, Flag "pgmm" (HasArg (\_ -> addWarn "The -keep-raw-s-files flag does nothing; it will be removed in a future GHC release"))
, Flag "pgms" (hasArg (\f d -> d{ pgm_s = (f,[])}))
, Flag "pgma" (hasArg (\f d -> d{ pgm_a = (f,[])}))
, Flag "pgml" (hasArg (\f d -> d{ pgm_l = (f,[])}))
......@@ -1177,8 +1171,8 @@ dynamic_flags = [
, Flag "keep-hc-files" (NoArg (setDynFlag Opt_KeepHcFiles))
, Flag "keep-s-file" (NoArg (setDynFlag Opt_KeepSFiles))
, Flag "keep-s-files" (NoArg (setDynFlag Opt_KeepSFiles))
, Flag "keep-raw-s-file" (NoArg (setDynFlag Opt_KeepRawSFiles))
, Flag "keep-raw-s-files" (NoArg (setDynFlag Opt_KeepRawSFiles))
, Flag "keep-raw-s-file" (NoArg (addWarn "The -keep-raw-s-file flag does nothing; it will be removed in a future GHC release"))
, Flag "keep-raw-s-files" (NoArg (addWarn "The -keep-raw-s-files flag does nothing; it will be removed in a future GHC release"))
, Flag "keep-llvm-file" (NoArg (setDynFlag Opt_KeepLlvmFiles))
, Flag "keep-llvm-files" (NoArg (setDynFlag Opt_KeepLlvmFiles))
-- This only makes sense as plural
......@@ -1289,9 +1283,9 @@ dynamic_flags = [
------ Machine dependant (-m<blah>) stuff ---------------------------
, Flag "monly-2-regs" (noArg (\s -> s{stolen_x86_regs = 2}))
, Flag "monly-3-regs" (noArg (\s -> s{stolen_x86_regs = 3}))
, Flag "monly-4-regs" (noArg (\s -> s{stolen_x86_regs = 4}))
, Flag "monly-2-regs" (NoArg (addWarn "The -monly-2-regs flag does nothing; it will be removed in a future GHC release"))
, Flag "monly-3-regs" (NoArg (addWarn "The -monly-3-regs flag does nothing; it will be removed in a future GHC release"))
, Flag "monly-4-regs" (NoArg (addWarn "The -monly-4-regs flag does nothing; it will be removed in a future GHC release"))
, Flag "msse2" (NoArg (setDynFlag Opt_SSE2))
------ Warning opts -------------------------------------------------
......@@ -1478,7 +1472,6 @@ fFlags = [
( "dicts-cheap", Opt_DictsCheap, nop ),
( "excess-precision", Opt_ExcessPrecision, nop ),
( "eager-blackholing", Opt_EagerBlackHoling, nop ),
( "asm-mangling", Opt_DoAsmMangling, nop ),
( "print-bind-result", Opt_PrintBindResult, nop ),
( "force-recomp", Opt_ForceRecomp, nop ),
( "hpc-no-auto", Opt_Hpc_No_Auto, nop ),
......@@ -1650,8 +1643,6 @@ defaultFlags
= [ Opt_AutoLinkPackages,
Opt_ReadUserPackageConf,
Opt_DoAsmMangling,
Opt_SharedImplib,
Opt_GenManifest,
......@@ -2153,20 +2144,17 @@ setOptHpcDir arg = upd $ \ d -> d{hpcDir = arg}
-- The options below are not dependent on the version of gcc, only the
-- platform.
machdepCCOpts :: DynFlags -> ([String], -- flags for all C compilations
[String]) -- for registerised HC compilations
machdepCCOpts dflags = let (flagsAll, flagsRegHc) = machdepCCOpts' dflags
in (cCcOpts ++ flagsAll, flagsRegHc)
machdepCCOpts :: DynFlags -> [String] -- flags for all C compilations
machdepCCOpts dflags = cCcOpts ++ machdepCCOpts'
machdepCCOpts' :: DynFlags -> ([String], -- flags for all C compilations
[String]) -- for registerised HC compilations
machdepCCOpts' _dflags
machdepCCOpts' :: [String] -- flags for all C compilations
machdepCCOpts'
#if alpha_TARGET_ARCH
= ( ["-w", "-mieee"
= ["-w", "-mieee"
#ifdef HAVE_THREADED_RTS_SUPPORT
, "-D_REENTRANT"
#endif
], [] )
]
-- For now, to suppress the gcc warning "call-clobbered
-- register used for global register variable", we simply
-- disable all warnings altogether using the -w flag. Oh well.
......@@ -2174,71 +2162,17 @@ machdepCCOpts' _dflags
#elif hppa_TARGET_ARCH
-- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!
-- (very nice, but too bad the HP /usr/include files don't agree.)
= ( ["-D_HPUX_SOURCE"], [] )
#elif m68k_TARGET_ARCH
-- -fno-defer-pop : for the .hc files, we want all the pushing/
-- popping of args to routines to be explicit; if we let things
-- be deferred 'til after an STGJUMP, imminent death is certain!
--
-- -fomit-frame-pointer : *don't*
-- It's better to have a6 completely tied up being a frame pointer
-- rather than let GCC pick random things to do with it.
-- (If we want to steal a6, then we would try to do things
-- as on iX86, where we *do* steal the frame pointer [%ebp].)
= ( [], ["-fno-defer-pop", "-fno-omit-frame-pointer"] )
= ["-D_HPUX_SOURCE"]
#elif i386_TARGET_ARCH
-- -fno-defer-pop : basically the same game as for m68k
--
-- -fomit-frame-pointer : *must* in .hc files; because we're stealing
-- the fp (%ebp) for our register maps.
= let n_regs = stolen_x86_regs _dflags
in
(
[ if opt_Static then "-DDONT_WANT_WIN32_DLL_SUPPORT" else ""
],
[ "-fno-defer-pop",
"-fomit-frame-pointer",
-- we want -fno-builtin, because when gcc inlines
-- built-in functions like memcpy() it tends to
-- run out of registers, requiring -monly-n-regs
"-fno-builtin",
"-DSTOLEN_X86_REGS="++show n_regs ]
)
#elif ia64_TARGET_ARCH
= ( [], ["-fomit-frame-pointer", "-G0"] )
#elif x86_64_TARGET_ARCH
= (
[],
["-fomit-frame-pointer",
"-fno-asynchronous-unwind-tables",
-- the unwind tables are unnecessary for HC code,
-- and get in the way of -split-objs. Another option
-- would be to throw them away in the mangler, but this
-- is easier.
"-fno-builtin"
-- calling builtins like strlen() using the FFI can
-- cause gcc to run out of regs, so use the external
-- version.
] )
#elif sparc_TARGET_ARCH
= ( [], ["-w"] )
-- For now, to suppress the gcc warning "call-clobbered
-- register used for global register variable", we simply
-- disable all warnings altogether using the -w flag. Oh well.
= if opt_Static then ["-DDONT_WANT_WIN32_DLL_SUPPORT"] else []
#elif powerpc_apple_darwin_TARGET
-- -no-cpp-precomp:
-- Disable Apple's precompiling preprocessor. It's a great thing
-- for "normal" programs, but it doesn't support register variable
-- declarations.
= ( [], ["-no-cpp-precomp"] )
#else
= ( [], [] )
= []
#endif
picCCOpts :: DynFlags -> [String]
......
......@@ -14,7 +14,7 @@ module SysTools (
-- Interface to system tools
runUnlit, runCpp, runCc, -- [Option] -> IO ()
runPp, -- [Option] -> IO ()
runMangle, runSplit, -- [Option] -> IO ()
runSplit, -- [Option] -> IO ()
runAs, runLink, -- [Option] -> IO ()
runMkDLL,
runWindres,
......@@ -171,9 +171,8 @@ initSysTools mbMinusB dflags0
-- architecture-specific stuff is done when building Config.hs
unlit_path = installed cGHC_UNLIT_PGM
-- split and mangle are Perl scripts
-- split is a Perl script
split_script = installed cGHC_SPLIT_PGM
mangle_script = installed cGHC_MANGLER_PGM
windres_path = installed_mingw_bin "windres"
......@@ -194,7 +193,7 @@ initSysTools mbMinusB dflags0
| isWindowsHost = installed cGHC_TOUCHY_PGM
| otherwise = "touch"
-- On Win32 we don't want to rely on #!/bin/perl, so we prepend
-- a call to Perl to get the invocation of split and mangle.
-- a call to Perl to get the invocation of split.
-- On Unix, scripts are invoked using the '#!' method. Binary
-- installations of GHC on Unix place the correct line on the
-- front of the script at installation time, so we don't want
......@@ -202,9 +201,6 @@ initSysTools mbMinusB dflags0
(split_prog, split_args)
| isWindowsHost = (perl_path, [Option split_script])
| otherwise = (split_script, [])
(mangle_prog, mangle_args)
| isWindowsHost = (perl_path, [Option mangle_script])
| otherwise = (mangle_script, [])
(mkdll_prog, mkdll_args)
| not isWindowsHost
= panic "Can't build DLLs on a non-Win32 system"
......@@ -234,7 +230,6 @@ initSysTools mbMinusB dflags0
pgm_P = cpp_path,
pgm_F = "",
pgm_c = (gcc_prog,[]),
pgm_m = (mangle_prog,mangle_args),
pgm_s = (split_prog,split_args),
pgm_a = (as_prog,[]),
pgm_l = (ld_prog,[]),
......@@ -372,11 +367,6 @@ getGccEnv opts =
= (path, '\"' : head b_dirs ++ "\";" ++ paths)
mangle_path other = other
runMangle :: DynFlags -> [Option] -> IO ()
runMangle dflags args = do
let (p,args0) = pgm_m dflags
runSomething dflags "Mangler" p (args0++args)
runSplit :: DynFlags -> [Option] -> IO ()
runSplit dflags args = do
let (p,args0) = pgm_s dflags
......
......@@ -324,13 +324,6 @@
<entry>dynamic</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-keep-raw-s-file</option> or
<option>-keep-raw-s-files</option></entry>
<entry>retain intermediate <literal>.raw_s</literal> files</entry>
<entry>dynamic</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-keep-tmp-files</option></entry>
<entry>retain all intermediate temporary files</entry>
......@@ -1998,12 +1991,6 @@ phase <replaceable>n</replaceable></entry>
<entry>-</entry>
</row>
</row>
<row>
<entry><option>-pgmm</option> <replaceable>cmd</replaceable></entry>
<entry>Use <replaceable>cmd</replaceable> as the mangler</entry>
<entry>dynamic</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-pgms</option> <replaceable>cmd</replaceable></entry>
<entry>Use <replaceable>cmd</replaceable> as the splitter</entry>
......@@ -2594,12 +2581,6 @@ phase <replaceable>n</replaceable></entry>
<entry>static</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-fno-asm-mangling</option></entry>
<entry>Turn off assembly mangling (use <option>-unreg</option> instead)</entry>
<entry>dynamic</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-fno-ghci-sandbox</option></entry>
<entry>Turn off the GHCi sandbox. Means computations are run in teh main thread, rather than a forked thread.</entry>
......
......@@ -69,17 +69,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-pgmm</option> <replaceable>cmd</replaceable>
<indexterm><primary><option>-pgmm</option></primary></indexterm>
</term>
<listitem>
<para>Use <replaceable>cmd</replaceable> as the
mangler.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-pgms</option> <replaceable>cmd</replaceable>
......
......@@ -494,22 +494,6 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `uname -m`
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-keep-raw-s-file</option>,
<option>-keep-raw-s-files</option>
<indexterm><primary><option>-keep-raw-s-file</option></primary></indexterm>
<indexterm><primary><option>-keep-raw-s-files</option></primary></indexterm>
</term>
<listitem>
<para>Keep intermediate <literal>.raw-s</literal> files.
These are the direct output from the C compiler, before
GHC does &ldquo;assembly mangling&rdquo; to produce the
<literal>.s</literal> file. Again, these are not produced
when using the native code generator.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-keep-tmp-files</option>
......
......@@ -2203,27 +2203,6 @@ f "2" = 2
</listitem>
</varlistentry>
<varlistentry>
<term><option>-monly-[32]-regs</option>:</term>
<listitem>
<para>(x86 only)<indexterm><primary>-monly-N-regs
option (iX86 only)</primary></indexterm> GHC tries to
&ldquo;steal&rdquo; four registers from GCC, for performance
reasons; it almost always works. However, when GCC is
compiling some modules with four stolen registers, it will
crash, probably saying:
<screen>
Foo.hc:533: fixed or forbidden register was spilled.
This may be due to a compiler bug or to impossible asm
statements or clauses.
</screen>
Just give some registers back with
<option>-monly-N-regs</option>. Try `3' first, then `2'.
If `2' doesn't work, please report the bug to us.</para>
</listitem>
</varlistentry>
</variablelist>
</sect1>
......
# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
# http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
# http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------
dir = driver/mangler
TOP = ../..
include $(TOP)/mk/sub-makefile.mk
This diff is collapsed.
# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
# http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
# http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------
driver/mangler_PERL_SRC = ghc-asm.lprl
driver/mangler_dist_PROG = $(GHC_MANGLER_PGM)
driver/mangler_dist_TOPDIR = YES
driver/mangler_dist_INSTALL_IN = $(DESTDIR)$(topdir)
$(eval $(call build-perl,driver/mangler,dist))
......@@ -544,7 +544,6 @@ BUILD_DIRS += \
ifneq "$(GhcUnregisterised)" "YES"
BUILD_DIRS += \
$(GHC_MANGLER_DIR) \
$(GHC_SPLIT_DIR)
endif
......
......@@ -113,9 +113,9 @@ $(INPLACE_LIB)/extra-gcc-opts : extra-gcc-opts
# The GHC programs need to depend on all the helper programs they might call
ifeq "$(GhcUnregisterised)" "NO"
$(GHC_STAGE1) : $(MANGLER) $(SPLIT)
$(GHC_STAGE2) : $(MANGLER) $(SPLIT)
$(GHC_STAGE3) : $(MANGLER) $(SPLIT)
$(GHC_STAGE1) : $(SPLIT)
$(GHC_STAGE2) : $(SPLIT)
$(GHC_STAGE3) : $(SPLIT)
endif
$(GHC_STAGE1) : $(INPLACE_LIB)/extra-gcc-opts
......