ghc.mk: fix list for dll-split on GHCi-less builds
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 4 Oct 2014 19:48:22 +0000 (20:48 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 4 Oct 2014 20:29:05 +0000 (21:29 +0100)
To reproduce build failure it's enough to try
to build GHC on amd64 with the following setup:

    $ cat mk/build.mk
    # for #9552
    GhcWithInterpreter = NO

It gives:

    Reachable modules from DynFlags out of date
    Please fix compiler/ghc.mk, or building DLLs on Windows may break (#7780)
    Redundant modules: Bitmap BlockId ... <list of 42 modules>
    <make error>

dll-split among other things makes sure
all mentioned modules are used by DynFlags.
'#ifdef GHCI' keeps is from happening.

Patch moves those 42 modules under
'GhcWithInterpreter' guard.

Fixes Issue #9552

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
compiler/ghc.mk

index 05c935f..8e00149 100644 (file)
@@ -467,36 +467,15 @@ compiler_stage2_dll0_MODULES = \
        BasicTypes \
        BinIface \
        Binary \
-       Bitmap \
-       BlockId \
        BooleanFormula \
        BreakArray \
        BufWrite \
        BuildTyCl \
-       ByteCodeAsm \
-       ByteCodeInstr \
-       ByteCodeItbls \
-       CLabel \
        Class \
        CmdLineParser \
-       Cmm \
-       CmmCallConv \
-       CmmExpr \
-       CmmInfo \
-       CmmMachOp \
-       CmmNode \
        CmmType \
-       CmmUtils \
        CoAxiom \
        ConLike \
-       CodeGen.Platform \
-       CodeGen.Platform.ARM \
-       CodeGen.Platform.NoRegs \
-       CodeGen.Platform.PPC \
-       CodeGen.Platform.PPC_Darwin \
-       CodeGen.Platform.SPARC \
-       CodeGen.Platform.X86 \
-       CodeGen.Platform.X86_64 \
        Coercion \
        Config \
        Constants \
@@ -520,7 +499,6 @@ compiler_stage2_dll0_MODULES = \
        Exception \
        ExtsCompat46 \
        FamInstEnv \
-       FastBool \
        FastFunctions \
        FastMutInt \
        FastString \
@@ -530,8 +508,6 @@ compiler_stage2_dll0_MODULES = \
        FiniteMap \
        ForeignCall \
        Hooks \
-       Hoopl \
-       Hoopl.Dataflow \
        HsBinds \
        HsDecls \
        HsDoc \
@@ -551,14 +527,12 @@ compiler_stage2_dll0_MODULES = \
        IfaceSyn \
        IfaceType \
        InstEnv \
-       InteractiveEvalTypes \
        Kind \
        ListSetOps \
        Literal \
        LoadIface \
        Maybes \
        MkCore \
-       MkGraph \
        MkId \
        Module \
        MonadUtils \
@@ -578,9 +552,6 @@ compiler_stage2_dll0_MODULES = \
        PipelineMonad \
        Platform \
        PlatformConstants \
-       PprCmm \
-       PprCmmDecl \
-       PprCmmExpr \
        PprCore \
        PrelInfo \
        PrelNames \
@@ -588,23 +559,10 @@ compiler_stage2_dll0_MODULES = \
        Pretty \
        PrimOp \
        RdrName \
-       Reg \
-       RegClass \
        Rules \
-       SMRep \
        Serialized \
        SrcLoc \
        StaticFlags \
-       StgCmmArgRep \
-       StgCmmClosure \
-       StgCmmEnv \
-       StgCmmLayout \
-       StgCmmMonad \
-       StgCmmProf \
-       StgCmmTicky \
-       StgCmmUtils \
-       StgSyn \
-       Stream \
        StringBuffer \
        TcEvidence \
        TcIface \
@@ -628,6 +586,54 @@ compiler_stage2_dll0_MODULES = \
        VarEnv \
        VarSet
 
+ifeq "$(GhcWithInterpreter)" "YES"
+# These files are reacheable from DynFlags
+# only by GHCi-enabled code (see #9552)
+compiler_stage2_dll0_MODULES += \
+       Bitmap \
+       BlockId \
+       ByteCodeAsm \
+       ByteCodeInstr \
+       ByteCodeItbls \
+       CLabel \
+       Cmm \
+       CmmCallConv \
+       CmmExpr \
+       CmmInfo \
+       CmmMachOp \
+       CmmNode \
+       CmmUtils \
+       CodeGen.Platform \
+       CodeGen.Platform.ARM \
+       CodeGen.Platform.NoRegs \
+       CodeGen.Platform.PPC \
+       CodeGen.Platform.PPC_Darwin \
+       CodeGen.Platform.SPARC \
+       CodeGen.Platform.X86 \
+       CodeGen.Platform.X86_64 \
+       FastBool \
+       Hoopl \
+       Hoopl.Dataflow \
+       InteractiveEvalTypes \
+       MkGraph \
+       PprCmm \
+       PprCmmDecl \
+       PprCmmExpr \
+       Reg \
+       RegClass \
+       SMRep \
+       StgCmmArgRep \
+       StgCmmClosure \
+       StgCmmEnv \
+       StgCmmLayout \
+       StgCmmMonad \
+       StgCmmProf \
+       StgCmmTicky \
+       StgCmmUtils \
+       StgSyn \
+       Stream
+endif
+
 compiler_stage2_dll0_HS_OBJS = \
     $(patsubst %,compiler/stage2/build/%.$(dyn_osuf),$(subst .,/,$(compiler_stage2_dll0_MODULES)))