Kill inaccessible-branch complaints in record update
[ghc.git] / compiler / ghc.mk
index 66548b6..ce41eca 100644 (file)
@@ -5,8 +5,8 @@
 # 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
+#      http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
+#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
 #
 # -----------------------------------------------------------------------------
 
@@ -53,8 +53,9 @@ compiler/stage%/build/Config.hs : mk/config.mk mk/project.mk | $$(dir $$@)/.
        @echo                                                               >> $@
        @echo '#include "ghc_boot_platform.h"'                              >> $@
        @echo                                                               >> $@
-       @echo 'data IntegerLibrary = IntegerGMP | IntegerSimple'            >> $@
-       @echo '    deriving Eq'                                             >> $@
+       @echo 'data IntegerLibrary = IntegerGMP'                            >> $@
+       @echo '                    | IntegerSimple'                         >> $@
+       @echo '                    deriving Eq'                             >> $@
        @echo                                                               >> $@
        @echo 'cBuildPlatformString :: String'                              >> $@
        @echo 'cBuildPlatformString = BuildPlatform_NAME'                   >> $@
@@ -65,12 +66,18 @@ compiler/stage%/build/Config.hs : mk/config.mk mk/project.mk | $$(dir $$@)/.
        @echo                                                               >> $@
        @echo 'cProjectName          :: String'                             >> $@
        @echo 'cProjectName          = "$(ProjectName)"'                    >> $@
+       @echo 'cProjectGitCommitId   :: String'                             >> $@
+       @echo 'cProjectGitCommitId   = "$(ProjectGitCommitId)"'             >> $@
        @echo 'cProjectVersion       :: String'                             >> $@
        @echo 'cProjectVersion       = "$(ProjectVersion)"'                 >> $@
        @echo 'cProjectVersionInt    :: String'                             >> $@
        @echo 'cProjectVersionInt    = "$(ProjectVersionInt)"'              >> $@
        @echo 'cProjectPatchLevel    :: String'                             >> $@
        @echo 'cProjectPatchLevel    = "$(ProjectPatchLevel)"'              >> $@
+       @echo 'cProjectPatchLevel1   :: String'                             >> $@
+       @echo 'cProjectPatchLevel1   = "$(ProjectPatchLevel1)"'             >> $@
+       @echo 'cProjectPatchLevel2   :: String'                             >> $@
+       @echo 'cProjectPatchLevel2   = "$(ProjectPatchLevel2)"'             >> $@
        @echo 'cBooterVersion        :: String'                             >> $@
        @echo 'cBooterVersion        = "$(GhcVersion)"'                     >> $@
        @echo 'cStage                :: String'                             >> $@
@@ -95,12 +102,16 @@ endif
        @echo 'cGhcWithSMP           = "$(GhcWithSMP)"'                     >> $@
        @echo 'cGhcRTSWays           :: String'                             >> $@
        @echo 'cGhcRTSWays           = "$(GhcRTSWays)"'                     >> $@
+       @echo 'cGhcRtsWithLibdw      :: Bool'                               >> $@
+ifeq "$(GhcRtsWithLibdw)" "YES"
+       @echo 'cGhcRtsWithLibdw      = True'                                >> $@
+else
+       @echo 'cGhcRtsWithLibdw      = False'                               >> $@
+endif
        @echo 'cGhcEnableTablesNextToCode :: String'                        >> $@
        @echo 'cGhcEnableTablesNextToCode = "$(GhcEnableTablesNextToCode)"' >> $@
        @echo 'cLeadingUnderscore    :: String'                             >> $@
        @echo 'cLeadingUnderscore    = "$(LeadingUnderscore)"'              >> $@
-       @echo 'cRAWCPP_FLAGS         :: String'                             >> $@
-       @echo 'cRAWCPP_FLAGS         = "$(RAWCPP_FLAGS)"'                   >> $@
        @echo 'cGHC_UNLIT_PGM        :: String'                             >> $@
        @echo 'cGHC_UNLIT_PGM        = "$(utils/unlit_dist_PROG)"'          >> $@
        @echo 'cGHC_SPLIT_PGM        :: String'                             >> $@
@@ -111,12 +122,6 @@ ifeq "$(UseLibFFIForAdjustors)" "YES"
 else
        @echo 'cLibFFI               = False'                               >> $@
 endif
