diff options
author | Tamar Christina <tamar@zhox.com> | 2017-08-28 12:29:48 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-08-29 12:38:10 -0400 |
commit | 5266ab9059dffa741b172636f50f1fbfd491dbb4 (patch) | |
tree | 33a59d9f309d775e318cef3b160cec34f359e0c3 /compiler | |
parent | db3a8e168ad81f54ec58eebc4c75a0eaad889daf (diff) | |
download | haskell-5266ab9059dffa741b172636f50f1fbfd491dbb4.tar.gz |
Remove dll-split.
This patch removes dll-split from the code base, the reason is dll-split
no longer makes any sense. It was designed to split a dll in two, but we
now already have many more symbols than would fit inside two dlls. So we
need a third one. This means there's no point in having to maintain this
list as it'll never work anyway and the solution isn't scalable.
Test Plan: ./validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, #ghc_windows_task_force
GHC Trac Issues: #5987
Differential Revision: https://phabricator.haskell.org/D3882
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ghc.mk | 148 | ||||
-rw-r--r-- | compiler/main/DynFlags.hs | 34 | ||||
-rw-r--r-- | compiler/main/Hooks.hs | 2 | ||||
-rw-r--r-- | compiler/main/Packages.hs | 24 |
4 files changed, 17 insertions, 191 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index bfd75ab26c..ab52a1ecf3 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -428,154 +428,6 @@ compiler_stage1_SplitSections = NO compiler_stage2_SplitSections = NO compiler_stage3_SplitSections = NO -# There are too many symbols in the ghc package for a Windows DLL -# (due to a limitation of bfd ld, see Trac #5987). We therefore need to split -# some of the modules off into a separate DLL. This clump are the modules -# reachable from DynFlags: -compiler_stage2_dll0_START_MODULE = DynFlags -compiler_stage2_dll0_MODULES = \ - Annotations \ - ApiAnnotation \ - Avail \ - Bag \ - BasicTypes \ - Binary \ - BinFingerprint \ - BooleanFormula \ - BufWrite \ - ByteCodeTypes \ - Class \ - CmdLineParser \ - CmmType \ - CoAxiom \ - ConLike \ - Coercion \ - Config \ - Constants \ - CoreArity \ - CoreFVs \ - CoreSubst \ - CoreOpt \ - CoreSyn \ - CoreTidy \ - CoreUnfold \ - CoreUtils \ - CoreSeq \ - CoreStats \ - CostCentre \ - DataCon \ - Demand \ - Digraph \ - DriverPhases \ - DynFlags \ - Encoding \ - EnumSet \ - ErrUtils \ - Exception \ - FamInstEnv \ - FastFunctions \ - FastMutInt \ - FastString \ - FastStringEnv \ - FieldLabel \ - FileCleanup \ - Fingerprint \ - FiniteMap \ - ForeignCall \ - FV \ - Hooks \ - HsBinds \ - HsDecls \ - HsDoc \ - HsExpr \ - HsImpExp \ - HsLit \ - PlaceHolder \ - HsExtension \ - PmExpr \ - HsPat \ - HsSyn \ - HsTypes \ - HsUtils \ - HscTypes \ - IOEnv \ - NameCache \ - Id \ - IdInfo \ - IfaceSyn \ - IfaceType \ - InteractiveEvalTypes \ - Json \ - ToIface \ - InstEnv \ - Kind \ - KnownUniques \ - Lexeme \ - ListSetOps \ - Literal \ - Maybes \ - MkCore \ - MkId \ - Module \ - MonadUtils \ - Name \ - NameEnv \ - NameSet \ - OccName \ - OccurAnal \ - OptCoercion \ - OrdList \ - Outputable \ - PackageConfig \ - Packages \ - Pair \ - Panic \ - PatSyn \ - PipelineMonad \ - Platform \ - PlatformConstants \ - PprColour \ - PprCore \ - PrelNames \ - PrelRules \ - Pretty \ - PrimOp \ - RepType \ - RdrName \ - Rules \ - SrcLoc \ - StringBuffer \ - SysTools.Terminal \ - TcEvidence \ - TcRnTypes \ - TcType \ - TrieMap \ - TyCon \ - Type \ - TyCoRep \ - TysPrim \ - TysWiredIn \ - Unify \ - UniqDFM \ - UniqDSet \ - UniqFM \ - UniqSet \ - UniqSupply \ - Unique \ - Util \ - Var \ - VarEnv \ - VarSet - -ifeq "$(GhcWithInterpreter)" "YES" -# These files are reacheable from DynFlags -# only by GHCi-enabled code (see #9552) -compiler_stage2_dll0_MODULES += # none -endif - -compiler_stage2_dll0_HS_OBJS = \ - $(patsubst %,compiler/stage2/build/%.$(dyn_osuf),$(subst .,/,$(compiler_stage2_dll0_MODULES))) - # if stage is set to something other than "1" or "", disable stage 1 # See Note [Stage1Only vs stage=1] in mk/config.mk.in. ifneq "$(filter-out 1,$(stage))" "" diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 45b7e36b09..c15943c7f3 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -766,14 +766,6 @@ data DynFlags = DynFlags { dynObjectSuf :: String, dynHiSuf :: String, - -- Packages.isDllName needs to know whether a call is within a - -- single DLL or not. Normally it does this by seeing if the call - -- is to the same package, but for the ghc package, we split the - -- package between 2 DLLs. The dllSplit tells us which sets of - -- modules are in which package. - dllSplitFile :: Maybe FilePath, - dllSplit :: Maybe [Set String], - outputFile :: Maybe String, dynOutputFile :: Maybe String, outputHi :: Maybe String, @@ -1606,9 +1598,6 @@ defaultDynFlags mySettings = dynObjectSuf = "dyn_" ++ phaseInputExt StopLn, dynHiSuf = "dyn_hi", - dllSplitFile = Nothing, - dllSplit = Nothing, - pluginModNames = [], pluginModNameOpts = [], frontendPluginOpts = [], @@ -2422,27 +2411,13 @@ parseDynamicFlagsFull activeFlags cmdline dflags0 args = do let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4 - dflags6 <- case dllSplitFile dflags5 of - Nothing -> return (dflags5 { dllSplit = Nothing }) - Just f -> - case dllSplit dflags5 of - Just _ -> - -- If dllSplit is out of date then it would have - -- been set to Nothing. As it's a Just, it must be - -- up-to-date. - return dflags5 - Nothing -> - do xs <- liftIO $ readFile f - let ss = map (Set.fromList . words) (lines xs) - return $ dflags5 { dllSplit = Just ss } - -- Set timer stats & heap size - when (enableTimeStats dflags6) $ liftIO enableTimingStats - case (ghcHeapSize dflags6) of + when (enableTimeStats dflags5) $ liftIO enableTimingStats + case (ghcHeapSize dflags5) of Just x -> liftIO (setHeapSize x) _ -> return () - dflags7 <- liftIO $ setLogAction dflags6 + dflags7 <- liftIO $ setLogAction dflags5 liftIO $ setUnsafeGlobalDynFlags dflags7 @@ -2751,9 +2726,6 @@ dynamic_flags_deps = [ (noArg (\d -> d { ghcLink=LinkStaticLib })) , make_ord_flag defGhcFlag "dynload" (hasArg parseDynLibLoaderMode) , make_ord_flag defGhcFlag "dylib-install-name" (hasArg setDylibInstallName) - -- -dll-split is an internal flag, used only during the GHC build - , make_ord_flag defHiddenFlag "dll-split" - (hasArg (\f d -> d { dllSplitFile = Just f, dllSplit = Nothing })) ------- Libraries --------------------------------------------------- , make_ord_flag defFlag "L" (Prefix addLibraryPath) diff --git a/compiler/main/Hooks.hs b/compiler/main/Hooks.hs index 59126e98d5..2e228d5a9a 100644 --- a/compiler/main/Hooks.hs +++ b/compiler/main/Hooks.hs @@ -2,8 +2,6 @@ -- NB: this module is SOURCE-imported by DynFlags, and should primarily -- refer to *types*, rather than *code* --- If you import too muchhere , then the revolting compiler_stage2_dll0_MODULES --- stuff in compiler/ghc.mk makes DynFlags link to too much stuff {-# LANGUAGE CPP #-} module Hooks ( Hooks diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index 50b9967e01..01d66cb740 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -71,6 +71,7 @@ import UniqSet import Module import Util import Panic +import Platform import Outputable import Maybes @@ -1966,16 +1967,19 @@ isDllName dflags this_mod name -- In the mean time, always force dynamic indirections to be -- generated: when the module name isn't the module being -- compiled, references are dynamic. - = if mod /= this_mod - then True - else case dllSplit dflags of - Nothing -> False - Just ss -> - let findMod m = let modStr = moduleNameString (moduleName m) - in case find (modStr `Set.member`) ss of - Just i -> i - Nothing -> panic ("Can't find " ++ modStr ++ "in DLL split") - in findMod mod /= findMod this_mod + = case platformOS $ targetPlatform dflags of + -- On Windows the hack for #8696 makes it unlinkable. + -- As the entire setup of the code from Cmm down to the RTS expects + -- the use of trampolines for the imported functions only when + -- doing intra-package linking, e.g. refering to a symbol defined in the same + -- package should not use a trampoline. + -- I much rather have dynamic TH not supported than the entire Dynamic linking + -- not due to a hack. + -- Also not sure this would break on Windows anyway. + OSMinGW32 -> moduleUnitId mod /= moduleUnitId this_mod + + -- For the other platforms, still perform the hack + _ -> mod /= this_mod | otherwise = False -- no, it is not even an external name |