From 37f257afcd6a52cf4d76c60d766b1aeb520b9f05 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 26 Nov 2018 17:21:12 -0500 Subject: 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 --- hadrian/src/Rules/Generate.hs | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'hadrian/src/Rules/Generate.hs') diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index 13544f2a7d..032f6a68c1 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -174,11 +174,6 @@ generateRules = do priority 2.0 $ (root -/- generatedDir -/- "ghcplatform.h") <~ generateGhcPlatformH priority 2.0 $ (root -/- generatedDir -/- "ghcversion.h") <~ generateGhcVersionH - forM_ [Stage0 ..] $ \stage -> - root -/- ghcSplitPath stage %> \path -> do - generate path emptyTarget generateGhcSplit - makeExecutable path - -- TODO: simplify, get rid of fake rts context root -/- generatedDir ++ "//*" %> \file -> do withTempDir $ \dir -> build $ @@ -200,26 +195,6 @@ emptyTarget = vanillaContext (error "Rules.Generate.emptyTarget: unknown stage") cppify :: String -> String cppify = replaceEq '-' '_' . replaceEq '.' '_' -ghcSplitSource :: FilePath -ghcSplitSource = "driver/split/ghc-split.pl" - --- ref: rules/build-perl.mk --- | Generate the @ghc-split@ Perl script. -generateGhcSplit :: Expr String -generateGhcSplit = do - trackGenerateHs - targetPlatform <- getSetting TargetPlatform - ghcEnableTNC <- expr $ yesNo <$> ghcEnableTablesNextToCode - perlPath <- getBuilderPath Perl - contents <- expr $ readFileLines ghcSplitSource - return . unlines $ - [ "#!" ++ perlPath - , "my $TARGETPLATFORM = " ++ show targetPlatform ++ ";" - -- I don't see where the ghc-split tool uses TNC, but - -- it's in the build-perl macro. - , "my $TABLES_NEXT_TO_CODE = " ++ show ghcEnableTNC ++ ";" - ] ++ contents - -- | Generate @ghcplatform.h@ header. generateGhcPlatformH :: Expr String generateGhcPlatformH = do @@ -289,7 +264,6 @@ generateConfigHs = do | intLib == integerGmp = "IntegerGMP" | intLib == integerSimple = "IntegerSimple" | otherwise = error $ "Unknown integer library: " ++ pkgName intLib - cSupportsSplitObjs <- expr $ yesNo <$> supportsSplitObjects cGhcWithInterpreter <- expr $ yesNo <$> ghcWithInterpreter cGhcWithNativeCodeGen <- expr $ yesNo <$> ghcWithNativeCodeGen cGhcWithSMP <- expr $ yesNo <$> ghcWithSMP @@ -341,8 +315,6 @@ generateConfigHs = do , "cIntegerLibrary = " ++ show (pkgName intLib) , "cIntegerLibraryType :: IntegerLibrary" , "cIntegerLibraryType = " ++ cIntegerLibraryType - , "cSupportsSplitObjs :: String" - , "cSupportsSplitObjs = " ++ show cSupportsSplitObjs , "cGhcWithInterpreter :: String" , "cGhcWithInterpreter = " ++ show cGhcWithInterpreter , "cGhcWithNativeCodeGen :: String" @@ -357,8 +329,6 @@ generateConfigHs = do , "cLeadingUnderscore = " ++ show cLeadingUnderscore , "cGHC_UNLIT_PGM :: String" , "cGHC_UNLIT_PGM = " ++ show cGHC_UNLIT_PGM - , "cGHC_SPLIT_PGM :: String" - , "cGHC_SPLIT_PGM = " ++ show "ghc-split" , "cLibFFI :: Bool" , "cLibFFI = " ++ show cLibFFI , "cGhcThreaded :: Bool" -- cgit v1.2.1