-       @echo 'cDYNAMIC_GHC_PROGRAMS :: Bool'                               >> $@
-ifeq "$(DYNAMIC_GHC_PROGRAMS)" "YES"
-       @echo 'cDYNAMIC_GHC_PROGRAMS = True'                                >> $@
-else
-       @echo 'cDYNAMIC_GHC_PROGRAMS = False'                               >> $@
-endif
 # Note that GhcThreaded just reflects the Makefile variable setting.
 # In particular, the stage1 compiler is never actually compiled with
 # -threaded, but it will nevertheless have cGhcThreaded = True.
@@ -172,11 +177,6 @@ compiler/stage1/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
        @echo "#define BUILD_OS \"$(BuildOS_CPP)\""               >> $@
        @echo "#define HOST_OS \"$(HostOS_CPP)\""                 >> $@
        @echo "#define TARGET_OS \"$(TargetOS_CPP)\""             >> $@
-ifeq "$(TargetOS_CPP)" "irix"
-       @echo "#ifndef $(IRIX_MAJOR)_TARGET_OS"                   >> $@
-       @echo "#define $(IRIX_MAJOR)_TARGET_OS 1"                 >> $@
-       @echo "#endif"                                            >> $@
-endif
        @echo                                                     >> $@
        @echo "#define $(BuildVendor_CPP)_BUILD_VENDOR 1"         >> $@
        @echo "#define $(HostVendor_CPP)_HOST_VENDOR 1"           >> $@
@@ -218,11 +218,6 @@ compiler/stage2/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
        @echo "#define BUILD_OS \"$(HostOS_CPP)\""                >> $@
        @echo "#define HOST_OS \"$(TargetOS_CPP)\""               >> $@
        @echo "#define TARGET_OS \"$(TargetOS_CPP)\""             >> $@
-ifeq "$(TargetOS_CPP)" "irix"
-       @echo "#ifndef $(IRIX_MAJOR)_TARGET_OS"                   >> $@
-       @echo "#define $(IRIX_MAJOR)_TARGET_OS 1"                 >> $@
-       @echo "#endif"                                            >> $@
-endif
        @echo                                                     >> $@
        @echo "#define $(HostVendor_CPP)_BUILD_VENDOR 1"          >> $@
        @echo "#define $(TargetVendor_CPP)_HOST_VENDOR 1"         >> $@
@@ -238,7 +233,7 @@ compiler/stage3/$(PLATFORM_H) : compiler/stage2/$(PLATFORM_H)
        "$(CP)" $< $@
 
 # ----------------------------------------------------------------------------
-#              Generate supporting stuff for prelude/PrimOp.lhs 
+#              Generate supporting stuff for prelude/PrimOp.hs
 #              from prelude/primops.txt
 
 PRIMOP_BITS_NAMES = primop-data-decl.hs-incl        \
@@ -250,8 +245,12 @@ PRIMOP_BITS_NAMES = primop-data-decl.hs-incl        \
                     primop-code-size.hs-incl        \
                     primop-can-fail.hs-incl         \
                     primop-strictness.hs-incl       \
-                    primop-fixity.hs-incl       \
-                    primop-primop-info.hs-incl
+                    primop-fixity.hs-incl           \
+                    primop-primop-info.hs-incl      \
+                    primop-vector-uniques.hs-incl   \
+                    primop-vector-tys.hs-incl       \
+                    primop-vector-tys-exports.hs-incl \
+                    primop-vector-tycons.hs-incl
 
 PRIMOP_BITS_STAGE1 = $(addprefix compiler/stage1/build/,$(PRIMOP_BITS_NAMES))
 PRIMOP_BITS_STAGE2 = $(addprefix compiler/stage2/build/,$(PRIMOP_BITS_NAMES))
@@ -260,13 +259,15 @@ PRIMOP_BITS_STAGE3 = $(addprefix compiler/stage3/build/,$(PRIMOP_BITS_NAMES))
 compiler_CPP_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
 compiler_CPP_OPTS += ${GhcCppOpts}
 
+# We add these paths to the Haskell compiler's #include search path list since
+# we must avoid #including files by paths relative to the source file as Hadrian
+# moves the build artifacts out of the source tree. See #8040.
+compiler_HC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
+
 define preprocessCompilerFiles
 # $0 = stage
-compiler/stage$1/build/Parser.y: compiler/parser/Parser.y.pp
-       $$(CPP) $$(RAWCPP_FLAGS) -P $$(compiler_CPP_OPTS) -x c $$< | grep -v '^#pragma GCC' > $$@
-
 compiler/stage$1/build/primops.txt: compiler/prelude/primops.txt.pp compiler/stage$1/$$(PLATFORM_H)
