Commit 37f257af authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

Rip out object splitting

The splitter is an evil Perl script that processes assembler code.
Its job can be done better by the linker's --gc-sections flag. GHC
passes this flag to the linker whenever -split-sections is passed on
the command line.

This is based on @DemiMarie's D2768.

Fixes Trac #11315
Fixes Trac #9832
Fixes Trac #8964
Fixes Trac #8685
Fixes Trac #8629
parent 646b6dfb
......@@ -68,7 +68,6 @@ _darcs/
/driver/ghc/dist/
/driver/haddock/dist/
/driver/ghci/dist/
/driver/split/dist/
/includes/dist-*/
/libffi/dist-install/
/libraries/*/dist-boot/
......
......@@ -476,7 +476,6 @@ AC_DEFUN([FP_SETTINGS],
SettingsLdCommand="\$tooldir/${mingw_bin_prefix}ld.exe"
SettingsArCommand="\$tooldir/${mingw_bin_prefix}ar.exe"
SettingsRanlibCommand="\$tooldir/${mingw_bin_prefix}ranlib.exe"
SettingsPerlCommand='$tooldir/perl/perl.exe'
SettingsDllWrapCommand="\$tooldir/${mingw_bin_prefix}dllwrap.exe"
SettingsWindresCommand="\$tooldir/${mingw_bin_prefix}windres.exe"
SettingsTouchCommand='$topdir/bin/touchy.exe'
......@@ -488,7 +487,6 @@ AC_DEFUN([FP_SETTINGS],
SettingsHaskellCPPFlags="$HaskellCPPArgs"
SettingsLdCommand="$(basename $LdCmd)"
SettingsArCommand="$(basename $ArCmd)"
SettingsPerlCommand="$(basename $PerlCmd)"
SettingsDllWrapCommand="$(basename $DllWrapCmd)"
SettingsWindresCommand="$(basename $WindresCmd)"
SettingsTouchCommand='$topdir/bin/touchy.exe'
......@@ -499,7 +497,6 @@ AC_DEFUN([FP_SETTINGS],
SettingsLdCommand="$LdCmd"
SettingsArCommand="$ArCmd"
SettingsRanlibCommand="$RanlibCmd"
SettingsPerlCommand="$PerlCmd"
if test -z "$DllWrapCmd"
then
SettingsDllWrapCommand="/bin/false"
......@@ -552,7 +549,6 @@ AC_DEFUN([FP_SETTINGS],
AC_SUBST(SettingsLdFlags)
AC_SUBST(SettingsArCommand)
AC_SUBST(SettingsRanlibCommand)
AC_SUBST(SettingsPerlCommand)
AC_SUBST(SettingsDllWrapCommand)
AC_SUBST(SettingsWindresCommand)
AC_SUBST(SettingsLibtoolCommand)
......@@ -1327,22 +1323,6 @@ AC_DEFUN([FP_GCC_SUPPORTS_NO_PIE],
rm -f conftest.c conftest.o conftest
])
dnl Small feature test for perl version. Assumes PerlCmd
dnl contains path to perl binary.
dnl
dnl (Perl versions prior to v5.6 does not contain the string "v5";
dnl instead they display version strings such as "version 5.005".)
dnl
AC_DEFUN([FPTOOLS_CHECK_PERL_VERSION],
[$PerlCmd -v >conftest.out 2>&1
if grep "v5" conftest.out >/dev/null 2>&1; then
:
else
AC_MSG_ERROR([your version of perl probably won't work, try upgrading it.])
fi
rm -fr conftest*
])
# FP_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR,
# [VALUE-IF-NOT-FOUND], [PATH], [REJECT])
......
......@@ -39,7 +39,6 @@ module CLabel (
mkAsmTempEndLabel,
mkAsmTempDieLabel,
mkSplitMarkerLabel,
mkDirty_MUT_VAR_Label,
mkUpdInfoLabel,
mkBHUpdInfoLabel,
......@@ -486,7 +485,7 @@ mkBlockInfoTableLabel name c = IdLabel name c BlockInfoTable
-- See Note [Proc-point local block entry-point].
-- Constructing Cmm Labels
mkDirty_MUT_VAR_Label, mkSplitMarkerLabel, mkUpdInfoLabel,
mkDirty_MUT_VAR_Label, mkUpdInfoLabel,
mkBHUpdInfoLabel, mkIndStaticInfoLabel, mkMainCapabilityLabel,
mkMAP_FROZEN_CLEAN_infoLabel, mkMAP_FROZEN_DIRTY_infoLabel,
mkMAP_DIRTY_infoLabel,
......@@ -496,7 +495,6 @@ mkDirty_MUT_VAR_Label, mkSplitMarkerLabel, mkUpdInfoLabel,
mkSMAP_FROZEN_CLEAN_infoLabel, mkSMAP_FROZEN_DIRTY_infoLabel,
mkSMAP_DIRTY_infoLabel, mkBadAlignmentLabel :: CLabel
mkDirty_MUT_VAR_Label = mkForeignLabel (fsLit "dirty_MUT_VAR") Nothing ForeignLabelInExternalPackage IsFunction
mkSplitMarkerLabel = CmmLabel rtsUnitId (fsLit "__stg_split_marker") CmmCode
mkUpdInfoLabel = CmmLabel rtsUnitId (fsLit "stg_upd_frame") CmmInfo
mkBHUpdInfoLabel = CmmLabel rtsUnitId (fsLit "stg_bh_upd_frame" ) CmmInfo
mkIndStaticInfoLabel = CmmLabel rtsUnitId (fsLit "stg_IND_STATIC") CmmInfo
......
......@@ -39,7 +39,6 @@ import Id
import IdInfo
import RepType
import DataCon
import Name
import TyCon
import Module
import Outputable
......@@ -120,17 +119,14 @@ variable. -}
cgTopBinding :: DynFlags -> CgStgTopBinding -> FCode ()
cgTopBinding dflags (StgTopLifted (StgNonRec id rhs))
= do { id' <- maybeExternaliseId dflags id
; let (info, fcode) = cgTopRhs dflags NonRecursive id' rhs
= do { let (info, fcode) = cgTopRhs dflags NonRecursive id rhs
; fcode
; addBindC info -- Add the *un-externalised* Id to the envt,
-- so we find it when we look up occurrences
; addBindC info
}
cgTopBinding dflags (StgTopLifted (StgRec pairs))
= do { let (bndrs, rhss) = unzip pairs
; bndrs' <- Prelude.mapM (maybeExternaliseId dflags) bndrs
; let pairs' = zip bndrs' rhss
; let pairs' = zip bndrs rhss
r = unzipWith (cgTopRhs dflags Recursive) pairs'
(infos, fcodes) = unzip r
; addBindsC infos
......@@ -138,16 +134,14 @@ cgTopBinding dflags (StgTopLifted (StgRec pairs))
}
cgTopBinding dflags (StgTopStringLit id str)
= do { id' <- maybeExternaliseId dflags id
; let label = mkBytesLabel (idName id')
= do { let label = mkBytesLabel (idName id)
; let (lit, decl) = mkByteStringCLit label str
; emitDecl decl
; addBindC (litIdInfo dflags id' mkLFStringLit lit)
; addBindC (litIdInfo dflags id mkLFStringLit lit)
}
cgTopRhs :: DynFlags -> RecFlag -> Id -> CgStgRhs -> (CgIdInfo, FCode ())
-- The Id is passed along for setting up a binding...
-- It's already been externalised if necessary
cgTopRhs dflags _rec bndr (StgRhsCon _cc con args)
= cgTopRhsCon dflags bndr con (assertNonVoidStgArgs args)
......@@ -226,25 +220,3 @@ cgDataCon data_con
}
-- The case continuation code expects a tagged pointer
}
---------------------------------------------------------------
-- Stuff to support splitting
---------------------------------------------------------------
maybeExternaliseId :: DynFlags -> Id -> FCode Id
maybeExternaliseId dflags id
| gopt Opt_SplitObjs dflags, -- See Note [Externalise when splitting]
-- in StgCmmMonad
isInternalName name = do { mod <- getModuleName
; return (setIdName id (externalise mod)) }
| otherwise = return id
where
externalise mod = mkExternalName uniq mod new_occ loc
name = idName id
uniq = nameUnique name
new_occ = mkLocalOcc uniq (nameOccName name)
loc = nameSrcSpan name
-- We want to conjure up a name that can't clash with any
-- existing name. So we generate
-- Mod_$L243foo
-- where 243 is the unique.
......@@ -758,19 +758,14 @@ cgIdApp fun_id args = do
dflags <- getDynFlags
fun_info <- getCgIdInfo fun_id
self_loop_info <- getSelfLoop
let cg_fun_id = cg_id fun_info
-- NB: use (cg_id fun_info) instead of fun_id, because
-- the former may be externalised for -split-objs.
-- See Note [Externalise when splitting] in StgCmmMonad
fun_arg = StgVarArg cg_fun_id
fun_name = idName cg_fun_id
let fun_arg = StgVarArg fun_id
fun_name = idName fun_id
fun = idInfoToAmode fun_info
lf_info = cg_lf fun_info
n_args = length args
v_args = length $ filter (isVoidTy . stgArgType) args
node_points dflags = nodeMustPointToIt dflags lf_info
case getCallMethod dflags fun_name cg_fun_id lf_info n_args v_args (cg_loc fun_info) self_loop_info of
case getCallMethod dflags fun_name fun_id lf_info n_args v_args (cg_loc fun_info) self_loop_info of
-- A value in WHNF, so we can just return it.
ReturnIt
| isVoidTy (idType fun_id) -> emitReturn []
......
......@@ -174,20 +174,10 @@ type CgBindings = IdEnv CgIdInfo
data CgIdInfo
= CgIdInfo
{ cg_id :: Id -- Id that this is the info for
-- Can differ from the Id at occurrence sites by
-- virtue of being externalised, for splittable C
-- See Note [Externalise when splitting]
, cg_lf :: LambdaFormInfo
, cg_loc :: CgLoc -- CmmExpr for the *tagged* value
}
-- Note [Externalise when splitting]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- If we're splitting the object with -fsplit-objs, we need to
-- externalise *all* the top-level names, and then make sure we only
-- use the externalised one in any C label we use which refers to this
-- name.
instance Outputable CgIdInfo where
ppr (CgIdInfo { cg_id = id, cg_loc = loc })
= ppr id <+> text "-->" <+> ppr loc
......
......@@ -92,8 +92,6 @@ else ifeq "$(INTEGER_LIBRARY)" "integer-simple"
else ifneq "$(CLEANING)" "YES"
$(error Unknown integer library)
endif
@echo 'cSupportsSplitObjs :: String' >> $@
@echo 'cSupportsSplitObjs = "$(SupportsSplitObjs)"' >> $@
@echo 'cGhcWithInterpreter :: String' >> $@
@echo 'cGhcWithInterpreter = "$(GhcWithInterpreter)"' >> $@
@echo 'cGhcWithNativeCodeGen :: String' >> $@
......@@ -114,8 +112,6 @@ endif
@echo 'cLeadingUnderscore = "$(LeadingUnderscore)"' >> $@
@echo 'cGHC_UNLIT_PGM :: String' >> $@
@echo 'cGHC_UNLIT_PGM = "$(utils/unlit_dist_PROG)"' >> $@
@echo 'cGHC_SPLIT_PGM :: String' >> $@
@echo 'cGHC_SPLIT_PGM = "$(driver/split_dist_PROG)"' >> $@
@echo 'cLibFFI :: Bool' >> $@
ifeq "$(UseLibFFIForAdjustors)" "YES"
@echo 'cLibFFI = True' >> $@
......@@ -421,9 +417,6 @@ compiler_PACKAGE = ghc
# Don't do splitting for the GHC package, it takes too long and
# there's not much benefit.
compiler_stage1_SplitObjs = NO
compiler_stage2_SplitObjs = NO
compiler_stage3_SplitObjs = NO
compiler_stage1_SplitSections = NO
compiler_stage2_SplitSections = NO
compiler_stage3_SplitSections = NO
......
......@@ -138,8 +138,6 @@ data Phase
| Cobjc -- Compile Objective-C
| Cobjcxx -- Compile Objective-C++
| HCc -- Haskellised C (as opposed to vanilla C) compilation
| Splitter -- Assembly file splitter (part of '-split-objs')
| SplitAs -- Assembler for split assembly files (part of '-split-objs')
| As Bool -- Assembler for regular assembly files (Bool: with-cpp)
| LlvmOpt -- Run LLVM opt tool over llvm assembly
| LlvmLlc -- LLVM bitcode to native assembly
......@@ -173,8 +171,6 @@ eqPhase (Hsc _) (Hsc _) = True
eqPhase Cc Cc = True
eqPhase Cobjc Cobjc = True
eqPhase HCc HCc = True
eqPhase Splitter Splitter = True
eqPhase SplitAs SplitAs = True
eqPhase (As x) (As y) = x == y
eqPhase LlvmOpt LlvmOpt = True
eqPhase LlvmLlc LlvmLlc = True
......@@ -218,11 +214,9 @@ nextPhase dflags p
Cpp sf -> HsPp sf
HsPp sf -> Hsc sf
Hsc _ -> maybeHCc
Splitter -> SplitAs
LlvmOpt -> LlvmLlc
LlvmLlc -> LlvmMangle
LlvmMangle -> As False
SplitAs -> MergeForeign
As _ -> MergeForeign
Ccxx -> As False
Cc -> As False
......@@ -257,7 +251,6 @@ startPhase "M" = Cobjcxx
startPhase "mm" = Cobjcxx
startPhase "cc" = Ccxx
startPhase "cxx" = Ccxx
startPhase "split_s" = Splitter
startPhase "s" = As False
startPhase "S" = As True
startPhase "ll" = LlvmOpt
......@@ -286,13 +279,11 @@ phaseInputExt Ccxx = "cpp"
phaseInputExt Cobjc = "m"
phaseInputExt Cobjcxx = "mm"
phaseInputExt Cc = "c"
phaseInputExt Splitter = "split_s"
phaseInputExt (As True) = "S"
phaseInputExt (As False) = "s"
phaseInputExt LlvmOpt = "ll"
phaseInputExt LlvmLlc = "bc"
phaseInputExt LlvmMangle = "lm_s"
phaseInputExt SplitAs = "split_s"
phaseInputExt CmmCpp = "cmmcpp"
phaseInputExt Cmm = "cmm"
phaseInputExt MergeForeign = "o"
......
{-# LANGUAGE CPP, NamedFieldPuns, NondecreasingIndentation, BangPatterns #-}
{-# LANGUAGE CPP, NamedFieldPuns, NondecreasingIndentation, BangPatterns, MultiWayIf #-}
{-# OPTIONS_GHC -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
......@@ -70,7 +70,7 @@ import System.Directory
import System.FilePath
import System.IO
import Control.Monad
import Data.List ( isInfixOf, isSuffixOf, intercalate )
import Data.List ( isInfixOf, intercalate )
import Data.Maybe
import Data.Version
import Data.Either ( partitionEithers )
......@@ -247,7 +247,7 @@ compileOne' m_tc_result mHscMessage
src_flavour = ms_hsc_src summary
mod_name = ms_mod_name summary
next_phase = hscPostBackendPhase dflags src_flavour hsc_lang
next_phase = hscPostBackendPhase src_flavour hsc_lang
object_filename = ml_obj_file location
-- #8180 - when using TemplateHaskell, switch on -dynamic-too so
......@@ -505,7 +505,6 @@ compileFile hsc_env stop_phase (src, mb_phase) = do
let
dflags = hsc_dflags hsc_env
split = gopt Opt_SplitObjs dflags
mb_o_file = outputFile dflags
ghc_link = ghcLink dflags -- Set by -c or -no-link
......@@ -522,11 +521,7 @@ compileFile hsc_env stop_phase (src, mb_phase) = do
-- -o foo applies to the file we are compiling now
| otherwise = Persistent
stop_phase' = case stop_phase of
As _ | split -> SplitAs
_ -> stop_phase
( _, out_file) <- runPipeline stop_phase' hsc_env
( _, out_file) <- runPipeline stop_phase hsc_env
(src, fmap RealPhase mb_phase) Nothing output
Nothing{-no ModLocation-} []
return out_file
......@@ -1085,7 +1080,7 @@ runPhase (HscOut src_flavour mod_name result) _ dflags = do
let o_file = ml_obj_file location -- The real object file
hsc_lang = hscTarget dflags
next_phase = hscPostBackendPhase dflags src_flavour hsc_lang
next_phase = hscPostBackendPhase src_flavour hsc_lang
case result of
HscNotGeneratingCode ->
......@@ -1138,7 +1133,7 @@ runPhase (RealPhase Cmm) input_fn dflags
= do
let hsc_lang = hscTarget dflags
let next_phase = hscPostBackendPhase dflags HsSrcFile hsc_lang
let next_phase = hscPostBackendPhase HsSrcFile hsc_lang
output_fn <- phaseOutputFilename next_phase
......@@ -1280,41 +1275,10 @@ runPhase (RealPhase cc_phase) input_fn dflags
return (RealPhase next_phase, output_fn)
-----------------------------------------------------------------------------
-- Splitting phase
runPhase (RealPhase Splitter) input_fn dflags
= do -- tmp_pfx is the prefix used for the split .s files
split_s_prefix <-
liftIO $ newTempName dflags TFL_CurrentModule "split"
let n_files_fn = split_s_prefix
liftIO $ SysTools.runSplit dflags
[ SysTools.FileOption "" input_fn
, SysTools.FileOption "" split_s_prefix
, SysTools.FileOption "" n_files_fn
]
-- Save the number of split files for future references
s <- liftIO $ readFile n_files_fn
let n_files = read s :: Int
dflags' = dflags { splitInfo = Just (split_s_prefix, n_files) }
setDynFlags dflags'
-- Remember to delete all these files
liftIO $ addFilesToClean dflags' TFL_CurrentModule $
[ split_s_prefix ++ "__" ++ show n ++ ".s"
| n <- [1..n_files]]
return (RealPhase SplitAs,
"**splitter**") -- we don't use the filename in SplitAs
-----------------------------------------------------------------------------
-- As, SpitAs phase : Assembler
-- This is for calling the assembler on a regular assembly file (not split).
-- This is for calling the assembler on a regular assembly file
runPhase (RealPhase (As with_cpp)) input_fn dflags
= do
-- LLVM from version 3.0 onwards doesn't support the OS X system
......@@ -1379,96 +1343,6 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags
return (RealPhase next_phase, output_fn)
-- This is for calling the assembler on a split assembly file (so a collection
-- of assembly files)
runPhase (RealPhase SplitAs) _input_fn dflags
= do
-- we'll handle the stub_o file in this phase, so don't MergeForeign,
-- just jump straight to StopLn afterwards.
let next_phase = StopLn
output_fn <- phaseOutputFilename next_phase
let base_o = dropExtension output_fn
osuf = objectSuf dflags
split_odir = base_o ++ "_" ++ osuf ++ "_split"
let pic_c_flags = picCCOpts dflags
-- this also creates the hierarchy
liftIO $ createDirectoryIfMissing True split_odir
-- remove M_split/ *.o, because we're going to archive M_split/ *.o
-- later and we don't want to pick up any old objects.
fs <- liftIO $ getDirectoryContents split_odir
liftIO $ mapM_ removeFile $
map (split_odir </>) $ filter (osuf `isSuffixOf`) fs
let (split_s_prefix, n) = case splitInfo dflags of
Nothing -> panic "No split info"
Just x -> x
let split_s n = split_s_prefix ++ "__" ++ show n <.> "s"
split_obj :: Int -> FilePath
split_obj n = split_odir </>
takeFileName base_o ++ "__" ++ show n <.> osuf
let assemble_file n
= SysTools.runAs dflags (
-- We only support SparcV9 and better because V8 lacks an atomic CAS
-- instruction so we have to make sure that the assembler accepts the
-- instruction set. Note that the user can still override this
-- (e.g., -mcpu=ultrasparc). GCC picks the "best" -mcpu flag
-- regardless of the ordering.
--
-- This is a temporary hack.
(if platformArch (targetPlatform dflags) == ArchSPARC
then [SysTools.Option "-mcpu=v9"]
else []) ++
-- See Note [-fPIC for assembler]
map SysTools.Option pic_c_flags ++
[ SysTools.Option "-c"
, SysTools.Option "-o"
, SysTools.FileOption "" (split_obj n)
, SysTools.FileOption "" (split_s n)
])
liftIO $ mapM_ assemble_file [1..n]
-- Note [pipeline-split-init]
-- If we have a stub file -- which will be part of foreign_os --
-- it may contain constructor
-- functions for initialisation of this module. We can't
-- simply leave the stub as a separate object file, because it
-- will never be linked in: nothing refers to it. We need to
-- ensure that if we ever refer to the data in this module
-- that needs initialisation, then we also pull in the
-- initialisation routine.
--
-- To that end, we make a DANGEROUS ASSUMPTION here: the data
-- that needs to be initialised is all in the FIRST split
-- object. See Note [codegen-split-init].
--
-- We also merge in all the foreign objects since we're at it.
PipeState{foreign_os} <- getPipeState
if null foreign_os
then return ()
else liftIO $ do
tmp_split_1 <- newTempName dflags TFL_CurrentModule osuf
let split_1 = split_obj 1
copyFile split_1 tmp_split_1
removeFile split_1
joinObjectFiles dflags (tmp_split_1 : foreign_os) split_1
-- join them into a single .o file
liftIO $ joinObjectFiles dflags (map split_obj [1..n]) output_fn
return (RealPhase next_phase, output_fn)
-----------------------------------------------------------------------------
-- LlvmOpt phase
runPhase (RealPhase LlvmOpt) input_fn dflags
......@@ -1510,13 +1384,10 @@ runPhase (RealPhase LlvmOpt) input_fn dflags
runPhase (RealPhase LlvmLlc) input_fn dflags
= do
next_phase <- if fastLlvmPipeline dflags
then maybeMergeForeign
-- hidden debugging flag '-dno-llvm-mangler' to skip mangling
else case gopt Opt_NoLlvmMangler dflags of
False -> return LlvmMangle
True | gopt Opt_SplitObjs dflags -> return Splitter
True -> return (As False)
next_phase <- if | fastLlvmPipeline dflags -> maybeMergeForeign
-- hidden debugging flag '-dno-llvm-mangler' to skip mangling
| gopt Opt_NoLlvmMangler dflags -> return (As False)
| otherwise -> return LlvmMangle
output_fn <- phaseOutputFilename next_phase
......@@ -1588,7 +1459,7 @@ runPhase (RealPhase LlvmLlc) input_fn dflags
runPhase (RealPhase LlvmMangle) input_fn dflags
= do
let next_phase = if gopt Opt_SplitObjs dflags then Splitter else As False
let next_phase = As False
output_fn <- phaseOutputFilename next_phase
liftIO $ llvmFixupAsm dflags input_fn output_fn
return (RealPhase next_phase, output_fn)
......@@ -2271,14 +2142,13 @@ sourceModified dest_file src_timestamp = do
return (t2 <= src_timestamp)
-- | What phase to run after one of the backend code generators has run
hscPostBackendPhase :: DynFlags -> HscSource -> HscTarget -> Phase
hscPostBackendPhase _ HsBootFile _ = StopLn
hscPostBackendPhase _ HsigFile _ = StopLn
hscPostBackendPhase dflags _ hsc_lang =
hscPostBackendPhase :: HscSource -> HscTarget -> Phase
hscPostBackendPhase HsBootFile _ = StopLn
hscPostBackendPhase HsigFile _ = StopLn
hscPostBackendPhase _ hsc_lang =
case hsc_lang of
HscC -> HCc
HscAsm | gopt Opt_SplitObjs dflags -> Splitter
| otherwise -> As False
HscC -> HCc
HscAsm -> As False
HscLlvm -> LlvmOpt
HscNothing -> StopLn
HscInterpreted -> StopLn
......
......@@ -90,7 +90,7 @@ module DynFlags (
ghcUsagePath, ghciUsagePath, topDir, tmpDir, rawSettings,
versionedAppDir,
extraGccViaCFlags, systemPackageConfig,
pgm_L, pgm_P, pgm_F, pgm_c, pgm_s, pgm_a, pgm_l, pgm_dll, pgm_T,
pgm_L, pgm_P, pgm_F, pgm_c, pgm_a, pgm_l, pgm_dll, pgm_T,
pgm_windres, pgm_libtool, pgm_ar, pgm_ranlib, pgm_lo, pgm_lc,
pgm_lcc, pgm_i, opt_L, opt_P, opt_F, opt_c, opt_a, opt_l, opt_i,
opt_P_signature,
......@@ -526,7 +526,6 @@ data GeneralFlag
| Opt_ExcessPrecision
| Opt_EagerBlackHoling
| Opt_NoHsMain
| Opt_SplitObjs
| Opt_SplitSections
| Opt_StgStats
| Opt_HideAllPackages
......@@ -1322,7 +1321,6 @@ data Settings = Settings {
sPgm_P :: (String,[Option]),
sPgm_F :: String,
sPgm_c :: (String,[Option]),
sPgm_s :: (String,[Option]),
sPgm_a :: (String,[Option]),
sPgm_l :: (String,[Option]),
sPgm_dll :: (String,[Option]),
......@@ -1383,8 +1381,6 @@ pgm_F :: DynFlags -> String
pgm_F dflags = sPgm_F (settings dflags)
pgm_c :: DynFlags -> (String,[Option])
pgm_c dflags = sPgm_c (settings dflags)
pgm_s :: DynFlags -> (String,[Option])
pgm_s dflags = sPgm_s (settings dflags)
pgm_a :: DynFlags -> (String,[Option])
pgm_a dflags = sPgm_a (settings dflags)
pgm_l :: DynFlags -> (String,[Option])
......@@ -1746,13 +1742,10 @@ wayUnsetGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayUnsetGeneralFlags _ (WayCustom {}) = []
wayUnsetGeneralFlags _ WayThreaded = []
wayUnsetGeneralFlags _ WayDebug = []
wayUnsetGeneralFlags _ WayDyn = [-- There's no point splitting objects
wayUnsetGeneralFlags _ WayDyn = [-- There's no point splitting
-- when we're going to be dynamically
-- linking. Plus it breaks compilation
-- on OSX x86.
Opt_SplitObjs,
-- If splitobjs wasn't useful for this,
-- assume sections aren't either.
Opt_SplitSections]
wayUnsetGeneralFlags _ WayProf = []
wayUnsetGeneralFlags _ WayEventLog = []
......@@ -3015,7 +3008,7 @@ dynamic_flags_deps = [
-- (see Trac #15319)
sGccSupportsNoPie = False})))
, make_ord_flag defFlag "pgms"
(hasArg (\f -> alterSettings (\s -> s { sPgm_s = (f,[])})))
(HasArg (\_ -> addWarn "Object splitting was removed in GHC 8.8"))
, make_ord_flag defFlag "pgma"
(hasArg (\f -> alterSettings (\s -> s { sPgm_a = (f,[])})))
, make_ord_flag defFlag "pgml"
......@@ -3056,9 +3049,7 @@ dynamic_flags_deps = [
alterSettings (\s -> s { sOpt_windres = f : sOpt_windres s})))
, make_ord_flag defGhcFlag "split-objs"
(NoArg (if can_split
then setGeneralFlag Opt_SplitObjs
else addWarn "ignoring -split-objs"))
(NoArg $ addWarn "ignoring -split-objs")
, make_ord_flag defGhcFlag "split-sections"
(noArgM (\dflags -> do
......@@ -5587,12 +5578,6 @@ picPOpts dflags
| gopt Opt_PIC dflags = ["-U__PIC__", "-D__PIC__"]
| otherwise = []
-- -----------------------------------------------------------------------------
-- Splitting
can_split :: Bool
can_split = cSupportsSplitObjs == "YES"
-- -----------------------------------------------------------------------------
-- Compiler Info
......@@ -5615,7 +5600,7 @@ compilerInfo dflags
("Host platform", cHostPlatformString),
("Target platform", cTargetPlatformString),
("Have interpreter", cGhcWithInterpreter),
("Object splitting supported", cSupportsSplitObjs),
("Object splitting supported", showBool False),
("Have native code generator", cGhcWithNativeCodeGen),
("Support SMP", cGhcWithSMP),
("Tables next to code", cGhcEnableTablesNextToCode),
......
......@@ -1494,7 +1494,7 @@ doCodeGen hsc_env this_mod data_tycons
-- we generate one SRT for the whole module.
let
pipeline_stream