-       $$(CPP) $$(RAWCPP_FLAGS) -P $$(compiler_CPP_OPTS) -Icompiler/stage$1 -x c $$< | grep -v '^#pragma GCC' > $$@
+       $$(HS_CPP) -P $$(compiler_CPP_OPTS) -Icompiler/stage$1 -x c $$< | grep -v '^#pragma GCC' > $$@
 
 compiler/stage$1/build/primop-data-decl.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
        "$$(genprimopcode_INPLACE)" --data-decl          < $$< > $$@
@@ -290,8 +291,16 @@ compiler/stage$1/build/primop-fixity.hs-incl: compiler/stage$1/build/primops.txt
        "$$(genprimopcode_INPLACE)" --fixity             < $$< > $$@
 compiler/stage$1/build/primop-primop-info.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
        "$$(genprimopcode_INPLACE)" --primop-primop-info < $$< > $$@
-
-# Usages aren't used any more; but the generator 
+compiler/stage$1/build/primop-vector-uniques.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
+       "$$(genprimopcode_INPLACE)" --primop-vector-uniques     < $$< > $$@
+compiler/stage$1/build/primop-vector-tys.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
+       "$$(genprimopcode_INPLACE)" --primop-vector-tys         < $$< > $$@
+compiler/stage$1/build/primop-vector-tys-exports.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
+       "$$(genprimopcode_INPLACE)" --primop-vector-tys-exports < $$< > $$@
+compiler/stage$1/build/primop-vector-tycons.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
+       "$$(genprimopcode_INPLACE)" --primop-vector-tycons      < $$< > $$@
+
+# Usages aren't used any more; but the generator
 # can still generate them if we want them back
 compiler/stage$1/build/primop-usage.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
        "$$(genprimopcode_INPLACE)" --usage              < $$< > $$@
@@ -347,37 +356,36 @@ else
 compiler_CONFIGURE_OPTS += --ghc-option=-DNO_REGS
 endif
 
+ifneq "$(GhcWithSMP)" "YES"
+compiler_CONFIGURE_OPTS += --ghc-option=-DNOSMP
+compiler_CONFIGURE_OPTS += --ghc-option=-optc-DNOSMP
+endif
+
 # Careful optimisation of the parser: we don't want to throw everything
 # at it, because that takes too long and doesn't buy much, but we do want
 # to inline certain key external functions, so we instruct GHC not to
 # throw away inlinings as it would normally do in -O0 mode.
-compiler/stage1/build/Parser_HC_OPTS += -O0 -fno-ignore-interface-pragmas
-# If we're bootstrapping the compiler during stage2, or we're being
-# built by a GHC whose version is > 7.8, we need -fcmm-sink to be
+# Since GHC version 7.8, we need -fcmm-sink to be
 # passed to the compiler. This is required on x86 to avoid the
 # register allocator running out of stack slots when compiling this
 # module with -fPIC -dynamic.
 # See #8182 for all the details
-ifeq "$(CMM_SINK_BOOTSTRAP_IS_NEEDED)" "YES"
-compiler/stage1/build/Parser_HC_OPTS += -fcmm-sink
-endif
-# We also pass -fcmm-sink to every stage != 1
+compiler/stage1/build/Parser_HC_OPTS += -O0 -fno-ignore-interface-pragmas -fcmm-sink
 compiler/stage2/build/Parser_HC_OPTS += -O0 -fno-ignore-interface-pragmas -fcmm-sink
 compiler/stage3/build/Parser_HC_OPTS += -O0 -fno-ignore-interface-pragmas -fcmm-sink
 
-
 ifeq "$(GhcProfiled)" "YES"
 # If we're profiling GHC then we want SCCs.  However, adding -auto-all
 # everywhere tends to give a hard-to-read profile, and adds lots of
 # overhead.  A better approach is to proceed top-down; identify the
 # parts of the compiler of interest, and then add further cost centres
-# as necessary.  Turn on -auto-all for individual modules like this:
+# as necessary.  Turn on -fprof-auto for individual modules like this:
 
-# compiler/main/DriverPipeline_HC_OPTS += -auto-all
-compiler/main/GhcMake_HC_OPTS        += -auto-all
-compiler/main/GHC_HC_OPTS            += -auto-all
+# compiler/main/DriverPipeline_HC_OPTS += -fprof-auto
+compiler/main/GhcMake_HC_OPTS        += -fprof-auto
+compiler/main/GHC_HC_OPTS            += -fprof-auto
 
-# or alternatively add {-# OPTIONS_GHC -auto-all #-} to the top of
+# or alternatively add {-# OPTIONS_GHC -fprof-auto #-} to the top of
 # modules you're interested in.
 
 # We seem to still build the vanilla libraries even if we say
@@ -405,53 +413,160 @@ compiler/stage3/package-data.mk : compiler/ghc.mk
 
 compiler_PACKAGE = ghc
 
-# Note [fiddle-stage1-version]
-# The version of the GHC package changes every day, since the
-# patchlevel is the current date.  We don't want to force
-# recompilation of the entire compiler when this happens, so for stage
-# 1 we omit the patchlevel from the version number.  For stage 2 we
-# have to include the patchlevel since this is the package we install,
-# however.
-#
-# Note: we also have to tweak the version number of the package itself
-# when it gets registered; see Note [munge-stage1-package-config]
-# below.
-# The ProjectPatchLevel > 20000000 iff it's a date. If it's e.g. 6.12.1
-# then we don't want to remove it
-ifneq "$(CLEANING)" "YES"
-ifeq "$(shell [ $(ProjectPatchLevel) -gt 20000000 ] && echo YES)" "YES"
-compiler_stage1_VERSION_MUNGED = YES
-endif
-endif
-
-ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES"
-compiler_stage1_MUNGED_VERSION = $(subst .$(ProjectPatchLevel),,$(ProjectVersion))
-define compiler_PACKAGE_MAGIC
-compiler_stage1_VERSION = $(compiler_stage1_MUNGED_VERSION)
-endef
-
-# Don't register the non-munged package
-compiler_stage1_REGISTER_PACKAGE = NO
-
-endif
-
 # 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
-
-# There are too many symbols in the ghc package for a Windows DLL.
-# We therefore need to split some of the modules off into a separate
-# DLL. This clump are the modules reachable from DynFlags:
+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 \
+       Class \
+       CmdLineParser \
+       CmmType \
+       CoAxiom \
+       ConLike \
+       Coercion \
+       Config \
+       Constants \
+       CoreArity \
+       CoreFVs \
+       CoreSubst \
+       CoreSyn \
+       CoreTidy \
+       CoreUnfold \
+       CoreUtils \
+       CoreSeq \
+       CoreStats \
+       CostCentre \
+       DataCon \
+       Demand \
+       Digraph \
+       DriverPhases \
+       DynFlags \
+       Encoding \
+       ErrUtils \
+       Exception \
+       FamInstEnv \
+       FastFunctions \
+       FastMutInt \
+       FastString \
+       FastStringEnv \
+       FieldLabel \
+       Fingerprint \
+       FiniteMap \
+       ForeignCall \
+       FV \
+       Hooks \
+       HsBinds \
+       HsDecls \
+       HsDoc \
+       HsExpr \
+       HsImpExp \
+       HsLit \
+       PlaceHolder \
+       PmExpr \
+       HsPat \
+       HsSyn \
+       HsTypes \
+       HsUtils \
+       HscTypes \
+       IOEnv \
+  NameCache \
+       Id \
+       IdInfo \
+       IfaceSyn \
+       IfaceType \
+       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 \
+       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
 
-compiler_stage2_dll0_MODULES =Annotations Avail Bag BasicTypes BinIface Binary Bitmap BlockId BreakArray BufWrite BuildTyCl ByteCodeAsm ByteCodeInstr ByteCodeItbls ByteCodeLink CLabel Class CmdLineParser Cmm CmmCallConv CmmExpr CmmInfo CmmMachOp CmmNode CmmType CmmUtils CoAxiom 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 CoreArity CoreFVs CoreLint CoreSubst CoreSyn CoreTidy CoreUnfold CoreUtils CostCentre DataCon Demand Digraph DriverPhases DynFlags Encoding ErrUtils Exception FamInst FamInstEnv FastBool FastFunctions FastMutInt FastString FastTypes Finder Fingerprint FiniteMap ForeignCall Hoopl Hoopl.Dataflow HsBinds HsDecls HsDoc HsExpr HsImpExp HsLit HsPat HsSyn HsTypes HsUtils HscTypes IOEnv Id IdInfo IfaceEnv IfaceSyn IfaceType InstEnv InteractiveEvalTypes Kind ListSetOps Literal LoadIface Maybes MkCore MkGraph MkId Module MonadUtils Name NameEnv NameSet ObjLink OccName OccurAnal OptCoercion OrdList Outputable PackageConfig Packages Pair Panic Platform PlatformConstants PprCmm PprCmmDecl PprCmmExpr PprCore PrelInfo PrelNames PrelRules Pretty PrimOp RdrName Reg RegClass Rules SMRep Serialized SrcLoc StaticFlags StgCmmArgRep StgCmmClosure StgCmmEnv StgCmmLayout StgCmmMonad StgCmmProf StgCmmTicky StgCmmUtils StgSyn Stream StringBuffer TcEvidence TcIface TcMType TcRnMonad TcRnTypes TcType TcTypeNats TrieMap TyCon Type TypeRep TysPrim TysWiredIn Unify 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 += \
+       ByteCodeTypes \
+       InteractiveEvalTypes
+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))" ""
 compiler_stage1_NOT_NEEDED = YES
 endif
@@ -473,8 +588,8 @@ $(eval $(call build-package,compiler,stage3,2))
 define keepCAFsForGHCiDynOnly
 # $1 = stage
 # $2 = way
-ifeq "$$(findstring dyn, $1)" ""
-compiler_stage$1_$2_C_OBJS := $$(filter-out %/keepCAFsForGHCi.o,$$(compiler_stage$1_$2_C_OBJS))
+ifeq "$$(findstring dyn, $2)" ""
+compiler_stage$1_$2_C_OBJS := $$(filter-out %/keepCAFsForGHCi.$$($2_osuf),$$(compiler_stage$1_$2_C_OBJS))
 endif
 endef
 $(foreach w,$(compiler_stage1_WAYS),$(eval $(call keepCAFsForGHCiDynOnly,1,$w)))
@@ -492,9 +607,15 @@ compiler_stage2_CONFIGURE_OPTS += --disable-library-for-ghci
 compiler_stage3_CONFIGURE_OPTS += --disable-library-for-ghci
 
 # after build-package, because that sets compiler_stage1_HC_OPTS:
-compiler_stage1_HC_OPTS += $(GhcStage1HcOpts)
-compiler_stage2_HC_OPTS += $(GhcStage2HcOpts)
-compiler_stage3_HC_OPTS += $(GhcStage3HcOpts)
+ifeq "$(V)" "0"
+compiler_stage1_HC_OPTS += $(filter-out -Rghc-timing,$(GhcHcOpts)) $(GhcStage1HcOpts)
+compiler_stage2_HC_OPTS += $(filter-out -Rghc-timing,$(GhcHcOpts)) $(GhcStage2HcOpts)
+compiler_stage3_HC_OPTS += $(filter-out -Rghc-timing,$(GhcHcOpts)) $(GhcStage3HcOpts)
+else
+compiler_stage1_HC_OPTS += $(GhcHcOpts) $(GhcStage1HcOpts)
+compiler_stage2_HC_OPTS += $(GhcHcOpts) $(GhcStage2HcOpts)
+compiler_stage3_HC_OPTS += $(GhcHcOpts) $(GhcStage3HcOpts)
+endif
 
 ifneq "$(BINDIST)" "YES"
 
@@ -533,26 +654,4 @@ ifeq "$(DYNAMIC_GHC_PROGRAMS)" "YES"
 compiler/utils/Util_HC_OPTS += -DDYNAMIC_GHC_PROGRAMS
 endif
 
-# LibFFI.hs #includes ffi.h
-ifneq "$(UseSystemLibFFI)" "YES"
-compiler/stage2/build/LibFFI.hs : $(libffi_HEADERS)
-endif
-
-# Note [munge-stage1-package-config]
-# Strip the date/patchlevel from the version of stage1.  See Note
-# [fiddle-stage1-version] above.
-ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES"
-compiler/stage1/inplace-pkg-config-munged: compiler/stage1/inplace-pkg-config
-       sed -e 's/^\(version: .*\)\.$(ProjectPatchLevel)$$/\1/' \
-           -e 's/^\(id: .*\)\.$(ProjectPatchLevel)$$/\1/' \
-           -e 's/^\(hs-libraries: HSghc-.*\)\.$(ProjectPatchLevel)$$/\1/' \
-         < $< > $@
-       "$(compiler_stage1_GHC_PKG)" update --force $(compiler_stage1_GHC_PKG_OPTS) $@
-
-# We need to make sure the munged config is in the database before we
-# try to configure ghc-bin
-ghc/stage1/package-data.mk : compiler/stage1/inplace-pkg-config-munged
-endif
-
 endif
-