summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-11-12 19:37:07 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-11-13 03:04:49 +0000
commit3273d73addacbddaeb647136a6e8aaee9f8a421b (patch)
tree359cd8bf4039f5d275a854bc455be506874e5a15
parent4f4e8a6044ebd052e3500530a657bd203c677830 (diff)
downloadhaskell-wip/make-unify-distdirs.tar.gz
Make: Name GHC according to the stage it is *built* in, not used in.wip/make-unify-distdirs
The basic reason is that is the modular thing to do: where there is one canonical predecessor stage, there are be many possible successor stages. It would be arbitrary to just name the newly built GHC after one of them. That means we have: - distdirs decremented: `stage0`, `stage1`, and `stage2` - prog names decremented: `ghc-stage0`, `ghc-stage1`, `ghc-stage2` - `Stage1Only` -> `Stage0Only` - in the test suite, `STAGE<N+>` to `STAGE<N>` However, `GHC_STAGE0` already meant the GHC used for stage1 -- there was no missing 0 so we could decrement losslessly. We instead named `GHC_STAGE<N>` `HC_STAGE<N>` to match `CC_STAGE<N>` and friends (which are similarly abstractly named) because they are all morally parameters, not results, and added a comment explaining. This is very hard to review, but one thing that might help is the fish one-liner: ```fish git diff (for x in HEAD^ HEAD; git grep 'stage[0123]' $x | sed -E 's/^HEAD\^?://' | psub; end) ```
-rw-r--r--.gitignore10
-rw-r--r--compiler/GHC/Core/Opt/SpecConstr.hs3
-rw-r--r--compiler/GHC/Driver/Env.hs7
-rw-r--r--compiler/GHC/Driver/Pipeline/Execute.hs2
-rw-r--r--compiler/GHC/SysTools/BaseDir.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Splice.hs2
-rw-r--r--compiler/GHC/Utils/Error.hs4
-rw-r--r--compiler/ghc.mk86
-rw-r--r--distrib/configure.ac.in2
-rw-r--r--distrib/cross-port2
-rw-r--r--distrib/hc-build2
-rw-r--r--docs/users_guide/using.rst2
-rw-r--r--driver/ghci/ghci.c4
-rw-r--r--ghc.mk109
-rw-r--r--ghc/ghc.mk86
-rw-r--r--hadrian/doc/cross-compile.md4
-rw-r--r--hadrian/doc/make.md2
-rw-r--r--hadrian/src/Packages.hs2
-rw-r--r--hadrian/src/Rules/Generate.hs6
-rw-r--r--hadrian/src/Settings/Builders/Cabal.hs2
-rw-r--r--m4/fp_prog_ghc_pkg.m42
-rw-r--r--m4/fptools_set_c_ld_flags.m42
-rw-r--r--mk/compiler-ghc.mk20
-rw-r--r--mk/config.mk.in81
-rw-r--r--mk/flavours/bench-cross-ncg.mk6
-rw-r--r--mk/flavours/bench-cross.mk6
-rw-r--r--mk/flavours/bench-llvm.mk4
-rw-r--r--mk/flavours/bench.mk4
-rw-r--r--mk/flavours/devel-cross-ncg.mk6
-rw-r--r--mk/flavours/devel1.mk4
-rw-r--r--mk/flavours/devel2.mk4
-rw-r--r--mk/flavours/dwarf.mk4
-rw-r--r--mk/flavours/perf-cross-ncg.mk4
-rw-r--r--mk/flavours/perf-cross.mk6
-rw-r--r--mk/flavours/perf-llvm.mk4
-rw-r--r--mk/flavours/perf.mk2
-rw-r--r--mk/flavours/prof-llvm.mk2
-rw-r--r--mk/flavours/prof.mk4
-rw-r--r--mk/flavours/quick-cross-ncg.mk6
-rw-r--r--mk/flavours/quick-cross.mk6
-rw-r--r--mk/flavours/quick-llvm.mk4
-rw-r--r--mk/flavours/quick.mk4
-rw-r--r--mk/flavours/quickest.mk4
-rw-r--r--mk/flavours/validate.mk10
-rw-r--r--mk/warnings.mk4
-rw-r--r--rts/ghc.mk2
-rw-r--r--rts/include/MachDeps.h4
-rw-r--r--rts/posix/Ticker.c4
-rw-r--r--rules/build-package-data.mk2
-rw-r--r--rules/build-package-way.mk2
-rw-r--r--rules/build-package.mk2
-rw-r--r--rules/build-prog.mk2
-rw-r--r--rules/distdir-way-opts.mk2
-rw-r--r--rules/haddock.mk2
-rw-r--r--rules/package-config.mk10
-rw-r--r--rules/sdist-ghc-file.mk4
-rw-r--r--testsuite/README.md2
-rw-r--r--testsuite/driver/testlib.py6
-rw-r--r--testsuite/mk/boilerplate.mk24
-rw-r--r--testsuite/tests/codeGen/should_compile/jmp_tbl.hs4
-rw-r--r--testsuite/tests/driver/T12062/T12062.stderr2
-rw-r--r--testsuite/tests/driver/T7130.stderr2
-rw-r--r--testsuite/tests/driver/T7563.stderr2
-rw-r--r--testsuite/tests/driver/T9776.stderr2
-rw-r--r--testsuite/tests/driver/T9963.stderr2
-rw-r--r--testsuite/tests/ghc-e/should_fail/T9930fail.stderr2
-rw-r--r--testsuite/tests/linear/should_compile/Arity2.hs2
-rw-r--r--testsuite/tests/linear/should_compile/Dollar2.hs2
-rw-r--r--testsuite/tests/linear/should_compile/Foldr.hs2
-rw-r--r--testsuite/tests/linear/should_compile/List.hs2
-rw-r--r--testsuite/tests/linear/should_compile/RankN.hs2
-rw-r--r--testsuite/tests/linear/should_compile/TupSection.hs2
-rwxr-xr-xtestsuite/tests/perf/compiler/T12545.measure.sh2
-rw-r--r--testsuite/tests/printer/T13942.hs2
-rw-r--r--testsuite/tests/printer/T14289.hs2
-rw-r--r--testsuite/tests/printer/T14289b.hs2
-rw-r--r--testsuite/tests/printer/T14289c.hs2
-rw-r--r--testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr2
-rw-r--r--testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw322
-rw-r--r--testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw322
-rw-r--r--testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr2
-rw-r--r--testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw322
-rw-r--r--testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw322
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags05.stderr2
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags06.stderr2
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags10.stderr2
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags13.stderr2
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags14.stderr2
-rw-r--r--testsuite/tests/simplCore/should_compile/T10689a.hs2
-rw-r--r--testsuite/tests/simplCore/should_compile/T11562.hs2
-rw-r--r--testsuite/timeout/Makefile2
-rw-r--r--utils/compare_sizes/Main.hs4
-rw-r--r--utils/count-deps/Main.hs2
-rw-r--r--utils/count-deps/README.md4
-rw-r--r--utils/ghc-cabal/Main.hs2
-rw-r--r--utils/ghc-pkg/ghc.mk10
-rw-r--r--utils/hp2ps/ghc.mk2
-rw-r--r--utils/iserv-proxy/ghc.mk66
-rw-r--r--utils/iserv/ghc.mk66
-rw-r--r--utils/remote-iserv/ghc.mk66
-rw-r--r--utils/runghc/Main.hs4
-rw-r--r--utils/runghc/ghc.mk2
-rw-r--r--utils/testremove/ghc.mk4
-rw-r--r--utils/unlit/ghc.mk6
-rwxr-xr-xvalidate4
105 files changed, 455 insertions, 463 deletions
diff --git a/.gitignore b/.gitignore
index f0121e6936..8e7f7c3607 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,7 +54,7 @@ stage2
_build
_validatebuild
*/generated/
-*/ghc-stage1
+*/ghc-stage0
.shake.*
.hadrian_ghci
@@ -81,13 +81,13 @@ _darcs/
/libraries/*/dist-newstyle/
/libraries/dist-haddock/
/utils/*/dist*/
+/compiler/stage0/
/compiler/stage1/
/compiler/stage2/
-/compiler/stage3/
+/ghc/stage0/
/ghc/stage1/
/ghc/stage2/
-/ghc/stage3/
-/utils/iserv/stage2*/
+/utils/iserv/stage1*/
# -----------------------------------------------------------------------------
# specific generated files
@@ -185,7 +185,7 @@ _darcs/
/mk/project.mk
/mk/project.mk.old
/mk/validate.mk
-/stage3.package.conf
+/stage2.package.conf
/testsuite_summary*.txt
/testsuite*.xml
/testlog*
diff --git a/compiler/GHC/Core/Opt/SpecConstr.hs b/compiler/GHC/Core/Opt/SpecConstr.hs
index d714cc0764..490eab28fb 100644
--- a/compiler/GHC/Core/Opt/SpecConstr.hs
+++ b/compiler/GHC/Core/Opt/SpecConstr.hs
@@ -474,7 +474,8 @@ deprecated):
and then add *that* type as a parameter to the loop body
The reason #2 is deprecated is because it requires GHCi, which isn't
-available for things like a cross compiler using stage1.
+available for things like a stage0 compiler without the external
+interpreter.
Here's a (simplified) example from the `vector` package. You may bring
the special 'force specialization' type into scope by saying:
diff --git a/compiler/GHC/Driver/Env.hs b/compiler/GHC/Driver/Env.hs
index 6f23139f26..08e9150b30 100644
--- a/compiler/GHC/Driver/Env.hs
+++ b/compiler/GHC/Driver/Env.hs
@@ -127,9 +127,10 @@ platform (= code build platform).
The internal interpreter can be used when both platforms are the same and when
the built code is compatible with the compiler itself (same way, etc.). This
-interpreter is not always available: for instance stage1 compiler doesn't have
-it because there might be an ABI mismatch between the code objects (built by
-stage1 compiler) and the stage1 compiler itself (built by stage0 compiler).
+interpreter is not always available: for instance the compiler built in stage 0
+doesn't have it because there might be an ABI mismatch between the code objects
+(built in stage 1 by the stage 0 compiler) and the stage 0 compiler itself
+(built in stage 0 by the probuilt bootstrap compiler compiler).
In most cases, an external interpreter can be used instead: it runs in a
separate process and it communicates with the compiler via a two-way message
diff --git a/compiler/GHC/Driver/Pipeline/Execute.hs b/compiler/GHC/Driver/Pipeline/Execute.hs
index 08a63c0125..eeedb9733e 100644
--- a/compiler/GHC/Driver/Pipeline/Execute.hs
+++ b/compiler/GHC/Driver/Pipeline/Execute.hs
@@ -188,7 +188,7 @@ runLlvmLlcPhase pipe_env hsc_env input_fn = do
-- Observed at least with target 'arm-unknown-linux-gnueabihf'.
--
--
- -- With LLVM4, llc -O3 crashes when ghc-stage1 tries to compile
+ -- With LLVM4, llc -O3 crashes when ghc-stage0 tries to compile
-- rts/HeapStackCheck.cmm
--
-- llc -O3 '-mtriple=arm-unknown-linux-gnueabihf' -enable-tbaa /var/folders/fv/xqjrpfj516n5xq_m_ljpsjx00000gn/T/ghc33674_0/ghc_6.bc -o /var/folders/fv/xqjrpfj516n5xq_m_ljpsjx00000gn/T/ghc33674_0/ghc_7.lm_s
diff --git a/compiler/GHC/SysTools/BaseDir.hs b/compiler/GHC/SysTools/BaseDir.hs
index 03169523c6..bffa45dad5 100644
--- a/compiler/GHC/SysTools/BaseDir.hs
+++ b/compiler/GHC/SysTools/BaseDir.hs
@@ -47,7 +47,7 @@ On Windows:
- ghc never has a shell wrapper.
- we can find the location of the ghc binary, which is
$topdir/<foo>/<something>.exe
- where <something> may be "ghc", "ghc-stage2", or similar
+ where <something> may be "ghc", "ghc-stage1", or similar
- we strip off the "<foo>/<something>.exe" to leave $topdir.
from topdir we can find package.conf, ghc-asm, etc.
diff --git a/compiler/GHC/Tc/Gen/Splice.hs b/compiler/GHC/Tc/Gen/Splice.hs
index 13cd3e71c9..cfa954ee03 100644
--- a/compiler/GHC/Tc/Gen/Splice.hs
+++ b/compiler/GHC/Tc/Gen/Splice.hs
@@ -336,7 +336,7 @@ quotationCtxtDoc br_body
2 (ppr br_body)
- -- The whole of the rest of the file is the else-branch (ie stage2 only)
+ -- The whole of the rest of the file is the else-branch (i.e. stage1+ only)
{-
Note [How top-level splices are handled]
diff --git a/compiler/GHC/Utils/Error.hs b/compiler/GHC/Utils/Error.hs
index c2b708b56a..93cc3ff7c4 100644
--- a/compiler/GHC/Utils/Error.hs
+++ b/compiler/GHC/Utils/Error.hs
@@ -533,7 +533,7 @@ To actually produce the eventlog, you need an eventlog-capable GHC build:
$ hadrian/build -j "stage1.ghc-bin.ghc.link.opts += -eventlog"
With Make:
- $ make -j GhcStage2HcOpts+=-eventlog
+ $ make -j GhcStage1HcOpts+=-eventlog
You can then produce an eventlog when compiling say hello.hs by simply
doing:
@@ -542,7 +542,7 @@ doing:
$ _build/stage1/bin/ghc -ddump-timings hello.hs -o hello +RTS -l
If GHC was built with Make:
- $ inplace/bin/ghc-stage2 -ddump-timing hello.hs -o hello +RTS -l
+ $ inplace/bin/ghc-stage1 -ddump-timing hello.hs -o hello +RTS -l
You could alternatively use -v<N> (with N >= 2) instead of -ddump-timings,
to ask GHC to report timings (on stderr and the eventlog).
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index bba143c801..b60ca7166d 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -16,32 +16,23 @@
# The 'echo' commands simply spit the values of various make variables
# into Config.hs, whence they can be compiled and used by GHC itself
-compiler_stage1_C_FILES_NODEPS = compiler/cbits/cutils.c
-
-# We need to decrement the 1-indexed compiler stage to be the 0-indexed stage
-# we use everwhere else.
-dec1 = 0
-dec2 = 1
-dec3 = 2
-# TODO(@Ericson2314) Get rid of compiler-specific stage indices. I think the
-# argument was stage n ghc is used to build stage n everything else, but I
-# don't buy that argument.
+compiler_stage0_C_FILES_NODEPS = compiler/cbits/cutils.c
ifneq "$(BINDIST)" "YES"
-$(foreach n,1 2 3, \
+$(foreach n,0 1 2, \
$(eval compiler/stage$n/package-data.mk : compiler/stage$n/build/GHC/Settings/Config.hs) \
$(eval compiler/stage$n/build/GHC/Platform/Constants.o: compiler/stage$n/build/GHC/Platform/Constants.hs) \
)
endif
-BUILDPLATFORM_1 = $(BUILDPLATFORM)
-BUILDPLATFORM_2 = $(HOSTPLATFORM)
-BUILDPLATFORM_3 = $(TARGETPLATFORM)
+BUILDPLATFORM_0 = $(BUILDPLATFORM)
+BUILDPLATFORM_1 = $(HOSTPLATFORM)
+BUILDPLATFORM_2 = $(TARGETPLATFORM)
-HOSTPLATFORM_1 = $(HOSTPLATFORM)
+HOSTPLATFORM_0 = $(HOSTPLATFORM)
+HOSTPLATFORM_1 = $(TARGETPLATFORM)
HOSTPLATFORM_2 = $(TARGETPLATFORM)
-HOSTPLATFORM_3 = $(TARGETPLATFORM)
define compilerConfig
# $1 = compile stage (1-indexed)
@@ -81,9 +72,9 @@ compiler/stage$1/build/GHC/Platform/Constants.hs : $$(deriveConstants_INPLACE) |
$$< --gen-haskell-type -o $$@
endef
+$(eval $(call compilerConfig,0))
$(eval $(call compilerConfig,1))
$(eval $(call compilerConfig,2))
-$(eval $(call compilerConfig,3))
# ----------------------------------------------------------------------------
# Generate supporting stuff for GHC/Builtin/PrimOps.hs
@@ -106,16 +97,16 @@ PRIMOP_BITS_NAMES = primop-data-decl.hs-incl \
primop-vector-tycons.hs-incl \
primop-docs.hs-incl
+PRIMOP_BITS_STAGE0 = $(addprefix compiler/stage0/build/,$(PRIMOP_BITS_NAMES))
PRIMOP_BITS_STAGE1 = $(addprefix compiler/stage1/build/,$(PRIMOP_BITS_NAMES))
PRIMOP_BITS_STAGE2 = $(addprefix compiler/stage2/build/,$(PRIMOP_BITS_NAMES))
-PRIMOP_BITS_STAGE3 = $(addprefix compiler/stage3/build/,$(PRIMOP_BITS_NAMES))
define preprocessCompilerFiles
# $1 = compiler stage (build system stage + 1)
compiler/stage$1/build/primops.txt: \
compiler/GHC/Builtin/primops.txt.pp \
- $(includes_$(dec$1)_H_CONFIG) \
- $(includes_$(dec$1)_H_PLATFORM)
+ $$(includes_$1_H_CONFIG) \
+ $$(includes_$1_H_PLATFORM)
$$(HS_CPP) -P $$(compiler_CPP_OPTS) \
-Icompiler/stage$1 \
-x c $$< | grep -v '^#pragma GCC' > $$@
@@ -160,16 +151,15 @@ compiler/stage$1/build/primop-usage.hs-incl: compiler/stage$1/build/primops.txt
endef
+$(eval $(call preprocessCompilerFiles,0))
$(eval $(call preprocessCompilerFiles,1))
$(eval $(call preprocessCompilerFiles,2))
-$(eval $(call preprocessCompilerFiles,3))
# -----------------------------------------------------------------------------
# Configuration
ifeq "$(GhcWithInterpreter)" "YES"
-compiler_stage2_CONFIGURE_OPTS += --flags=internal-interpreter
-
+compiler_stage1_CONFIGURE_OPTS += --flags=internal-interpreter
endif
ifeq "$(TargetOS_CPP)" "openbsd"
@@ -177,7 +167,7 @@ compiler_CONFIGURE_OPTS += --ld-options=-E
endif
ifeq "$(WITH_TERMINFO)" "NO"
-compiler_stage2_CONFIGURE_OPTS += --flags=-terminfo
+compiler_stage1_CONFIGURE_OPTS += --flags=-terminfo
endif
# Careful optimisation of the parser: we don't want to throw everything
@@ -189,9 +179,9 @@ endif
# register allocator running out of stack slots when compiling this
# module with -fPIC -dynamic.
# See #8182 for all the details
+compiler/stage0/build/Parser_HC_OPTS += -O0 -fno-ignore-interface-pragmas -fcmm-sink
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
@@ -212,15 +202,15 @@ compiler/GHC_HC_OPTS += -fprof-auto
# doesn't copy the vanilla .hi files, but ghc-pkg complains about
# their absence when we register the package. So for now, we just
# leave the vanilla libraries enabled.
-# compiler_stage2_CONFIGURE_OPTS += --disable-library-vanilla
-compiler_stage2_CONFIGURE_OPTS += --ghc-pkg-option=--force
+# compiler_stage1_CONFIGURE_OPTS += --disable-library-vanilla
+compiler_stage1_CONFIGURE_OPTS += --ghc-pkg-option=--force
endif
-compiler_stage3_CONFIGURE_OPTS := $(compiler_stage2_CONFIGURE_OPTS)
+compiler_stage2_CONFIGURE_OPTS := $(compiler_stage1_CONFIGURE_OPTS)
+compiler/stage0/package-data.mk : compiler/ghc.mk
compiler/stage1/package-data.mk : compiler/ghc.mk
compiler/stage2/package-data.mk : compiler/ghc.mk
-compiler/stage3/package-data.mk : compiler/ghc.mk
# -----------------------------------------------------------------------------
# And build the package
@@ -229,26 +219,26 @@ compiler_PACKAGE = ghc
# Don't do splitting for the GHC package, it takes too long and
# there's not much benefit.
+compiler_stage0_SplitSections = NO
compiler_stage1_SplitSections = NO
compiler_stage2_SplitSections = NO
-compiler_stage3_SplitSections = NO
+# if stage is set to something other than "0" or "", disable stage 0
+# See Note [Stage0Only vs stage=0] in mk/config.mk.in.
+ifneq "$(filter-out 0,$(stage))" ""
+compiler_stage0_NOT_NEEDED = YES
+endif
# 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
-# if stage is set to something other than "2" or "", disable stage 2
-ifneq "$(filter-out 2,$(stage))" ""
+# stage 2 has to be requested explicitly with stage=2
+ifneq "$(stage)" "2"
compiler_stage2_NOT_NEEDED = YES
endif
-# stage 3 has to be requested explicitly with stage=3
-ifneq "$(stage)" "3"
-compiler_stage3_NOT_NEEDED = YES
-endif
-$(eval $(call build-package,compiler,stage1,0))
-$(eval $(call build-package,compiler,stage2,1))
-$(eval $(call build-package,compiler,stage3,2))
+$(eval $(call build-package,compiler,stage0,0))
+$(eval $(call build-package,compiler,stage1,1))
+$(eval $(call build-package,compiler,stage2,2))
# We only want to turn keepCAFs on if we will be loading dynamic
# Haskell libraries with GHCi. We therefore filter the object file
@@ -260,9 +250,9 @@ 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_stage0_WAYS),$(eval $(call keepCAFsForGHCiDynOnly,0,$w)))
$(foreach w,$(compiler_stage1_WAYS),$(eval $(call keepCAFsForGHCiDynOnly,1,$w)))
$(foreach w,$(compiler_stage2_WAYS),$(eval $(call keepCAFsForGHCiDynOnly,2,$w)))
-$(foreach w,$(compiler_stage3_WAYS),$(eval $(call keepCAFsForGHCiDynOnly,3,$w)))
# after build-package, because that adds --enable-library-for-ghci
# to compiler_stage*_CONFIGURE_OPTS:
@@ -270,33 +260,33 @@ $(foreach w,$(compiler_stage3_WAYS),$(eval $(call keepCAFsForGHCiDynOnly,3,$w)))
# the .a file instead, and as object splitting isn't on for the ghc
# package this isn't much slower.However, not building the package saves
# a significant chunk of disk space.
+compiler_stage0_CONFIGURE_OPTS += --disable-library-for-ghci
compiler_stage1_CONFIGURE_OPTS += --disable-library-for-ghci
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:
+# after build-package, because that sets compiler_stage0_HC_OPTS:
ifeq "$(V)" "0"
+compiler_stage0_HC_OPTS += $(filter-out -Rghc-timing,$(GhcHcOpts)) $(GhcStage0HcOpts)
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_stage0_HC_OPTS += $(GhcHcOpts) $(GhcStage0HcOpts)
compiler_stage1_HC_OPTS += $(GhcHcOpts) $(GhcStage1HcOpts)
compiler_stage2_HC_OPTS += $(GhcHcOpts) $(GhcStage2HcOpts)
-compiler_stage3_HC_OPTS += $(GhcHcOpts) $(GhcStage3HcOpts)
endif
ifneq "$(BINDIST)" "YES"
+$(compiler_stage0_depfile_haskell) : $(COMPILER_INCLUDES_DEPS) $(PRIMOP_BITS_STAGE0)
$(compiler_stage1_depfile_haskell) : $(COMPILER_INCLUDES_DEPS) $(PRIMOP_BITS_STAGE1)
$(compiler_stage2_depfile_haskell) : $(COMPILER_INCLUDES_DEPS) $(PRIMOP_BITS_STAGE2)
-$(compiler_stage3_depfile_haskell) : $(COMPILER_INCLUDES_DEPS) $(PRIMOP_BITS_STAGE3)
+$(foreach way,$(compiler_stage0_WAYS),\
+ compiler/stage0/build/PrimOp.$($(way)_osuf)) : $(PRIMOP_BITS_STAGE0)
$(foreach way,$(compiler_stage1_WAYS),\
compiler/stage1/build/PrimOp.$($(way)_osuf)) : $(PRIMOP_BITS_STAGE1)
$(foreach way,$(compiler_stage2_WAYS),\
compiler/stage2/build/PrimOp.$($(way)_osuf)) : $(PRIMOP_BITS_STAGE2)
-$(foreach way,$(compiler_stage3_WAYS),\
- compiler/stage3/build/PrimOp.$($(way)_osuf)) : $(PRIMOP_BITS_STAGE3)
endif
diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
index 533be9dfac..5e086ec4a9 100644
--- a/distrib/configure.ac.in
+++ b/distrib/configure.ac.in
@@ -48,7 +48,7 @@ FPTOOLS_SET_PLATFORMS_VARS
# Requires FPTOOLS_SET_PLATFORMS_VARS to be run first.
FP_FIND_ROOT
-# ToDo: if Stage1Only=YES, should be YES
+# ToDo: if Stage0Only=YES, should be YES
CrossCompiling=NO
CrossCompilePrefix="@CrossCompilePrefix@"
TargetPlatformFull="${target}"
diff --git a/distrib/cross-port b/distrib/cross-port
index 29dd804e82..815eaeac0c 100644
--- a/distrib/cross-port
+++ b/distrib/cross-port
@@ -55,7 +55,7 @@ if [ ! -f b2-stamp ]; then
cd ..
cd b2
- ./configure --with-ghc=$base/b1/ghc/compiler/stage1/ghc-inplace
+ ./configure --with-ghc=$base/b1/ghc/compiler/stage0/ghc-inplace
touch mk/build.mk
# The bootstrapped compiler should probably generate unregisterised
diff --git a/distrib/hc-build b/distrib/hc-build
index ad39854d9e..e6dfe8abef 100644
--- a/distrib/hc-build
+++ b/distrib/hc-build
@@ -105,7 +105,7 @@ $MAKE -C libraries boot all
# The reconfigure step updates a few files, which can lead to
# unnecessary recompilations. Touch a bunch of things here to avoid
# having to recompile stuff that we've already built.
-(cd compiler; touch main/Config.hs $PRIMOP_BITS stage1/*/*.o stage1/ghc-* ghc-*)
+(cd compiler; touch main/Config.hs $PRIMOP_BITS stage0/*/*.o stage0/ghc-* ghc-*)
echo hc-build done
echo The tree should be safe to do 'make install stage=1' in.
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst
index ce6f22e95a..f9f7449e4e 100644
--- a/docs/users_guide/using.rst
+++ b/docs/users_guide/using.rst
@@ -475,7 +475,7 @@ The available mode flags are:
Print ``True`` if GHC was built with ``-DDebug`` flag.
This enables assertions and extra debug code.
- The flag can be set in ``GhcStage1HcOpts`` and/or ``GhcStage2HcOpts``
+ The flag can be set in ``GhcStage0HcOpts`` and/or ``GhcStage1HcOpts``
and is automatically set for ``devel1`` and ``devel2`` build flavors.
.. ghc-flag:: --print-global-package-db
diff --git a/driver/ghci/ghci.c b/driver/ghci/ghci.c
index a603655ec8..79b2696f47 100644
--- a/driver/ghci/ghci.c
+++ b/driver/ghci/ghci.c
@@ -37,10 +37,10 @@ int main(int argc, char** argv) {
preArgv[0] = "--interactive";
/* If ghc.exe can't be found, we assume that we're building ghc from
- * source, in which case we fall back on ghc-stage2.
+ * source, in which case we fall back on ghc-stage1.
*/
if (!fileExists(exePath)) {
- exePath = mkString("%s/ghc-stage2.exe", binDir);
+ exePath = mkString("%s/ghc-stage1.exe", binDir);
}
run(exePath, 1, preArgv, argc - 1, argv + 1, ReleaseResource);
diff --git a/ghc.mk b/ghc.mk
index 3e561a61dd..32a6974c8a 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -201,10 +201,10 @@ endif
endif
ifeq "$(HADDOCK_DOCS)" "YES"
-ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
-$(error Can not build haddock docs when CrossCompiling or Stage1Only. \
+ifneq "$(CrossCompiling) $(Stage0Only)" "NO NO"
+$(error Can not build haddock docs when CrossCompiling or Stage0Only. \
Set HADDOCK_DOCS=NO in your mk/build.mk file. \
- See Note [No stage2 packages when CrossCompiling or Stage1Only])
+ See Note [No stage2 packages when CrossCompiling or Stage0Only])
endif
endif
@@ -487,9 +487,9 @@ PACKAGES_STAGE1 += haskeline
PACKAGES_STAGE1 += ghci
PACKAGES_STAGE1 += libiserv
-# See Note [No stage2 packages when CrossCompiling or Stage1Only].
-# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
-ifeq "$(CrossCompiling) $(Stage1Only)" "NO NO"
+# See Note [No stage2 packages when CrossCompiling or Stage0Only].
+# See Note [Stage0Only vs stage=0] in mk/config.mk.in.
+ifeq "$(CrossCompiling) $(Stage0Only)" "NO NO"
define addExtraPackage
ifeq "$2" "-"
# Do nothing; this package is already handled above
@@ -506,8 +506,8 @@ endif
# We install all packages that we build.
INSTALL_PACKAGES := $(addprefix libraries/,$(PACKAGES_STAGE1))
-# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
-ifneq "$(Stage1Only)" "YES"
+# See Note [Stage0Only vs stage=0] in mk/config.mk.in.
+ifneq "$(Stage0Only)" "YES"
INSTALL_PACKAGES += compiler
endif
INSTALL_PACKAGES += $(addprefix libraries/,$(PACKAGES_STAGE2))
@@ -545,31 +545,31 @@ utils/ghc-pkg/dist-install/package-data.mk: $(fixed_pkg_prev)
utils/hsc2hs/dist-install/package-data.mk: $(fixed_pkg_prev)
utils/compare_sizes/dist-install/package-data.mk: $(fixed_pkg_prev)
utils/runghc/dist-install/package-data.mk: $(fixed_pkg_prev)
-utils/iserv/stage2/package-data.mk: $(fixed_pkg_prev)
-utils/iserv/stage2_p/package-data.mk: $(fixed_pkg_prev)
-utils/iserv/stage2_dyn/package-data.mk: $(fixed_pkg_prev)
+utils/iserv/stage1/package-data.mk: $(fixed_pkg_prev)
+utils/iserv/stage1_p/package-data.mk: $(fixed_pkg_prev)
+utils/iserv/stage1_dyn/package-data.mk: $(fixed_pkg_prev)
ifeq "$(Windows_Host)" "YES"
utils/gen-dll/dist-install/package-data.mk: $(fixed_pkg_prev)
endif
# the GHC package doesn't live in libraries/, so we add its dependency manually:
-compiler/stage2/package-data.mk: $(fixed_pkg_prev)
+compiler/stage1/package-data.mk: $(fixed_pkg_prev)
# and continue with PACKAGES_STAGE2, which depend on GHC:
-fixed_pkg_prev:=compiler/stage2/package-data.mk
+fixed_pkg_prev:=compiler/stage1/package-data.mk
$(foreach pkg,$(PACKAGES_STAGE2),$(eval $(call fixed_pkg_dep,$(pkg),dist-install)))
+ghc/stage0/package-data.mk: compiler/stage0/package-data.mk
ghc/stage1/package-data.mk: compiler/stage1/package-data.mk
-ghc/stage2/package-data.mk: compiler/stage2/package-data.mk
# Utils that we build with the stage2 compiler.
# They depend on the ghc library and some other libraries, but depending on
# the ghc library's package-data.mk is sufficient, as that in turn depends on
# all the other libraries' package-data.mk files.
-utils/haddock/dist/package-data.mk: compiler/stage2/package-data.mk
-utils/check-ppr/dist-install/package-data.mk: compiler/stage2/package-data.mk
-utils/check-exact/dist-install/package-data.mk: compiler/stage2/package-data.mk
-utils/count-deps/dist-install/package-data.mk: compiler/stage2/package-data.mk
+utils/haddock/dist/package-data.mk: compiler/stage1/package-data.mk
+utils/check-ppr/dist-install/package-data.mk: compiler/stage1/package-data.mk
+utils/check-exact/dist-install/package-data.mk: compiler/stage1/package-data.mk
+utils/count-deps/dist-install/package-data.mk: compiler/stage1/package-data.mk
# add the final package.conf dependency: ghc-prim depends on RTS
libraries/ghc-prim/dist-install/package-data.mk : rts/dist-install/package.conf.inplace
@@ -581,7 +581,7 @@ endif
# Run Haddock for the packages that will be installed. We need to handle
# compiler specially due to the different dist directory name.
$(foreach p,$(INSTALL_PACKAGES),$(eval $p_dist-install_DO_HADDOCK = YES))
-compiler_stage2_DO_HADDOCK = YES
+compiler_stage1_DO_HADDOCK = YES
BOOT_PKG_CONSTRAINTS := \
$(foreach d,$(PACKAGES_STAGE0),\
@@ -613,7 +613,7 @@ define libraries/ghc-prim_PACKAGE_MAGIC
libraries/ghc-prim_dist-install_MODULES := $$(filter-out GHC.Prim,$$(libraries/ghc-prim_dist-install_MODULES))
endef
-PRIMOPS_TXT_STAGE1 = compiler/stage1/build/primops.txt
+PRIMOPS_TXT_STAGE1 = compiler/stage0/build/primops.txt
libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs : $$(genprimopcode_INPLACE) $(PRIMOPS_TXT_STAGE1) | $$(dir $$@)/.
"$(genprimopcode_INPLACE)" --make-haskell-wrappers < $(PRIMOPS_TXT_STAGE1) >$@
@@ -706,9 +706,9 @@ ifeq "$(GhcWithInterpreter)" "NO"
# runghc is just GHCi in disguise
BUILD_DIRS := $(filter-out utils/runghc,$(BUILD_DIRS))
endif
-ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
-# See Note [No stage2 packages when CrossCompiling or Stage1Only].
-# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
+ifneq "$(CrossCompiling) $(Stage0Only)" "NO NO"
+# See Note [No stage2 packages when CrossCompiling or Stage0Only].
+# See Note [Stage0Only vs stage=0] in mk/config.mk.in.
BUILD_DIRS := $(filter-out utils/check-ppr,$(BUILD_DIRS))
BUILD_DIRS := $(filter-out utils/check-exact,$(BUILD_DIRS))
BUILD_DIRS := $(filter-out utils/count-deps,$(BUILD_DIRS))
@@ -768,21 +768,21 @@ $(foreach pkg,$(PACKAGES_STAGE0),$(eval $(call fixed_pkg_dep,$(pkg),dist-boot)))
# dependency between their package-data.mk files. See also Note
# [Dependencies between package-data.mk files].
utils/ghc-pkg/dist/package-data.mk: $(fixed_pkg_prev)
-compiler/stage1/package-data.mk: $(fixed_pkg_prev)
+compiler/stage0/package-data.mk: $(fixed_pkg_prev)
endif
ifneq "$(BINDIST)" "YES"
# Make sure we have all the GHCi libs by the time we've built
-# ghc-stage2.
+# ghc-stage1.
#
GHCI_LIBS = \
$(foreach way,$(GhcLibWays),\
$(foreach lib,$(PACKAGES_STAGE1),\
$(libraries/$(lib)_dist-install_$(way)_GHCI_LIB)) \
- $(compiler_stage2_$(way)_GHCI_LIB))
+ $(compiler_stage1_$(way)_GHCI_LIB))
ifeq "$(UseArchivesForGhci)" "NO"
-ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(GHCI_LIBS)
+ghc/stage1/build/tmp/$(ghc_stage1_PROG) : $(GHCI_LIBS)
endif
ifeq "$(UseArchivesForGhci)" "YES"
@@ -897,15 +897,15 @@ endif
install_libs: $(INSTALL_LIBS)
$(call installLibsTo, $(INSTALL_LIBS), "$(DESTDIR)$(ghclibdir)")
-# We rename ghc-stage2, so that the right program name is used in error
+# We rename ghc-stage1, so that the right program name is used in error
# messages etc. But not on windows.
RENAME_LIBEXEC_GHC_STAGE_TO_GHC = YES
-ifeq "$(Stage1Only) $(Windows_Host)" "YES YES"
-# resulting ghc-stage1 is built to run on windows
+ifeq "$(Stage0Only) $(Windows_Host)" "YES YES"
+# resulting ghc-stage0 is built to run on windows
RENAME_LIBEXEC_GHC_STAGE_TO_GHC = NO
endif
-ifeq "$(Stage1Only) $(Windows_Target)" "NO YES"
-# resulting ghc-stage1 is built to run on windows
+ifeq "$(Stage0Only) $(Windows_Target)" "NO YES"
+# resulting ghc-stage0 is built to run on windows
RENAME_LIBEXEC_GHC_STAGE_TO_GHC = NO
endif
@@ -959,9 +959,9 @@ endif
INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
ifeq "$(BINDIST) $(CrossCompiling)" "NO YES"
-# when installing ghc-stage2 we can't run target's
-# 'ghc-pkg' and 'ghc-stage2' but those are needed for registration.
-INSTALLED_GHC_REAL=$(TOP)/inplace/bin/ghc-stage1
+# when installing ghc-stage1 we can't run target's
+# 'ghc-pkg' and 'ghc-stage1' but those are needed for registration.
+INSTALLED_GHC_REAL=$(TOP)/inplace/bin/ghc-stage0
INSTALLED_GHC_PKG_REAL=$(TOP)/$(ghc-pkg_DIST_BINARY)
else # CrossCompiling
# Install packages in the right order, so that ghc-pkg doesn't complain.
@@ -1057,7 +1057,7 @@ $(eval $(call bindist-list,.,\
$(INSTALL_LIBRARY_DOCS) \
$(addsuffix /*,$(INSTALL_HTML_DOC_DIRS)) \
docs/index.html \
- $(wildcard compiler/stage2/doc) \
+ $(wildcard compiler/stage1/doc) \
$(wildcard libraries/*/dist-install/doc/) \
$(wildcard libraries/*/*/dist-install/doc/) \
$(filter-out llvm-targets llvm-passes $(includes_SETTINGS),$(INSTALL_LIBS)) \
@@ -1084,7 +1084,7 @@ BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
# distribution so we know during `make install` not to go looking for files that
# would have been built for these packages. Failing to do this causes #13325.
#
-# See Note [No stage2 packages when CrossCompiling or Stage1Only].
+# See Note [No stage2 packages when CrossCompiling or Stage0Only].
unix-binary-dist-prep: $(includes_dist-install_H_FILES_GENERATED)
$(call removeTrees,bindistprep/)
@@ -1235,10 +1235,10 @@ sdist-ghc-prep-tree :
# Add files generated by alex and happy.
# These rules depend on sdist-ghc-prep-tree.
-$(eval $(call sdist-ghc-file,compiler,stage2,.,GHC/Cmm/Lexer,x))
-$(eval $(call sdist-ghc-file,compiler,stage2,.,GHC/Cmm/Parser,y))
-$(eval $(call sdist-ghc-file,compiler,stage2,.,GHC/Parser/Lexer,x))
-$(eval $(call sdist-ghc-file,compiler,stage2,.,GHC/Parser,y))
+$(eval $(call sdist-ghc-file,compiler,stage1,.,GHC/Cmm/Lexer,x))
+$(eval $(call sdist-ghc-file,compiler,stage1,.,GHC/Cmm/Parser,y))
+$(eval $(call sdist-ghc-file,compiler,stage1,.,GHC/Parser/Lexer,x))
+$(eval $(call sdist-ghc-file,compiler,stage1,.,GHC/Parser,y))
$(eval $(call sdist-ghc-file,utils/hpc,dist-install,,HpcParser,y))
$(eval $(call sdist-ghc-file,utils/genprimopcode,dist,,Lexer,x))
$(eval $(call sdist-ghc-file,utils/genprimopcode,dist,,Parser,y))
@@ -1495,29 +1495,30 @@ endif
cd libraries/xhtml && ./Setup clean --builddir=dist-bindist
cd libraries/xhtml && rm -f Setup Setup.exe Setup.hi Setup.o
-# Note [No stage2 packages when CrossCompiling or Stage1Only]
+# Note [No stage2 packages when CrossCompiling or Stage0Only]
#
-# (first read Note [CrossCompiling vs Stage1Only] and
-# Note [Stage1Only vs stage=1] in mk/config.mk.in)
+# (first read Note [CrossCompiling vs Stage0Only] and
+# Note [Stage0Only vs stage=0] in mk/config.mk.in)
#
-# When either CrossCompiling=YES or Stage1Only=YES, we have to exclude the
+# When either CrossCompiling=YES or Stage0Only=YES, we have to exclude the
# following packages from the build:
-# * packages that we build with ghc-stage2 [1]
+# * packages that we build with ghc-stage1 [1]
# * packages that depend on the ghc library [2]
#
# Here's why:
-# - first of all, ghc-stage1 can't use stage0's ghc library (it's too old)
-# - neither do we register the ghc library (compiler/stage1) that we build
+# - first of all, ghc-stage0 can't use the ghc library that comes with the GHC
+# used to build stage0 (it's too old).
+# - neither do we register the ghc library (compiler/stage0) that we build
# with stage0. TODO Why not? We do build it...
-# - as a result, we need to a) use ghc-stage2 to build packages that depend on
-# the ghc library and b) exclude those packages when ghc-stage2 is not
+# - as a result, we need to a) use ghc-stage1 to build packages that depend on
+# the ghc library and b) exclude those packages when ghc-stage1 is not
# available.
-# - when Stage1Only=YES, it's clear that ghc-stage2 is not available (we just
+# - when Stage0Only=YES, it's clear that ghc-stage1 is not available (we just
# said we didn't want it), so we have to exclude the stage2 packages from
-# the build. This includes the case where Stage1Only=YES is combined with
+# the build. This includes the case where Stage0Only=YES is combined with
# CrossCompiling=YES (Building GHC as a cross-compiler [3]).
-# - when CrossCompiling=YES, but Stage1Only=NO (Cross-compiling GHC itself
-# [3]), we can not use ghc-stage2 either. The reason is that stage2 doesn't
+# - when CrossCompiling=YES, but Stage0Only=NO (Cross-compiling GHC itself
+# [3]), we can not use ghc-stage1 either. The reason is that stage2 doesn't
# run on the host platform at all; it is built to run on $(TARGETPLATFORM)"
# [4]. Therefore in this case we also have to exclude the stage2 packages
# from the build.
diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index fcfb61f65a..1d73694d6e 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -14,13 +14,9 @@ ghc_USES_CABAL = YES
ghc_PACKAGE = ghc-bin
ghc_EXECUTABLE = ghc
-ghc_stage1_CONFIGURE_OPTS += --flags=stage1
-ghc_stage2_CONFIGURE_OPTS += --flags=stage2
-ghc_stage3_CONFIGURE_OPTS += --flags=stage3
-
ifeq "$(GhcWithInterpreter)" "YES"
+ghc_stage1_CONFIGURE_OPTS += --flags=internal-interpreter
ghc_stage2_CONFIGURE_OPTS += --flags=internal-interpreter
-ghc_stage3_CONFIGURE_OPTS += --flags=internal-interpreter
endif
# This package doesn't pass the Cabal checks because data-dir
@@ -28,20 +24,20 @@ endif
# we just skip the check.
ghc_NO_CHECK = YES
+ghc_stage0_MORE_HC_OPTS = $(GhcStage0HcOpts)
ghc_stage1_MORE_HC_OPTS = $(GhcStage1HcOpts)
ghc_stage2_MORE_HC_OPTS = $(GhcStage2HcOpts)
-ghc_stage3_MORE_HC_OPTS = $(GhcStage3HcOpts)
# We need __GLASGOW_HASKELL__ in hschooks.c, so we have to build C
# sources with GHC:
+ghc_stage0_UseGhcForCC = YES
ghc_stage1_UseGhcForCC = YES
ghc_stage2_UseGhcForCC = YES
-ghc_stage3_UseGhcForCC = YES
ifeq "$(GhcDebugged)" "YES"
+ghc_stage0_MORE_HC_OPTS += -debug
ghc_stage1_MORE_HC_OPTS += -debug
ghc_stage2_MORE_HC_OPTS += -debug
-ghc_stage3_MORE_HC_OPTS += -debug
endif
ifneq "$(GhcDynamic)" ""
@@ -50,83 +46,83 @@ endif
ifeq "$(GhcThreaded)" "YES"
# Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
+ghc_stage1_MORE_HC_OPTS += -threaded
ghc_stage2_MORE_HC_OPTS += -threaded
-ghc_stage3_MORE_HC_OPTS += -threaded
else
# Opt out from threaded GHC. See ghc-bin.cabal.in
+ghc_stage1_CONFIGURE_OPTS += -f-threaded
ghc_stage2_CONFIGURE_OPTS += -f-threaded
-ghc_stage3_CONFIGURE_OPTS += -f-threaded
endif
# If stage 0 supplies a threaded RTS, we can use it for stage 1.
# See Note [Linking ghc-bin against threaded stage0 RTS] in
# hadrian/src/Settings/Packages.hs for details.
ifeq "$(GhcThreadedRts)" "YES"
-ghc_stage1_MORE_HC_OPTS += -threaded
+ghc_stage0_MORE_HC_OPTS += -threaded
else
-ghc_stage1_CONFIGURE_OPTS += -f-threaded
+ghc_stage0_CONFIGURE_OPTS += -f-threaded
endif
ifeq "$(GhcProfiled)" "YES"
-ghc_stage2_PROGRAM_WAY = p
+ghc_stage1_PROGRAM_WAY = p
endif
+ghc_stage0_PROGNAME = ghc-stage0
ghc_stage1_PROGNAME = ghc-stage1
ghc_stage2_PROGNAME = ghc-stage2
-ghc_stage3_PROGNAME = ghc-stage3
+ghc_stage0_SHELL_WRAPPER = YES
ghc_stage1_SHELL_WRAPPER = YES
ghc_stage2_SHELL_WRAPPER = YES
-ghc_stage3_SHELL_WRAPPER = YES
+ghc_stage0_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage1_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage2_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
-ghc_stage3_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
+ghc_stage0_INSTALL_INPLACE = YES
ghc_stage1_INSTALL_INPLACE = YES
ghc_stage2_INSTALL_INPLACE = YES
-ghc_stage3_INSTALL_INPLACE = YES
ghc_stage$(INSTALL_GHC_STAGE)_INSTALL = YES
ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_NAME = ghc-$(ProjectVersion)
-# We override the program name to be ghc, rather than ghc-stage2.
+# We override the program name to be ghc, rather than ghc-stage1.
# This means the right program name is used in error messages etc.
define ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_EXTRA
echo 'executablename="$$exedir/ghc"' >> "$(WRAPPER)"
endef
+# if stage is set to something other than "0" or "", disable stage 0
+# See Note [Stage0Only vs stage=0] in mk/config.mk.in.
+ifneq "$(filter-out 0,$(stage))" ""
+ghc_stage0_NOT_NEEDED = YES
+endif
# 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))" ""
ghc_stage1_NOT_NEEDED = YES
endif
-# if stage is set to something other than "2" or "", disable stage 2
-ifneq "$(filter-out 2,$(stage))" ""
-ghc_stage2_NOT_NEEDED = YES
-endif
# When cross-compiling, the stage 1 compiler is our release compiler, so omit stage 2
-# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
-ifeq "$(Stage1Only)" "YES"
-ghc_stage2_NOT_NEEDED = YES
+# See Note [Stage0Only vs stage=0] in mk/config.mk.in.
+ifeq "$(Stage0Only)" "YES"
+ghc_stage1_NOT_NEEDED = YES
endif
-# stage 3 has to be requested explicitly with stage=3
-ifneq "$(stage)" "3"
-ghc_stage3_NOT_NEEDED = YES
+# stage 2 has to be requested explicitly with stage=2
+ifneq "$(stage)" "2"
+ghc_stage2_NOT_NEEDED = YES
endif
-$(eval $(call build-prog,ghc,stage1,0))
-$(eval $(call build-prog,ghc,stage2,1))
-$(eval $(call build-prog,ghc,stage3,2))
+$(eval $(call build-prog,ghc,stage0,0))
+$(eval $(call build-prog,ghc,stage1,1))
+$(eval $(call build-prog,ghc,stage2,2))
ifneq "$(BINDIST)" "YES"
-ghc/stage1/build/tmp/$(ghc_stage1_PROG) : $(BOOT_LIBS)
+ghc/stage0/build/tmp/$(ghc_stage0_PROG) : $(BOOT_LIBS)
ifeq "$(GhcProfiled)" "YES"
-ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(compiler_stage2_p_LIB)
-ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(foreach lib,$(PACKAGES_STAGE1),$(libraries/$(lib)_dist-install_p_LIB))
+ghc/stage1/build/tmp/$(ghc_stage1_PROG) : $(compiler_stage1_p_LIB)
+ghc/stage1/build/tmp/$(ghc_stage1_PROG) : $(foreach lib,$(PACKAGES_STAGE1),$(libraries/$(lib)_dist-install_p_LIB))
endif
-all_ghc_stage1 : $(GHC_STAGE1)
-all_ghc_stage2 : $(GHC_STAGE2)
-all_ghc_stage3 : $(GHC_STAGE3)
+all_ghc_stage0 : $(ghc-stage0_INPLACE)
+all_ghc_stage1 : $(ghc-stage1_INPLACE)
+all_ghc_stage2 : $(ghc-stage2_INPLACE)
$(INPLACE_LIB)/settings : $(includes_SETTINGS)
"$(CP)" $< $@
@@ -145,21 +141,21 @@ GHC_DEPENDENCIES += $(INPLACE_LIB)/settings
GHC_DEPENDENCIES += $(INPLACE_LIB)/llvm-targets
GHC_DEPENDENCIES += $(INPLACE_LIB)/llvm-passes
-$(GHC_STAGE1) : | $(GHC_DEPENDENCIES)
-$(GHC_STAGE2) : | $(GHC_DEPENDENCIES)
-$(GHC_STAGE3) : | $(GHC_DEPENDENCIES)
+$(HC_STAGE1) : | $(GHC_DEPENDENCIES)
+$(HC_STAGE2) : | $(GHC_DEPENDENCIES)
+$(HC_STAGE3) : | $(GHC_DEPENDENCIES)
ifeq "$(Windows_Host)" "YES"
-$(GHC_STAGE1) : | $$(touchy_INPLACE)
-$(GHC_STAGE2) : | $$(touchy_INPLACE)
-$(GHC_STAGE3) : | $$(touchy_INPLACE)
+$(HC_STAGE1) : | $$(touchy_INPLACE)
+$(HC_STAGE2) : | $$(touchy_INPLACE)
+$(HC_STAGE3) : | $$(touchy_INPLACE)
endif
# Modules like vector:Data.Vector.Fusion.Stream.Monadic use annotations,
# which means they depend on GHC.Desugar. To ensure that This module is
# available by the time it is needed, we make the stage 2 compiler
# depend on it.
-$(GHC_STAGE2) : $(foreach w,$(GhcLibWays),libraries/base/dist-install/build/GHC/Desugar.$($w_osuf))
+$(HC_STAGE2) : $(foreach w,$(GhcLibWays),libraries/base/dist-install/build/GHC/Desugar.$($w_osuf))
endif
diff --git a/hadrian/doc/cross-compile.md b/hadrian/doc/cross-compile.md
index 6bd4fe8ef8..b479ecf8c9 100644
--- a/hadrian/doc/cross-compile.md
+++ b/hadrian/doc/cross-compile.md
@@ -18,7 +18,7 @@ After all the dependencies are in place:
- `cd hadrian`
- Build the compiler by e.g. `./build.sh --flavour=quickest --integer-simple -V -j`
-After that, you should have built `inplace/bin/ghc-stage1` cross compiler. We will go to the next section to validate this.
+After that, you should have built `inplace/bin/ghc-stage0` cross compiler. We will go to the next section to validate this.
**NOTE**: Use of `-c` to configure the target is currently not supported. Please manually run `./configure` like above.
@@ -30,7 +30,7 @@ Write a simple hello world haskell program:
module Main where
main = putStrLn "Hello, world!"
```
-Compile it with cross-compiling GHC: `<ghc-folder>/inplace/bin/ghc-stage1 -static Main`. Note that we created a static version of it which packs together all depending libraries.
+Compile it with cross-compiling GHC: `<ghc-folder>/inplace/bin/ghc-stage0 -static Main`. Note that we created a static version of it which packs together all depending libraries.
- Install QEMU: `sudo apt-get install qemu-system-arm`
- Download `vmlinuz` (kernel) and `initrd.gz` (initial ramdisk), e.g. from [this mirror](https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/dists/xenial/main/installer-armhf/current/images/generic-lpae/cdrom/).
diff --git a/hadrian/doc/make.md b/hadrian/doc/make.md
index 6d20d42503..b5b27ade9d 100644
--- a/hadrian/doc/make.md
+++ b/hadrian/doc/make.md
@@ -60,8 +60,8 @@ time you fire up a build. This is not possible with the Make build system.
``` sh
# Make
+ make inplace/bin/ghc-stage0
make inplace/bin/ghc-stage1
- make inplace/bin/ghc-stage2
# Hadrian
build stage1:exe:ghc-bin # using the simple target name
diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs
index 1a7fbbe5cd..b2bda67cc6 100644
--- a/hadrian/src/Packages.hs
+++ b/hadrian/src/Packages.hs
@@ -130,7 +130,7 @@ setPath pkg path = pkg { pkgPath = path }
-- | Given a 'Context', compute the name of the program that is built in it
-- assuming that the corresponding package's type is 'Program'. For example, GHC
--- built in 'Stage0' is called @ghc-stage1@. If the given package is a
+-- built in 'Stage0' is called @ghc-stage0@. If the given package is a
-- 'Library', the function simply returns its name.
programName :: Context -> Action String
programName Context {..} = do
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index eb7a780d97..725b00938c 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -173,9 +173,9 @@ generateRules :: Rules ()
generateRules = do
root <- buildRootRules
- (root -/- "ghc-stage1") <~+ ghcWrapper Stage1
- (root -/- "ghc-stage2") <~+ ghcWrapper Stage2
- (root -/- "ghc-stage3") <~+ ghcWrapper Stage3
+ (root -/- "ghc-stage0") <~+ ghcWrapper Stage1
+ (root -/- "ghc-stage1") <~+ ghcWrapper Stage2
+ (root -/- "ghc-stage2") <~+ ghcWrapper Stage3
forM_ [Stage0 ..] $ \stage -> do
let prefix = root -/- stageString stage -/- "lib"
diff --git a/hadrian/src/Settings/Builders/Cabal.hs b/hadrian/src/Settings/Builders/Cabal.hs
index e38eba1cf0..9925f93820 100644
--- a/hadrian/src/Settings/Builders/Cabal.hs
+++ b/hadrian/src/Settings/Builders/Cabal.hs
@@ -68,7 +68,7 @@ cabalBuilderArgs = builder (Cabal Setup) ? do
, "--configure-option=--disable-option-checking" ] ]
-- TODO: Isn't vanilla always built? If yes, some conditions are redundant.
--- TODO: Need compiler_stage1_CONFIGURE_OPTS += --disable-library-for-ghci?
+-- TODO: Need compiler_stage0_CONFIGURE_OPTS += --disable-library-for-ghci?
-- TODO: should `elem` be `wayUnit`?
-- This approach still doesn't work. Previously libraries were build only in the
-- Default flavours and not using context.
diff --git a/m4/fp_prog_ghc_pkg.m4 b/m4/fp_prog_ghc_pkg.m4
index 72e8c05997..ddfdf7a811 100644
--- a/m4/fp_prog_ghc_pkg.m4
+++ b/m4/fp_prog_ghc_pkg.m4
@@ -5,7 +5,7 @@
AC_DEFUN([FP_PROG_GHC_PKG],
[AC_CACHE_CHECK([for ghc-pkg matching $WithGhc], fp_cv_matching_ghc_pkg,
[
-# If we are told to use ghc-stage2, then we're using an in-tree
+# If we are told to use ghc-stage1, then we're using an in-tree
# compiler. In this case, we just want ghc-pkg, not ghc-pkg-stage2,
# so we sed off -stage[0-9]$. However, if we are told to use
# ghc-6.12.1 then we want to use ghc-pkg-6.12.1, so we keep any
diff --git a/m4/fptools_set_c_ld_flags.m4 b/m4/fptools_set_c_ld_flags.m4
index e7e2eadac1..eda1fbd061 100644
--- a/m4/fptools_set_c_ld_flags.m4
+++ b/m4/fptools_set_c_ld_flags.m4
@@ -94,7 +94,7 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
;;
x86_64-*-openbsd*)
- # We need -z wxneeded at least to link ghc-stage2 to workaround
+ # We need -z wxneeded at least to link ghc-stage1 to workaround
# W^X issue in GHCi on OpenBSD current (as of Aug 2016)
$3="$$3 -Wl,-z,wxneeded"
$4="$$4 -z wxneeded"
diff --git a/mk/compiler-ghc.mk b/mk/compiler-ghc.mk
index 739f6157d5..38a0806aaa 100644
--- a/mk/compiler-ghc.mk
+++ b/mk/compiler-ghc.mk
@@ -14,23 +14,23 @@ TOP = ..
SPEC_TARGETS = 1 2 3 re1 re2 re3
include $(TOP)/mk/sub-makefile.mk
-FAST_MAKE_OPTS += compiler_stage1_NO_BUILD_DEPS=YES \
+FAST_MAKE_OPTS += compiler_stage0_NO_BUILD_DEPS=YES \
+ compiler_stage1_NO_BUILD_DEPS=YES \
compiler_stage2_NO_BUILD_DEPS=YES \
- compiler_stage3_NO_BUILD_DEPS=YES \
+ ghc_stage0_NO_BUILD_DEPS=YES \
ghc_stage1_NO_BUILD_DEPS=YES \
- ghc_stage2_NO_BUILD_DEPS=YES \
- ghc_stage3_NO_BUILD_DEPS=YES
+ ghc_stage2_NO_BUILD_DEPS=YES
.PHONY: 1 2 3
1:
- +$(TOPMAKE) stage=1 all_ghc_stage1 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage1 ghc_stage1"
+ +$(TOPMAKE) stage=0 all_ghc_stage0 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage0 ghc_stage0"
2:
- +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage2 ghc_stage2" NO_STAGE2_DEPS=YES
+ +$(TOPMAKE) stage=1 all_ghc_stage1 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage1 ghc_stage1" NO_STAGE2_DEPS=YES
3:
- +$(TOPMAKE) stage=3 all_ghc_stage3 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage3 ghc_stage3" NO_STAGE3_DEPS=YES
+ +$(TOPMAKE) stage=2 all_ghc_stage2 $(FAST_MAKE_OPTS) ONLY_DEPS_FOR="compiler_stage2 ghc_stage2" NO_STAGE3_DEPS=YES
# 'make re2' rebuilds stage2, removing the old executable first. Useful for
@@ -38,13 +38,13 @@ FAST_MAKE_OPTS += compiler_stage1_NO_BUILD_DEPS=YES \
.PHONY: re1 re2 re3
re1:
- $(RM) $(TOP)/ghc/stage1/build/tmp/ghc-stage1
+ $(RM) $(TOP)/ghc/stage0/build/tmp/ghc-stage0
$(MAKE) 1
re2:
- $(RM) $(TOP)/ghc/stage2/build/tmp/ghc-stage2
+ $(RM) $(TOP)/ghc/stage1/build/tmp/ghc-stage1
$(MAKE) 2
re3:
- $(RM) $(TOP)/ghc/stage3/build/tmp/ghc-stage3
+ $(RM) $(TOP)/ghc/stage2/build/tmp/ghc-stage2
$(MAKE) 3
.PHONY: extra-help
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 18199bddd2..604f8c1fdb 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -69,9 +69,9 @@ GhcHcOpts=-Rghc-timing
#
# -haddock is needed so the GHCi :doc command can find docs
# in the .hi-files for the ghc library
-GhcStage1HcOpts=
+GhcStage0HcOpts=
+GhcStage1HcOpts=-O2 -haddock
GhcStage2HcOpts=-O2 -haddock
-GhcStage3HcOpts=-O2 -haddock
# Note [Stage number in build variables].
@@ -79,7 +79,7 @@ GhcStage3HcOpts=-O2 -haddock
# There are (unfortunately) two different naming schemes for build variables
# specific to a certain stage.
#
-# * GhcStage1HcOpts/GhcStage2HcOpts/GhcStage3HcOpts:
+# * GhcStage0HcOpts/GhcStage1HcOpts/GhcStage2HcOpts:
#
# The stage number refers to the compiler stage being built (ghc library
# and executable).
@@ -418,10 +418,13 @@ ifneq "$(wildcard $(GHC).exe)" ""
GHC := $(GHC).exe
endif
-GHC_STAGE0 = $(GHC)
-GHC_STAGE1 = $(ghc-stage1_INPLACE)
-GHC_STAGE2 = $(ghc-stage2_INPLACE)
-GHC_STAGE3 = $(ghc-stage3_INPLACE)
+# HC_STAGE<N> is the haskell compiler *for* stage <N>. Stage <N+1> is built
+# with the GHC built in stage <N>.
+
+HC_STAGE0 = $(GHC)
+HC_STAGE1 = $(ghc-stage0_INPLACE)
+HC_STAGE2 = $(ghc-stage1_INPLACE)
+HC_STAGE3 = $(ghc-stage2_INPLACE)
BOOTSTRAPPING_CONF = libraries/bootstrapping.conf
@@ -531,72 +534,72 @@ MERGE_OBJS_STAGE2_FLAGS = @MergeObjsArgs@
MERGE_OBJS_STAGE3_FLAGS = @MergeObjsArgs@
# Cross-compiling options
-# See Note [CrossCompiling vs Stage1Only]
+# See Note [CrossCompiling vs Stage0Only]
CrossCompiling = @CrossCompiling@
# Change this to YES if you're building a cross-compiler and don't
# want to build stage 2.
-# See Note [CrossCompiling vs Stage1Only]
-# See Note [Stage1Only vs stage=1]
-Stage1Only = NO
+# See Note [CrossCompiling vs Stage0Only]
+# See Note [Stage0Only vs stage=0]
+Stage0Only = NO
# Installed tools prefix:
-# we add prefix to crosscompiler GHC only (ghc-stage1),
-# not cross-built GHC (not ghc-stage2).
-CrossCompilePrefix = $(if $(filter YES,$(Stage1Only)),@CrossCompilePrefix@,)
+# we add prefix to crosscompiler GHC only (ghc-stage0),
+# not cross-built GHC (not ghc-stage1).
+CrossCompilePrefix = $(if $(filter YES,$(Stage0Only)),@CrossCompilePrefix@,)
# Install stage 2 by default, or stage 1 in the cross compiler
# case. Can be changed to 3
-INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage1Only)),1,2)
+INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage0Only)),1,2)
-# Note [CrossCompiling vs Stage1Only]
+# Note [CrossCompiling vs Stage0Only]
#
# There are 4 possible settings:
#
-# 1 CrossCompiling=NO Stage1Only=NO
+# 1 CrossCompiling=NO Stage0Only=NO
# The default.
#
-# 2 CrossCompiling=NO Stage1Only=YES
-# Don't build ghc-stage2. See Note [Stage1Only vs stage=1].
+# 2 CrossCompiling=NO Stage0Only=YES
+# Don't build ghc-stage1. See Note [Stage0Only vs stage=0].
#
-# 3 CrossCompiling=YES Stage1Only=YES
-# Building a cross-compiler (ghc-stage1). See [1] and
-# Note [Stage1Only vs stage=1].
+# 3 CrossCompiling=YES Stage0Only=YES
+# Building a cross-compiler (ghc-stage0). See [1] and
+# Note [Stage0Only vs stage=0].
#
-# 4 CrossCompiling=YES Stage1Only=NO
+# 4 CrossCompiling=YES Stage0Only=NO
# Cross-compiling GHC itself. See [1].
#
# [1] https://gitlab.haskell.org/ghc/ghc/wikis/building/cross-compiling
-# Note [Stage1Only vs stage=1]
+# Note [Stage0Only vs stage=0]
#
-# Stage1Only=YES means:
-# - don't build ghc-stage2 (the executable)
-# - don't build utils that rely on ghc-stage2
-# See Note [No stage2 packages when CrossCompiling or Stage1Only] in
+# Stage0Only=YES means:
+# - don't build ghc-stage1 (the executable)
+# - don't build utils that rely on ghc-stage1
+# See Note [No stage2 packages when CrossCompiling or Stage0Only] in
# ./ghc.mk.
-# - install ghc-stage1 instead of ghc-stage2
+# - install ghc-stage0 instead of ghc-stage1
# - install the ghc-pkg that was built with the stage0 compiler
-# - (*do* still build compiler/stage2 (i.e. the ghc library))
+# - (*do* still build compiler/stage1 (i.e. the ghc library))
# - (*do* still build all other libraries)
#
-# stage=1 means:
-# - don't build compiler/stage2 (i.e. the ghc library)
-# - don't build ghc-stage2 (the executable)
+# stage=0 means:
+# - don't build compiler/stage1 (i.e. the ghc library)
+# - don't build ghc-stage1 (the executable)
# Note: these are the only two things it does. If you want to exclude more
-# stuff, combine it with Stage1Only=YES, or run make in the ghc or compiler
+# stuff, combine it with Stage0Only=YES, or run make in the ghc or compiler
# directory.
#
# running make in the ghc or compiler directory means:
# - don't build any packages in the libraries/ directory, except the ones
# listed in PACKAGES_STAGE0 (i.e. the boot libraries)
#
-# You may wonder why Stage1Only=YES still builds compiler/stage2. Quoting
+# You may wonder why Stage0Only=YES still builds compiler/stage1. Quoting
# simonmar in #7639:
#
-# "strictly speaking building compiler/stage2 is correct, because it is
-# the ghc package that can be used with [ghc-stage1]. If you don't
-# want to build it, then setting stage=1 in your mk/build.mk should
+# "strictly speaking building compiler/stage1 is correct, because it is
+# the ghc package that can be used with [ghc-stage0]. If you don't
+# want to build it, then setting stage=0 in your mk/build.mk should
# disable it."
# C compiler and linker flags from configure (e.g. -m<blah> to select
@@ -877,9 +880,9 @@ CURSES_LIB_DIRS = @CURSES_LIB_DIRS@
# See Note [Disable -O2 in unregisterised mode]
# Be careful: 'GhcUnregisterised' should be defined earlier in this file.
ifeq "$(GhcUnregisterised)" "YES"
+GhcStage0HcOpts=
GhcStage1HcOpts=
GhcStage2HcOpts=
-GhcStage3HcOpts=
GhcLibHcOpts=
endif
diff --git a/mk/flavours/bench-cross-ncg.mk b/mk/flavours/bench-cross-ncg.mk
index d52eb1ca80..1a21b7e9dd 100644
--- a/mk/flavours/bench-cross-ncg.mk
+++ b/mk/flavours/bench-cross-ncg.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O0
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O0
GhcLibHcOpts = -O2
BUILD_PROF_LIBS = NO
SplitSections = NO
@@ -11,5 +11,5 @@ BUILD_MAN = NO
WITH_TERMINFO = NO
BIGNUM_BACKEND = native
-Stage1Only = YES
+Stage0Only = YES
DYNAMIC_GHC_PROGRAMS = NO
diff --git a/mk/flavours/bench-cross.mk b/mk/flavours/bench-cross.mk
index 98f0531bc7..e898c367bf 100644
--- a/mk/flavours/bench-cross.mk
+++ b/mk/flavours/bench-cross.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m
-GhcStage1HcOpts = -O
-GhcStage2HcOpts = -O0 -fllvm
+GhcStage0HcOpts = -O
+GhcStage1HcOpts = -O0 -fllvm
GhcLibHcOpts = -O2 -fllvm
BUILD_PROF_LIBS = NO
SplitSections = NO
@@ -11,5 +11,5 @@ BUILD_MAN = NO
WITH_TERMINFO = NO
BIGNUM_BACKEND = native
-Stage1Only = YES
+Stage0Only = YES
DYNAMIC_GHC_PROGRAMS = NO
diff --git a/mk/flavours/bench-llvm.mk b/mk/flavours/bench-llvm.mk
index 58fb92df21..fd3501be80 100644
--- a/mk/flavours/bench-llvm.mk
+++ b/mk/flavours/bench-llvm.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m -fllvm
-GhcStage1HcOpts = -O
-GhcStage2HcOpts = -O0
+GhcStage0HcOpts = -O
+GhcStage1HcOpts = -O0
GhcLibHcOpts = -O2
BUILD_PROF_LIBS = NO
SplitSections = NO
diff --git a/mk/flavours/bench.mk b/mk/flavours/bench.mk
index ecfc535178..f529eeba9f 100644
--- a/mk/flavours/bench.mk
+++ b/mk/flavours/bench.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O0
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O0
GhcLibHcOpts = -O2
BUILD_PROF_LIBS = NO
SplitSections = NO
diff --git a/mk/flavours/devel-cross-ncg.mk b/mk/flavours/devel-cross-ncg.mk
index 0d5325dd25..084d0b7df8 100644
--- a/mk/flavours/devel-cross-ncg.mk
+++ b/mk/flavours/devel-cross-ncg.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O0 -H64m
-GhcStage1HcOpts = -O2 -DDEBUG
-GhcStage2HcOpts = -O0
+GhcStage0HcOpts = -O2 -DDEBUG
+GhcStage1HcOpts = -O0
GhcLibHcOpts = -O
BUILD_PROF_LIBS = NO
SplitSections = NO
@@ -11,7 +11,7 @@ BUILD_MAN = NO
WITH_TERMINFO = NO
BIGNUM_BACKEND = native
-Stage1Only = YES
+Stage0Only = YES
DYNAMIC_BY_DEFAULT = NO
DYNAMIC_GHC_PROGRAMS = NO
diff --git a/mk/flavours/devel1.mk b/mk/flavours/devel1.mk
index 1c03aff10b..09a6a76c2d 100644
--- a/mk/flavours/devel1.mk
+++ b/mk/flavours/devel1.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m
-GhcStage1HcOpts = -O0 -DDEBUG
-GhcStage2HcOpts = -O
+GhcStage0HcOpts = -O0 -DDEBUG
+GhcStage1HcOpts = -O
GhcLibHcOpts = -O -dcore-lint
BUILD_PROF_LIBS = NO
SplitSections = NO
diff --git a/mk/flavours/devel2.mk b/mk/flavours/devel2.mk
index 2d7d3b3884..03b0526ef7 100644
--- a/mk/flavours/devel2.mk
+++ b/mk/flavours/devel2.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O0 -DDEBUG
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O0 -DDEBUG
GhcLibHcOpts = -O -dcore-lint
BUILD_PROF_LIBS = NO
SplitSections = NO
diff --git a/mk/flavours/dwarf.mk b/mk/flavours/dwarf.mk
index 15f16e2c37..be82112c76 100644
--- a/mk/flavours/dwarf.mk
+++ b/mk/flavours/dwarf.mk
@@ -3,8 +3,8 @@
# --enable-dwarf-unwind.
SRC_HC_OPTS = -O -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O2 -g3
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O2 -g3
GhcRtsHcOpts = -O2 -g3
GhcLibHcOpts = -O2 -g3
BUILD_PROF_LIBS = YES
diff --git a/mk/flavours/perf-cross-ncg.mk b/mk/flavours/perf-cross-ncg.mk
index 61db9b5d43..2b4090c5e5 100644
--- a/mk/flavours/perf-cross-ncg.mk
+++ b/mk/flavours/perf-cross-ncg.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m
+GhcStage0HcOpts = -O2
GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O2
GhcLibHcOpts = -O2
BUILD_PROF_LIBS = YES
HADDOCK_DOCS = NO
@@ -10,5 +10,5 @@ BUILD_MAN = NO
WITH_TERMINFO = NO
BIGNUM_BACKEND = native
-Stage1Only = YES
+Stage0Only = YES
DYNAMIC_GHC_PROGRAMS = NO
diff --git a/mk/flavours/perf-cross.mk b/mk/flavours/perf-cross.mk
index 7b85cc6979..52d59cb9b7 100644
--- a/mk/flavours/perf-cross.mk
+++ b/mk/flavours/perf-cross.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O2 -fllvm
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O2 -fllvm
GhcLibHcOpts = -O2 -fllvm
BUILD_PROF_LIBS = YES
HADDOCK_DOCS = NO
@@ -10,5 +10,5 @@ BUILD_MAN = NO
WITH_TERMINFO = NO
BIGNUM_BACKEND = native
-Stage1Only = YES
+Stage0Only = YES
DYNAMIC_GHC_PROGRAMS = NO
diff --git a/mk/flavours/perf-llvm.mk b/mk/flavours/perf-llvm.mk
index 2598f4a40d..4a0d70e451 100644
--- a/mk/flavours/perf-llvm.mk
+++ b/mk/flavours/perf-llvm.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m -fllvm
-GhcStage1HcOpts = -O
-GhcStage2HcOpts = -O2
+GhcStage0HcOpts = -O
+GhcStage1HcOpts = -O2
GhcLibHcOpts = -O2
BUILD_PROF_LIBS = YES
#HADDOCK_DOCS
diff --git a/mk/flavours/perf.mk b/mk/flavours/perf.mk
index ee856626ad..8e3afe95b7 100644
--- a/mk/flavours/perf.mk
+++ b/mk/flavours/perf.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O -H64m
+GhcStage0HcOpts = -O2
GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O2
GhcLibHcOpts = -O2
BUILD_PROF_LIBS = YES
#HADDOCK_DOCS
diff --git a/mk/flavours/prof-llvm.mk b/mk/flavours/prof-llvm.mk
index 9c284432aa..98793ff17e 100644
--- a/mk/flavours/prof-llvm.mk
+++ b/mk/flavours/prof-llvm.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O0 -H64m -fllvm
+GhcStage0HcOpts = -O
GhcStage1HcOpts = -O
-GhcStage2HcOpts = -O
GhcLibHcOpts = -O
BUILD_PROF_LIBS = YES
SplitSections = NO
diff --git a/mk/flavours/prof.mk b/mk/flavours/prof.mk
index 6c4a6baac3..338c05a40d 100644
--- a/mk/flavours/prof.mk
+++ b/mk/flavours/prof.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O0 -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O
GhcLibHcOpts = -O
BUILD_PROF_LIBS = YES
HADDOCK_DOCS = NO
diff --git a/mk/flavours/quick-cross-ncg.mk b/mk/flavours/quick-cross-ncg.mk
index 748720f01c..ba537053e9 100644
--- a/mk/flavours/quick-cross-ncg.mk
+++ b/mk/flavours/quick-cross-ncg.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O0 -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O0
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O0
GhcLibHcOpts = -O
BUILD_PROF_LIBS = NO
SplitSections = NO
@@ -11,5 +11,5 @@ BUILD_MAN = NO
WITH_TERMINFO = NO
BIGNUM_BACKEND = native
-Stage1Only = YES
+Stage0Only = YES
DYNAMIC_GHC_PROGRAMS = NO
diff --git a/mk/flavours/quick-cross.mk b/mk/flavours/quick-cross.mk
index 4e3f47fd67..8aaaf45a33 100644
--- a/mk/flavours/quick-cross.mk
+++ b/mk/flavours/quick-cross.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O0 -H64m
-GhcStage1HcOpts = -O
-GhcStage2HcOpts = -O0 -fllvm
+GhcStage0HcOpts = -O
+GhcStage1HcOpts = -O0 -fllvm
GhcLibHcOpts = -O -fllvm
BUILD_PROF_LIBS = NO
SplitSections = NO
@@ -11,5 +11,5 @@ BUILD_MAN = NO
WITH_TERMINFO = NO
BIGNUM_BACKEND = native
-Stage1Only = YES
+Stage0Only = YES
DYNAMIC_GHC_PROGRAMS = NO
diff --git a/mk/flavours/quick-llvm.mk b/mk/flavours/quick-llvm.mk
index 9869041012..00e21ac539 100644
--- a/mk/flavours/quick-llvm.mk
+++ b/mk/flavours/quick-llvm.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O0 -H64m -fllvm
-GhcStage1HcOpts = -O
-GhcStage2HcOpts = -O0
+GhcStage0HcOpts = -O
+GhcStage1HcOpts = -O0
GhcLibHcOpts = -O
BUILD_PROF_LIBS = NO
SplitSections = NO
diff --git a/mk/flavours/quick.mk b/mk/flavours/quick.mk
index 286cb2ed23..3ac3edcd5a 100644
--- a/mk/flavours/quick.mk
+++ b/mk/flavours/quick.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O0 -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O0
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O0
GhcLibHcOpts = -O
BUILD_PROF_LIBS = NO
SplitSections = NO
diff --git a/mk/flavours/quickest.mk b/mk/flavours/quickest.mk
index 5583748eb9..261652aad6 100644
--- a/mk/flavours/quickest.mk
+++ b/mk/flavours/quickest.mk
@@ -1,6 +1,6 @@
SRC_HC_OPTS = -O0 -H64m
-GhcStage1HcOpts = -O2
-GhcStage2HcOpts = -O0
+GhcStage0HcOpts = -O2
+GhcStage1HcOpts = -O0
GhcLibHcOpts = -O0
BUILD_PROF_LIBS = NO
SplitSections = NO
diff --git a/mk/flavours/validate.mk b/mk/flavours/validate.mk
index eddd22fb82..82877b71d5 100644
--- a/mk/flavours/validate.mk
+++ b/mk/flavours/validate.mk
@@ -1,7 +1,7 @@
SRC_HC_OPTS = -O0 -H64m
SRC_HC_OPTS_STAGE1 = -fllvm-fill-undef-with-garbage # See #11487
-GhcStage1HcOpts = -O2 -DDEBUG
-GhcStage2HcOpts = -O -dcore-lint -dno-debug-output
+GhcStage0HcOpts = -O2 -DDEBUG
+GhcStage1HcOpts = -O -dcore-lint -dno-debug-output
GhcLibHcOpts = -O -dcore-lint -dno-debug-output
BUILD_PROF_LIBS = NO
SplitSections = NO
@@ -10,11 +10,11 @@ BUILD_SPHINX_HTML ?= YES
BUILD_SPHINX_PDF ?= NO
ifeq "$(ValidateHpc)" "YES"
-GhcStage2HcOpts += -fhpc -hpcdir $(TOP)/testsuite/hpc_output/
+GhcStage1HcOpts += -fhpc -hpcdir $(TOP)/testsuite/hpc_output/
endif
ifeq "$(ValidateSpeed)" "SLOW"
-GhcStage2HcOpts += -DDEBUG
+GhcStage1HcOpts += -DDEBUG
endif
ifeq "$(ValidateSpeed)" "SLOW"
@@ -42,7 +42,7 @@ libraries/Cabal_dist-install_HC_OPTS += -O0
# Note [validate build settings]
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
-# Using GhcStage2HcOpts=-O (rather than -O0) here bringes my validate down from
+# Using GhcStage1HcOpts=-O (rather than -O0) here bringes my validate down from
# 22mins to 16 mins. Compiling stage2 takes longer, but we gain a faster
# haddock, faster running of the tests, and faster building of the utils to be
# installed
diff --git a/mk/warnings.mk b/mk/warnings.mk
index ed549aa33a..517fc4534c 100644
--- a/mk/warnings.mk
+++ b/mk/warnings.mk
@@ -14,8 +14,8 @@ SRC_HC_OPTS_STAGE2 += $(WERROR)
# Enable -Wcpp-undef for GHC components only, as we don't (currently) expect
# core libraries to build in this configuration (see #13636).
GhcRtsHcOpts += -Wcpp-undef
-GhcStage1HcOpts += -Wcpp-undef
-GhcStage2HcOpts += -Wcpp-undef -Wincomplete-uni-patterns -Wincomplete-record-updates
+GhcStage0HcOpts += -Wcpp-undef
+GhcStage1HcOpts += -Wcpp-undef -Wincomplete-uni-patterns -Wincomplete-record-updates
ifneq "$(CcLlvmBackend)" "YES"
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 211741a2a9..a8b0ef93ea 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -14,7 +14,7 @@
# Building the RTS
# We build the RTS with stage 1
-rts_dist-install_HC = $(GHC_STAGE1)
+rts_dist-install_HC = $(HC_STAGE1)
rts_INSTALL_INFO = rts
rts_VERSION = 1.0.2
diff --git a/rts/include/MachDeps.h b/rts/include/MachDeps.h
index 98a90814d9..e0d92c374f 100644
--- a/rts/include/MachDeps.h
+++ b/rts/include/MachDeps.h
@@ -16,8 +16,8 @@
#pragma once
/* Don't allow stage1 (cross-)compiler embed assumptions about target
- * platform. When ghc-stage1 is being built by ghc-stage0 is should not
- * refer to target defines. A few past examples:
+ * platform. When ghc-stage0 is being built by the preexisting bootstrap
+ * hc, it should not refer to target defines. A few past examples:
* - https://gitlab.haskell.org/ghc/ghc/issues/13491
* - https://phabricator.haskell.org/D3122
* - https://phabricator.haskell.org/D3405
diff --git a/rts/posix/Ticker.c b/rts/posix/Ticker.c
index 35387cdff4..d67f0c66cc 100644
--- a/rts/posix/Ticker.c
+++ b/rts/posix/Ticker.c
@@ -89,9 +89,9 @@
cross compile for example from i386-solaris2 to x86_64-solaris2,
then the build fails with error like this:
-ghc-stage2: timer_create: Not owner
+ghc-stage1: timer_create: Not owner
- which happens on first ghc-stage2 invocation. So to support
+ which happens on first ghc-stage1 invocation. So to support
cross-compilation to Solaris we manually undefine USE_TIMER_CREATE
here */
#undef USE_TIMER_CREATE
diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk
index b4bb84cb47..b54722a561 100644
--- a/rules/build-package-data.mk
+++ b/rules/build-package-data.mk
@@ -132,7 +132,7 @@ $1/$2/build/$$(or $$($1_EXECUTABLE),$$($1_$2_PROGNAME),.)/autogen/cabal_macros.h
$1/$2/package-data.mk : $$$$(ghc-cabal_INPLACE) $$($1_$2_GHC_PKG_DEP) $1/$$($1_PACKAGE).cabal $$(wildcard $1/configure) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_CONFIG_DEP)
# Checking packages built with the bootstrapping compiler would
# generally be a waste of time. Either we will rebuild them with
-# stage1/stage2, or we don't really care about them.
+# stage0/stage1, or we don't really care about them.
ifneq "$3" "0"
ifneq "$$($1_NO_CHECK)" "YES"
"$$(ghc-cabal_INPLACE)" check $1
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index c1b95032ac..1330466255 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -31,7 +31,7 @@ $$($1_$2_COMPONENT_ID)_$2_$3_LIB = $$($1_$2_$3_LIB)
#
# hack: the DEPS_LIBS mechanism assumes that the distdirs for packages
# that depend on each other are the same, but that is not the case for
-# ghc where we use stage1/stage2 rather than dist/dist-install.
+# ghc where we use stage0/stage1 rather than dist/dist-install.
# Really we should use a consistent scheme for distdirs, but in the
# meantime we work around it by defining ghc-<ver>_dist-install_way_LIB:
#
diff --git a/rules/build-package.mk b/rules/build-package.mk
index a7d32ac06b..5249ec5228 100644
--- a/rules/build-package.mk
+++ b/rules/build-package.mk
@@ -156,7 +156,7 @@ endif
# Don't put bootstrapping packages in the bindist
#
# See Note [inconsistent distdirs] in rules/build-package-way.mk for why
-# we hard-code dist-install; GHC will use stage2/stage3 here so we
+# we hard-code dist-install; GHC will use stage1/stage2 here so we
# cannot use the distdir parameter.
ifneq "$3" "0"
BINDIST_EXTRAS += $1/*.cabal $$(wildcard $1/*.buildinfo) $$(wildcard $1/dist-install/build/*.buildinfo) $1/$2/setup-config $1/LICENSE
diff --git a/rules/build-prog.mk b/rules/build-prog.mk
index 84d717e6b6..ef91b83d97 100644
--- a/rules/build-prog.mk
+++ b/rules/build-prog.mk
@@ -325,7 +325,7 @@ $(call dependencies,$1,$2,$3)
# depend on it.
#
# See Note [inconsistent distdirs] in rules/build-package-way.mk for why
-# we hard-code dist-install; GHC will use stage2/stage3 here so we
+# we hard-code dist-install; GHC will use stage1/stage2 here so we
# cannot use the distdir parameter.
ifneq "$3" "0"
$$(foreach o,$$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS),$$(eval $$(call add-dependency,$$o,libraries/base/dist-install/build/GHC/TopHandler.$$($$($1_$2_PROGRAM_WAY)_osuf))))
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index a0dba3a1fe..06e7a76a4c 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -148,7 +148,7 @@ $1_$2_$3_MOST_HC_OPTS = \
# place the cabal_macros.h for executables in build/exename/autogen
# rather than the traditional build/autogen. This is Right(TM)
# thing to do, but we have to accommodate it. Usually, it suffices
-# to look in the PROGNAME, but for ghc the PROGNAME is ghc-stage1
+# to look in the PROGNAME, but for ghc the PROGNAME is ghc-stage0
# while Cabal puts it in 'ghc', so we $1_EXECUTABLE is for that
# case.
diff --git a/rules/haddock.mk b/rules/haddock.mk
index 4f084f86e3..b9a9bf6a79 100644
--- a/rules/haddock.mk
+++ b/rules/haddock.mk
@@ -41,7 +41,7 @@ endif
html_$1 : $$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE)
# See Note [inconsistent distdirs] in rules/build-package-way.mk for why
-# we hard-code dist-install; GHC will use stage2/stage3 here so we
+# we hard-code dist-install; GHC will use stage1/stage2 here so we
# cannot use the distdir parameter.
$$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_DEPS = $$(foreach n,$$($1_$2_DEPS),$$($$n_HADDOCK_FILE) $$($$n_dist-install_$$(HADDOCK_WAY)_LIB))
diff --git a/rules/package-config.mk b/rules/package-config.mk
index 86054071ad..878af68970 100644
--- a/rules/package-config.mk
+++ b/rules/package-config.mk
@@ -15,7 +15,7 @@ define package-config # args: $1 = dir, $2 = distdir, $3 = GHC stage
$(call trace, package-config($1,$2,$3))
$(call profStart, package-config($1,$2,$3))
-$1_$2_HC = $$(GHC_STAGE$3)
+$1_$2_HC = $$(HC_STAGE$3)
$1_$2_CC = $$(CC_STAGE$3)
$1_$2_AS = $$(AS_STAGE$3)
$1_$2_AR = $$(AR_STAGE$3)
@@ -25,7 +25,7 @@ $1_$2_ArSupportsAtFile = $$(ArSupportsAtFile_STAGE$3)
# configuration stuff that depends on which GHC we're building with
ifeq "$3" "0"
-$1_$2_HC_CONFIG = $$(GHC_STAGE0)
+$1_$2_HC_CONFIG = $$(HC_STAGE0)
$1_$2_HC_CONFIG_DEP =
$1_$2_GHC_PKG = $$(GHC_PKG)
$1_$2_GHC_PKG_DEP =
@@ -41,14 +41,14 @@ $1_$2_MORE_HC_OPTS += -no-user-package-db
$1_$2_MORE_HC_OPTS += -rtsopts
else
$1_$2_HC_PKGCONF =
-$1_$2_HC_CONFIG = $$(TOP)/$$(GHC_STAGE1)
-$1_$2_HC_CONFIG_DEP = $$(GHC_STAGE1)
+$1_$2_HC_CONFIG = $$(TOP)/$$(HC_STAGE1)
+$1_$2_HC_CONFIG_DEP = $$(HC_STAGE1)
$1_$2_GHC_PKG = $$(TOP)/$$(ghc-pkg_INPLACE)
$1_$2_GHC_PKG_DEP = $$$$(ghc-pkg_INPLACE)
$1_$2_GHC_PKG_OPTS =
# If stage is not 0 then we always use stage1 for making .depend, as later
# stages aren't available early enough
-$1_$2_HC_MK_DEPEND = $$(GHC_STAGE1)
+$1_$2_HC_MK_DEPEND = $$(HC_STAGE1)
$1_$2_HC_MK_DEPEND_DEP = $$($1_$2_HC_MK_DEPEND)
$1_$2_HC_DEP = $$($1_$2_HC)
$1_$2_MORE_HC_OPTS += -no-user-package-db
diff --git a/rules/sdist-ghc-file.mk b/rules/sdist-ghc-file.mk
index b1e13a1ea0..89faba2446 100644
--- a/rules/sdist-ghc-file.mk
+++ b/rules/sdist-ghc-file.mk
@@ -13,9 +13,9 @@
#
# Invoke like this:
#
-# $(eval $(call sdist-ghc-file,compiler,stage2,parser,Parser,y))
+# $(eval $(call sdist-ghc-file,compiler,stage1,parser,Parser,y))
#
-# This adds the file 'compiler/stage2/build/Parser.hs' to the sdist, in the
+# This adds the file 'compiler/stage1/build/Parser.hs' to the sdist, in the
# same directory as 'compiler/GHC/Parser.y' (which is renamed).
define sdist-ghc-file
diff --git a/testsuite/README.md b/testsuite/README.md
index 3f113439f9..7736d38dd1 100644
--- a/testsuite/README.md
+++ b/testsuite/README.md
@@ -14,7 +14,7 @@ Commands to run testsuite:
* Test a specific 'way': `make WAY=optllvm`
* Keeping the run directory after test run: `make CLEANUP=0`. You will find a
directory `{test_name}.run` in the test's source directory.
- * Test a specific stage of GHC: `make stage=1`
+ * Test a specific stage of GHC: `make stage=0`
* Skip performance tests: `make SKIP_PERF_TESTS=YES`
* Set verbosity: `make VERBOSE=n`
where n=0: No per-test output, n=1: Only failures,
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index efeaa94b89..6c86d45ce1 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -151,9 +151,9 @@ def stage1(name, opts):
# example, as they also use the `ghc --info` settings:
# quasiquotation/qq007/Makefile:ifeq "$(GhcDynamic)" "YES"
#
-# If you want a test to run using the stage1 compiler, add it to the
+# If you want a test to run using the stage0 compiler, add it to the
# testsuite/tests/stage1 directory. Validate runs the tests in that
-# directory with `make stage=1`.
+# directory with `make stage=0`.
# Cache the results of looking to see if we have a library or not.
# This makes quite a difference, especially on Windows.
@@ -2451,7 +2451,7 @@ def runCmd(cmd: str,
try:
# cmd is a complex command in Bourne-shell syntax
- # e.g (cd . && 'C:/users/simonpj/HEAD/inplace/bin/ghc-stage2' ...etc)
+ # e.g (cd . && 'C:/users/simonpj/HEAD/inplace/bin/ghc-stage1' ...etc)
# Hence it must ultimately be run by a Bourne shell. It's timeout's job
# to invoke the Bourne shell
diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk
index 942e6e32c2..f15ad4d047 100644
--- a/testsuite/mk/boilerplate.mk
+++ b/testsuite/mk/boilerplate.mk
@@ -63,7 +63,7 @@ ifeq "$(TEST_HC)" ""
# * run the testsuite with BINDIST=YES
#
# BINDIST=YES tells the testsuite driver to use
-# 'bindisttest/install dir/bin/ghc' instead of 'inplace/bin/ghc-stage2' as
+# 'bindisttest/install dir/bin/ghc' instead of 'inplace/bin/ghc-stage1' as
# TEST_HC.
#
# Before, if a GHC developer forgot to quote TEST_HC in their Makefile when
@@ -74,42 +74,42 @@ ifeq "$(TEST_HC)" ""
# * make sure 'bindisttest/install' does exist, and show a nice message when
# it is executed.
# * let the default value of TEST_HC also contain spaces
-# (i.e. 'inplace/test spaces/ghc-stage2'), such that the test always
+# (i.e. 'inplace/test spaces/ghc-stage1'), such that the test always
# fails, also without BINDIST=YES, and again show a nice message when it
# indeed does so, through 'inplace/test'.
# The `wildcard` function requires spaces to be escaped. Other gnu make
# functions can't seem to handle spaces at all (e.g. `abspath`).
-STAGE1_TEST_SPACES := $(TOP)/../inplace/test\ \ \ spaces/ghc-stage1
-STAGE1_NORMAL := $(TOP)/../inplace/bin/ghc-stage1
+STAGE0_TEST_SPACES := $(TOP)/../inplace/test\ \ \ spaces/ghc-stage0
+STAGE0_NORMAL := $(TOP)/../inplace/bin/ghc-stage0
-ifneq "$(wildcard $(STAGE1_TEST_SPACES) $(STAGE1_NORMAL))" ""
+ifneq "$(wildcard $(STAGE0_TEST_SPACES) $(STAGE0_NORMAL))" ""
IMPLICIT_COMPILER = NO
IN_TREE_COMPILER = YES
-ifneq "$(wildcard $(STAGE1_TEST_SPACES))" ""
+ifneq "$(wildcard $(STAGE0_TEST_SPACES))" ""
# See Note [Spaces in TEST_HC].
+STAGE0_GHC := $(abspath $(TOP)/../)/inplace/test spaces/ghc-stage0
STAGE1_GHC := $(abspath $(TOP)/../)/inplace/test spaces/ghc-stage1
STAGE2_GHC := $(abspath $(TOP)/../)/inplace/test spaces/ghc-stage2
-STAGE3_GHC := $(abspath $(TOP)/../)/inplace/test spaces/ghc-stage3
else
# Maybe we're on Windows (no symlink support), or in a bindist or sdist, which
# don't have the 'test spaces' symlink.
+STAGE0_GHC := $(abspath $(TOP)/../)/inplace/bin/ghc-stage0
STAGE1_GHC := $(abspath $(TOP)/../)/inplace/bin/ghc-stage1
STAGE2_GHC := $(abspath $(TOP)/../)/inplace/bin/ghc-stage2
-STAGE3_GHC := $(abspath $(TOP)/../)/inplace/bin/ghc-stage3
endif
ifeq "$(BINDIST)" "YES"
# See Note [Spaces in TEST_HC].
TEST_HC := $(abspath $(TOP)/../)/bindisttest/install dir/bin/ghc
+else ifeq "$(stage)" "0"
+TEST_HC := $(STAGE0_GHC)
else ifeq "$(stage)" "1"
TEST_HC := $(STAGE1_GHC)
-else ifeq "$(stage)" "3"
-TEST_HC := $(STAGE3_GHC)
else
-# use stage2 by default
-TEST_HC := $(STAGE2_GHC)
+# use stage1 by default
+TEST_HC := $(STAGE1_GHC)
endif
else
diff --git a/testsuite/tests/codeGen/should_compile/jmp_tbl.hs b/testsuite/tests/codeGen/should_compile/jmp_tbl.hs
index 4b4c866992..3370ea215e 100644
--- a/testsuite/tests/codeGen/should_compile/jmp_tbl.hs
+++ b/testsuite/tests/codeGen/should_compile/jmp_tbl.hs
@@ -4,9 +4,9 @@
This funny module was reduced from a failing build of stage2 using
the new code generator and the linear register allocator, with this bug:
-"inplace/bin/ghc-stage1" -fPIC -dynamic -H32m -O -Wall -H64m -O0 -package-name ghc-7.1.20110414 -hide-all-packages -i -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/vectorise -icompiler/stage2/build -icompiler/stage2/build/autogen -Icompiler/stage2/build -Icompiler/stage2/build/autogen -Icompiler/../libffi/build/include -Icompiler/stage2 -Icompiler/../libraries/base/cbits -Icompiler/../libraries/base/include -Icompiler/. -Icompiler/parser -Icompiler/utils -optP-DHAVE_INTERNAL_INTERPRETER -optP-include -optPcompiler/stage2/build/autogen/cabal_macros.h -package Cabal-1.11.0 -package array-0.3.0.2 -package base-4.3.1.0 -package ghc-boot-0.0.0.0 -package bytestring-0.9.1.10 -package containers-0.4.0.0 -package directory-1.1.0.0 -package filepath-1.2.0.0 -package hoopl-3.8.7.0 -package hpc-0.5.0.6 -package old-time-1.0.0.6 -package process-1.0.1.4 -package template-haskell-2.5.0.0 -package unix-2.4.1.0 -Wall -fno-warn-name-shadowing -fno-warn-orphans -XHaskell98 -XNondecreasingIndentation -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRank2Types -XScopedTypeVariables -XDeriveDataTypeable -DSTAGE=2 -O2 -O -DGHC_DEFAULT_NEW_CODEGEN -no-user-package-db -rtsopts -odir compiler/stage2/build -hidir compiler/stage2/build -stubdir compiler/stage2/build -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -c compiler/main/DriverPipeline.hs -o compiler/stage2/build/DriverPipeline.dyn_o -fforce-recomp -dno-debug-output -fno-warn-unused-binds
+"inplace/bin/ghc-stage0" -fPIC -dynamic -H32m -O -Wall -H64m -O0 -package-name ghc-7.1.20110414 -hide-all-packages -i -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/vectorise -icompiler/stage1/build -icompiler/stage1/build/autogen -Icompiler/stage1/build -Icompiler/stage1/build/autogen -Icompiler/../libffi/build/include -Icompiler/stage1 -Icompiler/../libraries/base/cbits -Icompiler/../libraries/base/include -Icompiler/. -Icompiler/parser -Icompiler/utils -optP-DHAVE_INTERNAL_INTERPRETER -optP-include -optPcompiler/stage1/build/autogen/cabal_macros.h -package Cabal-1.11.0 -package array-0.3.0.2 -package base-4.3.1.0 -package ghc-boot-0.0.0.0 -package bytestring-0.9.1.10 -package containers-0.4.0.0 -package directory-1.1.0.0 -package filepath-1.2.0.0 -package hoopl-3.8.7.0 -package hpc-0.5.0.6 -package old-time-1.0.0.6 -package process-1.0.1.4 -package template-haskell-2.5.0.0 -package unix-2.4.1.0 -Wall -fno-warn-name-shadowing -fno-warn-orphans -XHaskell98 -XNondecreasingIndentation -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRank2Types -XScopedTypeVariables -XDeriveDataTypeable -O2 -O -DGHC_DEFAULT_NEW_CODEGEN -no-user-package-db -rtsopts -odir compiler/stage1/build -hidir compiler/stage1/build -stubdir compiler/stage1/build -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -c compiler/main/DriverPipeline.hs -o compiler/stage1/build/DriverPipeline.dyn_o -fforce-recomp -dno-debug-output -fno-warn-unused-binds
-ghc-stage1: panic! (the 'impossible' happened)
+ghc-stage0: panic! (the 'impossible' happened)
(GHC version 7.1.20110414 for x86_64-unknown-linux):
Cannot patch JMP_TBL
diff --git a/testsuite/tests/driver/T12062/T12062.stderr b/testsuite/tests/driver/T12062/T12062.stderr
index 8262940b08..ad58034368 100644
--- a/testsuite/tests/driver/T12062/T12062.stderr
+++ b/testsuite/tests/driver/T12062/T12062.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: on the commandline: Syntax: -j[n] where n > 0
+ghc-stage1: on the commandline: Syntax: -j[n] where n > 0
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/driver/T7130.stderr b/testsuite/tests/driver/T7130.stderr
index 3ddeced91e..c50536622a 100644
--- a/testsuite/tests/driver/T7130.stderr
+++ b/testsuite/tests/driver/T7130.stderr
@@ -1,4 +1,4 @@
-ghc-stage2: unrecognised flag: -fflul-laziness
+ghc-stage1: unrecognised flag: -fflul-laziness
did you mean one of:
-ffull-laziness
-fno-full-laziness
diff --git a/testsuite/tests/driver/T7563.stderr b/testsuite/tests/driver/T7563.stderr
index 316e2c0858..452d77f465 100644
--- a/testsuite/tests/driver/T7563.stderr
+++ b/testsuite/tests/driver/T7563.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: the option -C is only available with an unregisterised GHC
+ghc-stage1: the option -C is only available with an unregisterised GHC
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/driver/T9776.stderr b/testsuite/tests/driver/T9776.stderr
index 0281a2d0c4..3ea7e34a66 100644
--- a/testsuite/tests/driver/T9776.stderr
+++ b/testsuite/tests/driver/T9776.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: on the commandline: missing argument for flag: -drule-check
+ghc-stage1: on the commandline: missing argument for flag: -drule-check
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/driver/T9963.stderr b/testsuite/tests/driver/T9963.stderr
index 09a9bf4a00..bc146ed554 100644
--- a/testsuite/tests/driver/T9963.stderr
+++ b/testsuite/tests/driver/T9963.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: on the commandline: cannot use `--interactive' with `--print-libdir'
+ghc-stage1: on the commandline: cannot use `--interactive' with `--print-libdir'
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/ghc-e/should_fail/T9930fail.stderr b/testsuite/tests/ghc-e/should_fail/T9930fail.stderr
index a76a467f89..317b1fbbee 100644
--- a/testsuite/tests/ghc-e/should_fail/T9930fail.stderr
+++ b/testsuite/tests/ghc-e/should_fail/T9930fail.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: default output name would overwrite the input file; must specify -o explicitly
+ghc-stage1: default output name would overwrite the input file; must specify -o explicitly
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/linear/should_compile/Arity2.hs b/testsuite/tests/linear/should_compile/Arity2.hs
index d764d5111a..c81554989b 100644
--- a/testsuite/tests/linear/should_compile/Arity2.hs
+++ b/testsuite/tests/linear/should_compile/Arity2.hs
@@ -2,7 +2,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
module Arity2 where
{-
-inplace/bin/ghc-stage1 -O2 -dcore-lint
+inplace/bin/ghc-stage0 -O2 -dcore-lint
-}
--import GHC.Base
diff --git a/testsuite/tests/linear/should_compile/Dollar2.hs b/testsuite/tests/linear/should_compile/Dollar2.hs
index 4cde3dcb45..4ec28589f2 100644
--- a/testsuite/tests/linear/should_compile/Dollar2.hs
+++ b/testsuite/tests/linear/should_compile/Dollar2.hs
@@ -2,7 +2,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
module Dollar2 where
{-
-inplace/bin/ghc-stage1 -O2 -dcore-lint
+inplace/bin/ghc-stage0 -O2 -dcore-lint
-}
diff --git a/testsuite/tests/linear/should_compile/Foldr.hs b/testsuite/tests/linear/should_compile/Foldr.hs
index 759256d5b2..932e7c9379 100644
--- a/testsuite/tests/linear/should_compile/Foldr.hs
+++ b/testsuite/tests/linear/should_compile/Foldr.hs
@@ -2,7 +2,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
module FoldrExample where
{-
-inplace/bin/ghc-stage1 -O2 -dcore-lint
+inplace/bin/ghc-stage0 -O2 -dcore-lint
-}
import GHC.Base
diff --git a/testsuite/tests/linear/should_compile/List.hs b/testsuite/tests/linear/should_compile/List.hs
index 4d87dba896..52e239cca9 100644
--- a/testsuite/tests/linear/should_compile/List.hs
+++ b/testsuite/tests/linear/should_compile/List.hs
@@ -2,7 +2,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
module List where
{-
-inplace/bin/ghc-stage1 -O2 -dcore-lint
+inplace/bin/ghc-stage0 -O2 -dcore-lint
See Cabal:Distribution.Types.VersionRange:556
-}
diff --git a/testsuite/tests/linear/should_compile/RankN.hs b/testsuite/tests/linear/should_compile/RankN.hs
index cadefa5290..5fbf419663 100644
--- a/testsuite/tests/linear/should_compile/RankN.hs
+++ b/testsuite/tests/linear/should_compile/RankN.hs
@@ -3,7 +3,7 @@
{-# LANGUAGE RankNTypes #-}
module RankN where
{-
-inplace/bin/ghc-stage1 -O2 -dcore-lint
+inplace/bin/ghc-stage0 -O2 -dcore-lint
-}
import GHC.Base
diff --git a/testsuite/tests/linear/should_compile/TupSection.hs b/testsuite/tests/linear/should_compile/TupSection.hs
index ea401e6e97..834eae34da 100644
--- a/testsuite/tests/linear/should_compile/TupSection.hs
+++ b/testsuite/tests/linear/should_compile/TupSection.hs
@@ -2,7 +2,7 @@
{-# LANGUAGE TupleSections #-}
module TupSection where
{-
-inplace/bin/ghc-stage1 -O2 -dcore-lint
+inplace/bin/ghc-stage0 -O2 -dcore-lint
-}
myAp :: (a -> b) -> a -> b
diff --git a/testsuite/tests/perf/compiler/T12545.measure.sh b/testsuite/tests/perf/compiler/T12545.measure.sh
index e578c7197a..a96e4db3cc 100755
--- a/testsuite/tests/perf/compiler/T12545.measure.sh
+++ b/testsuite/tests/perf/compiler/T12545.measure.sh
@@ -9,7 +9,7 @@ EOF
# https://stackoverflow.com/a/4774063/388010
TOP="$( cd -- "$(dirname "$0")/../../../../" >/dev/null 2>&1 ; pwd -P )"
-GHC=${GHC:-$TOP/_validate/stage1/bin/ghc}
+GHC=${GHC:-$TOP/_validate/stage0/bin/ghc}
echo "Using GHC=$GHC. Feel free to override via env var"
diff --git a/testsuite/tests/printer/T13942.hs b/testsuite/tests/printer/T13942.hs
index 8899e1c58d..5bddd0ce98 100644
--- a/testsuite/tests/printer/T13942.hs
+++ b/testsuite/tests/printer/T13942.hs
@@ -10,7 +10,7 @@ $([d| f :: Either Int (Int -> Int)
Note: to debug
-~/inplace/bin/ghc-stage2 --interactive
+~/inplace/bin/ghc-stage1 --interactive
load the following
--------------------------------------
import Language.Haskell.TH
diff --git a/testsuite/tests/printer/T14289.hs b/testsuite/tests/printer/T14289.hs
index 04b9176c69..f307d671e9 100644
--- a/testsuite/tests/printer/T14289.hs
+++ b/testsuite/tests/printer/T14289.hs
@@ -13,7 +13,7 @@ $([d| data Foo a = Foo a deriving (C a) |])
Note: to debug
-~/inplace/bin/ghc-stage2 --interactive
+~/inplace/bin/ghc-stage1 --interactive
load the following
----------------------------------------
{-# LANGUAGE MultiParamTypeClasses #-}
diff --git a/testsuite/tests/printer/T14289b.hs b/testsuite/tests/printer/T14289b.hs
index d35292c5cd..00ef30b4c6 100644
--- a/testsuite/tests/printer/T14289b.hs
+++ b/testsuite/tests/printer/T14289b.hs
@@ -14,7 +14,7 @@ $([d| data Foo a = Foo a deriving (y `C` z) |])
Note: to debug
-~/inplace/bin/ghc-stage2 --interactive
+~/inplace/bin/ghc-stage1 --interactive
load the following
----------------------------------------
{-# LANGUAGE MultiParamTypeClasses #-}
diff --git a/testsuite/tests/printer/T14289c.hs b/testsuite/tests/printer/T14289c.hs
index adf378c41e..f18d4c59bb 100644
--- a/testsuite/tests/printer/T14289c.hs
+++ b/testsuite/tests/printer/T14289c.hs
@@ -12,7 +12,7 @@ $([d| data Foo a = Foo a deriving (a ~ a) |])
Note: to debug
-~/inplace/bin/ghc-stage2 --interactive
+~/inplace/bin/ghc-stage1 --interactive
load the following
----------------------------------------
{-# LANGUAGE MultiParamTypeClasses #-}
diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr
index 3ec6cb6ca5..49a57a0d1e 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr
+++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr
@@ -9,7 +9,7 @@ This could be caused by:
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
-ghc-stage2: ^^ Could not load 'c', dependency unresolved. See top entry above.
+ghc-stage1: ^^ Could not load 'c', dependency unresolved. See top entry above.
GHC.ByteCode.Linker: can't find label
diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
index 5304e84a37..3d2f4320ee 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
+++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
@@ -9,7 +9,7 @@ This could be caused by:
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
-ghc-stage2.exe: ^^ Could not load '_c', dependency unresolved. See top entry above.
+ghc-stage1.exe: ^^ Could not load '_c', dependency unresolved. See top entry above.
GHC.ByteCode.Linker: can't find label
diff --git a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32
index 5396070515..1ac538cf36 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32
+++ b/testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32
@@ -9,7 +9,7 @@ This could be caused by:
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
-ghc-stage2.exe: ^^ Could not load 'c', dependency unresolved. See top entry above.
+ghc-stage1.exe: ^^ Could not load 'c', dependency unresolved. See top entry above.
GHC.ByteCode.Linker: can't find label
diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr
index b5d1872a8d..ad7bd0f5fe 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr
+++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr
@@ -9,7 +9,7 @@ This could be caused by:
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
-ghc-stage2: ^^ Could not load 'c', dependency unresolved. See top entry above.
+ghc-stage1: ^^ Could not load 'c', dependency unresolved. See top entry above.
GHC.ByteCode.Linker: can't find label
diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
index fcf9f6cbd9..42ac500239 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
+++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
@@ -9,7 +9,7 @@ This could be caused by:
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
-ghc-stage2.exe: ^^ Could not load '_c', dependency unresolved. See top entry above.
+ghc-stage1.exe: ^^ Could not load '_c', dependency unresolved. See top entry above.
GHC.ByteCode.Linker: can't find label
diff --git a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32 b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32
index 84742a8271..7b71e34b6b 100644
--- a/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32
+++ b/testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-64-mingw32
@@ -9,7 +9,7 @@ This could be caused by:
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
-ghc-stage2.exe: ^^ Could not load 'c', dependency unresolved. See top entry above.
+ghc-stage1.exe: ^^ Could not load 'c', dependency unresolved. See top entry above.
GHC.ByteCode.Linker: can't find label
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags05.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags05.stderr
index 3ca3d81752..3ad0f800bb 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags05.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags05.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: SafeFlags05.hs:1:20-25: Incompatible Safe Haskell flags! (Safe, Unsafe)
+ghc-stage1: SafeFlags05.hs:1:20-25: Incompatible Safe Haskell flags! (Safe, Unsafe)
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags06.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags06.stderr
index f43309ce3b..493ea9e97e 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags06.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags06.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: SafeFlags06.hs:1:27-32: Incompatible Safe Haskell flags! (Trustworthy, Unsafe)
+ghc-stage1: SafeFlags06.hs:1:27-32: Incompatible Safe Haskell flags! (Trustworthy, Unsafe)
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags10.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags10.stderr
index 86346b77fe..9416b0f748 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags10.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags10.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: SafeFlags10.hs:1:20-30: Incompatible Safe Haskell flags! (Safe, Trustworthy)
+ghc-stage1: SafeFlags10.hs:1:20-30: Incompatible Safe Haskell flags! (Safe, Trustworthy)
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags13.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags13.stderr
index 9c128f5d0c..830ab3994c 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags13.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags13.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: SafeFlags13.hs:2:14-19: Incompatible Safe Haskell flags! (Trustworthy, Unsafe)
+ghc-stage1: SafeFlags13.hs:2:14-19: Incompatible Safe Haskell flags! (Trustworthy, Unsafe)
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags14.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags14.stderr
index 991511f55c..0ca8f810d9 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags14.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags14.stderr
@@ -1,2 +1,2 @@
-ghc-stage2: SafeFlags14.hs:2:14-19: Incompatible Safe Haskell flags! (Safe, Unsafe)
+ghc-stage1: SafeFlags14.hs:2:14-19: Incompatible Safe Haskell flags! (Safe, Unsafe)
Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/simplCore/should_compile/T10689a.hs b/testsuite/tests/simplCore/should_compile/T10689a.hs
index 5b21b42db7..4ecb289107 100644
--- a/testsuite/tests/simplCore/should_compile/T10689a.hs
+++ b/testsuite/tests/simplCore/should_compile/T10689a.hs
@@ -13,7 +13,7 @@
{-# OPTIONS_GHC -O1 -fspec-constr #-}
{-
-ghc-stage2: panic! (the 'impossible' happened)
+ghc-stage1: panic! (the 'impossible' happened)
(GHC version 7.11.20150723 for x86_64-unknown-linux):
Template variable unbound in rewrite rule
-}
diff --git a/testsuite/tests/simplCore/should_compile/T11562.hs b/testsuite/tests/simplCore/should_compile/T11562.hs
index 72093a7180..2b17ad4fa5 100644
--- a/testsuite/tests/simplCore/should_compile/T11562.hs
+++ b/testsuite/tests/simplCore/should_compile/T11562.hs
@@ -29,7 +29,7 @@ sub :: a => (b => r) -> (C2D a b) -> r
sub r (Sub Dict) = r
{-
-$ inplace/bin/ghc-stage2 -fforce-recomp -c C.hs -O0
+$ inplace/bin/ghc-stage1 -fforce-recomp -c C.hs -O0
WARNING: file compiler/stgSyn/CoreToStg.hs, line 250
$fCategoryConstraint:- True False
diff --git a/testsuite/timeout/Makefile b/testsuite/timeout/Makefile
index 9626eaea19..5c15c7f765 100644
--- a/testsuite/timeout/Makefile
+++ b/testsuite/timeout/Makefile
@@ -51,7 +51,7 @@ boot all :: calibrate.out $(TIMEOUT_PROGRAM)
calibrate.out:
$(RM) -f TimeMe.o TimeMe.hi TimeMe TimeMe.exe
- $(PYTHON) calibrate '$(STAGE1_GHC)' > $@
+ $(PYTHON) calibrate '$(STAGE0_GHC)' > $@
# We use stage 1 to do the calibration, as stage 2 may not exist.
# This isn't necessarily the compiler we'll be running the testsuite
# with, but it's really the performance of the machine that we're
diff --git a/utils/compare_sizes/Main.hs b/utils/compare_sizes/Main.hs
index 8bb82dfe2c..cf163cb149 100644
--- a/utils/compare_sizes/Main.hs
+++ b/utils/compare_sizes/Main.hs
@@ -2,8 +2,8 @@
-- $ ./compareSizes --hi ~/ghc/darcs/ghc ~/ghc/6.12-branch/ghc
-- Size | Change | Filename
--- 25644 | -0.99% | compiler/stage1/build/Demand.hi
--- 21103 | -0.98% | compiler/stage2/build/Demand.hi
+-- 25644 | -0.99% | compiler/stage0/build/Demand.hi
+-- 21103 | -0.98% | compiler/stage1/build/Demand.hi
-- 180044 | -0.98% | libraries/base/dist-install/build/GHC/Classes.hi
-- 6415 | -0.58% | .../Data/Array/Parallel/Prelude/Base/Tuple.hi
-- 6507 | -0.57% | .../Data/Array/Parallel/Prelude/Base/Tuple.hi
diff --git a/utils/count-deps/Main.hs b/utils/count-deps/Main.hs
index fc37ac555b..209adb6ba2 100644
--- a/utils/count-deps/Main.hs
+++ b/utils/count-deps/Main.hs
@@ -16,7 +16,7 @@ import Data.Map.Strict qualified as Map
import Data.Set qualified as Set
-- Example invocation:
--- inplace/bin/count-deps `inplace/bin/ghc-stage2 --print-libdir` "GHC.Parser"
+-- inplace/bin/count-deps `inplace/bin/ghc-stage1 --print-libdir` "GHC.Parser"
main :: IO ()
main = do
args <- getArgs
diff --git a/utils/count-deps/README.md b/utils/count-deps/README.md
index 0d6f14bd9b..f31cb9c86d 100644
--- a/utils/count-deps/README.md
+++ b/utils/count-deps/README.md
@@ -22,8 +22,8 @@ install graphviz on your system.
- `make`:
- 1. ``inplace/bin/count-deps `inplace/bin/ghc-stage2 --print-libdir` "GHC.Parser"``
- 2. ``inplace/bin/count-deps `inplace/bin/ghc-stage2 --print-libdir` "GHC.Parser" --dot``
+ 1. ``inplace/bin/count-deps `inplace/bin/ghc-stage1 --print-libdir` "GHC.Parser"``
+ 2. ``inplace/bin/count-deps `inplace/bin/ghc-stage1 --print-libdir` "GHC.Parser" --dot``
- `hadrian`:
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 51378517fc..f5ad0b8642 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -410,7 +410,7 @@ generate directory distdir config_args
-- The mkLibraryRelDir function is a bit of a hack.
-- Ideally it should be handled in the makefiles instead.
mkLibraryRelDir "rts" = "rts/dist-install/build"
- mkLibraryRelDir "ghc" = "compiler/stage2/build"
+ mkLibraryRelDir "ghc" = "compiler/stage1/build"
mkLibraryRelDir "Cabal" = "libraries/Cabal/Cabal/dist-install/build"
mkLibraryRelDir "containers" = "libraries/containers/containers/dist-install/build"
mkLibraryRelDir l = "libraries/" ++ l ++ "/dist-install/build"
diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk
index e3740723d2..94efd61f1b 100644
--- a/utils/ghc-pkg/ghc.mk
+++ b/utils/ghc-pkg/ghc.mk
@@ -40,14 +40,14 @@ utils/ghc-pkg_dist_PROGNAME = ghc-pkg
utils/ghc-pkg_dist_SHELL_WRAPPER = YES
utils/ghc-pkg_dist_INSTALL_INPLACE = YES
-# When cross-built ghc-stage2 is installed 'make install' needs to call
+# When cross-built ghc-stage1 is installed 'make install' needs to call
# native ghc-pkg (not the cross-built one) to register installed packages
# 'ghc-pkg_DIST_BINARY' variable only refer to native binary.
ghc-pkg_DIST_BINARY_NAME = ghc-pkg$(exeext0)
ghc-pkg_DIST_BINARY = utils/ghc-pkg/dist/build/tmp/$(ghc-pkg_DIST_BINARY_NAME)
-# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
-ifeq "$(Stage1Only)" "YES"
+# See Note [Stage0Only vs stage=0] in mk/config.mk.in.
+ifeq "$(Stage0Only)" "YES"
# Install the copy of ghc-pkg from the dist directory when running 'make
# install' (it's the only copy we have at this stage).
utils/ghc-pkg_dist_INSTALL = YES
@@ -72,8 +72,8 @@ $(ghc-pkg_INPLACE) : | $(INPLACE_PACKAGE_CONF)/. $(INPLACE_LIB)/settings
#
# See Note [Why build certain utils twice?].
-# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
-ifneq "$(Stage1Only)" "YES"
+# See Note [Stage0Only vs stage=0] in mk/config.mk.in.
+ifneq "$(Stage0Only)" "YES"
utils/ghc-pkg_dist-install_USES_CABAL = YES
utils/ghc-pkg_dist-install_PROGNAME = ghc-pkg
utils/ghc-pkg_dist-install_SHELL_WRAPPER = YES
diff --git a/utils/hp2ps/ghc.mk b/utils/hp2ps/ghc.mk
index a309e116a1..7cd56b8620 100644
--- a/utils/hp2ps/ghc.mk
+++ b/utils/hp2ps/ghc.mk
@@ -32,7 +32,7 @@ utils/hp2ps_dist-install_INSTALL_INPLACE = NO
utils/hp2ps_dist-install_SHELL_WRAPPER = YES
utils/hp2ps_dist-install_INSTALL_SHELL_WRAPPER_NAME = $(utils/hp2ps_dist_INSTALL_SHELL_WRAPPER_NAME)
-ifeq "$(Stage1Only)" "YES"
+ifeq "$(Stage0Only)" "YES"
utils/hp2ps_dist_INSTALL = YES
utils/hp2ps_dist-install_INSTALL = NO
else
diff --git a/utils/iserv-proxy/ghc.mk b/utils/iserv-proxy/ghc.mk
index 479b72e9b0..3f0384d3ab 100644
--- a/utils/iserv-proxy/ghc.mk
+++ b/utils/iserv-proxy/ghc.mk
@@ -15,15 +15,15 @@ utils/iserv-proxy_PACKAGE = iserv-proxy
utils/iserv-proxy_EXECUTABLE = iserv-proxy
ifeq "$(GhcDebugged)" "YES"
-utils/iserv-proxy_stage2_MORE_HC_OPTS += -debug
-utils/iserv-proxy_stage2_p_MORE_HC_OPTS += -debug
-utils/iserv-proxy_stage2_dyn_MORE_HC_OPTS += -debug
+utils/iserv-proxy_stage1_MORE_HC_OPTS += -debug
+utils/iserv-proxy_stage1_p_MORE_HC_OPTS += -debug
+utils/iserv-proxy_stage1_dyn_MORE_HC_OPTS += -debug
endif
ifeq "$(GhcThreaded)" "YES"
-utils/iserv-proxy_stage2_MORE_HC_OPTS += -threaded
-utils/iserv-proxy_stage2_p_MORE_HC_OPTS += -threaded
-utils/iserv-proxy_stage2_dyn_MORE_HC_OPTS += -threaded
+utils/iserv-proxy_stage1_MORE_HC_OPTS += -threaded
+utils/iserv-proxy_stage1_p_MORE_HC_OPTS += -threaded
+utils/iserv-proxy_stage1_dyn_MORE_HC_OPTS += -threaded
endif
# Add -Wl,--export-dynamic enables GHCi to load dynamic objects that
@@ -34,9 +34,9 @@ ifeq "$(TargetElf)" "YES"
ifneq "$(TargetOS_CPP)" "solaris2"
# The Solaris linker does not support --export-dynamic option. It also
# does not need it since it exports all dynamic symbols by default
-utils/iserv-proxy_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic
-utils/iserv-proxy_stage2_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
-utils/iserv-proxy_stage2_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/iserv-proxy_stage1_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/iserv-proxy_stage1_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/iserv-proxy_stage1_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
endif
endif
@@ -44,30 +44,30 @@ endif
# program for each way. Note that it's important to do this even for
# the vanilla version, otherwise we get a dynamic executable when
# DYNAMIC_GHC_PROGRAMS=YES.
-utils/iserv-proxy_stage2_PROGRAM_WAY = v
-utils/iserv-proxy_stage2_p_PROGRAM_WAY = p
-utils/iserv-proxy_stage2_dyn_PROGRAM_WAY = dyn
+utils/iserv-proxy_stage1_PROGRAM_WAY = v
+utils/iserv-proxy_stage1_p_PROGRAM_WAY = p
+utils/iserv-proxy_stage1_dyn_PROGRAM_WAY = dyn
-utils/iserv-proxy_stage2_PROGNAME = ghc-iserv
-utils/iserv-proxy_stage2_p_PROGNAME = ghc-iserv-prof
-utils/iserv-proxy_stage2_dyn_PROGNAME = ghc-iserv-dyn
+utils/iserv-proxy_stage1_PROGNAME = ghc-iserv
+utils/iserv-proxy_stage1_p_PROGNAME = ghc-iserv-prof
+utils/iserv-proxy_stage1_dyn_PROGNAME = ghc-iserv-dyn
-utils/iserv-proxy_stage2_MORE_HC_OPTS += -no-hs-main
-utils/iserv-proxy_stage2_p_MORE_HC_OPTS += -no-hs-main
-utils/iserv-proxy_stage2_dyn_MORE_HC_OPTS += -no-hs-main
+utils/iserv-proxy_stage1_MORE_HC_OPTS += -no-hs-main
+utils/iserv-proxy_stage1_p_MORE_HC_OPTS += -no-hs-main
+utils/iserv-proxy_stage1_dyn_MORE_HC_OPTS += -no-hs-main
-utils/iserv-proxy_stage2_INSTALL = YES
-utils/iserv-proxy_stage2_p_INSTALL = YES
-utils/iserv-proxy_stage2_dyn_INSTALL = YES
+utils/iserv-proxy_stage1_INSTALL = YES
+utils/iserv-proxy_stage1_p_INSTALL = YES
+utils/iserv-proxy_stage1_dyn_INSTALL = YES
# Install in $(libexec), not in $(bindir)
-utils/iserv-proxy_stage2_TOPDIR = YES
-utils/iserv-proxy_stage2_p_TOPDIR = YES
-utils/iserv-proxy_stage2_dyn_TOPDIR = YES
+utils/iserv-proxy_stage1_TOPDIR = YES
+utils/iserv-proxy_stage1_p_TOPDIR = YES
+utils/iserv-proxy_stage1_dyn_TOPDIR = YES
-utils/iserv-proxy_stage2_INSTALL_INPLACE = YES
-utils/iserv-proxy_stage2_p_INSTALL_INPLACE = YES
-utils/iserv-proxy_stage2_dyn_INSTALL_INPLACE = YES
+utils/iserv-proxy_stage1_INSTALL_INPLACE = YES
+utils/iserv-proxy_stage1_p_INSTALL_INPLACE = YES
+utils/iserv-proxy_stage1_dyn_INSTALL_INPLACE = YES
ifeq "$(CLEANING)" "YES"
@@ -97,17 +97,17 @@ endif
endif
ifeq "$(NEED_iserv)" "YES"
-$(eval $(call build-prog,utils/iserv-proxy,stage2,1))
+$(eval $(call build-prog,utils/iserv-proxy,stage1,1))
endif
ifeq "$(NEED_iserv_p)" "YES"
-$(eval $(call build-prog,utils/iserv-proxy,stage2_p,1))
+$(eval $(call build-prog,utils/iserv-proxy,stage1_p,1))
endif
ifeq "$(NEED_iserv_dyn)" "YES"
-$(eval $(call build-prog,utils/iserv-proxy,stage2_dyn,1))
+$(eval $(call build-prog,utils/iserv-proxy,stage1_dyn,1))
endif
-all_ghc_stage2 : $(iserv-proxy-stage2_INPLACE)
-all_ghc_stage2 : $(iserv-proxy-stage2_p_INPLACE)
-all_ghc_stage2 : $(iserv-proxy-stage2_dyn_INPLACE)
+all_ghc_stage1 : $(iserv-proxy-stage1_INPLACE)
+all_ghc_stage1 : $(iserv-proxy-stage1_p_INPLACE)
+all_ghc_stage1 : $(iserv-proxy-stage1_dyn_INPLACE)
diff --git a/utils/iserv/ghc.mk b/utils/iserv/ghc.mk
index 74f90e60b7..180110b6f9 100644
--- a/utils/iserv/ghc.mk
+++ b/utils/iserv/ghc.mk
@@ -15,15 +15,15 @@ utils/iserv_PACKAGE = iserv
utils/iserv_EXECUTABLE = iserv
ifeq "$(GhcDebugged)" "YES"
-utils/iserv_stage2_MORE_HC_OPTS += -debug
-utils/iserv_stage2_p_MORE_HC_OPTS += -debug
-utils/iserv_stage2_dyn_MORE_HC_OPTS += -debug
+utils/iserv_stage1_MORE_HC_OPTS += -debug
+utils/iserv_stage1_p_MORE_HC_OPTS += -debug
+utils/iserv_stage1_dyn_MORE_HC_OPTS += -debug
endif
ifeq "$(GhcThreaded)" "YES"
-utils/iserv_stage2_MORE_HC_OPTS += -threaded
-utils/iserv_stage2_p_MORE_HC_OPTS += -threaded
-utils/iserv_stage2_dyn_MORE_HC_OPTS += -threaded
+utils/iserv_stage1_MORE_HC_OPTS += -threaded
+utils/iserv_stage1_p_MORE_HC_OPTS += -threaded
+utils/iserv_stage1_dyn_MORE_HC_OPTS += -threaded
endif
# Add -Wl,--export-dynamic enables GHCi to load dynamic objects that
@@ -34,9 +34,9 @@ ifeq "$(TargetElf)" "YES"
ifneq "$(TargetOS_CPP)" "solaris2"
# The Solaris linker does not support --export-dynamic option. It also
# does not need it since it exports all dynamic symbols by default
-utils/iserv_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic
-utils/iserv_stage2_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
-utils/iserv_stage2_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/iserv_stage1_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/iserv_stage1_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/iserv_stage1_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
endif
endif
@@ -44,30 +44,30 @@ endif
# program for each way. Note that it's important to do this even for
# the vanilla version, otherwise we get a dynamic executable when
# DYNAMIC_GHC_PROGRAMS=YES.
-utils/iserv_stage2_PROGRAM_WAY = v
-utils/iserv_stage2_p_PROGRAM_WAY = p
-utils/iserv_stage2_dyn_PROGRAM_WAY = dyn
+utils/iserv_stage1_PROGRAM_WAY = v
+utils/iserv_stage1_p_PROGRAM_WAY = p
+utils/iserv_stage1_dyn_PROGRAM_WAY = dyn
-utils/iserv_stage2_PROGNAME = ghc-iserv
-utils/iserv_stage2_p_PROGNAME = ghc-iserv-prof
-utils/iserv_stage2_dyn_PROGNAME = ghc-iserv-dyn
+utils/iserv_stage1_PROGNAME = ghc-iserv
+utils/iserv_stage1_p_PROGNAME = ghc-iserv-prof
+utils/iserv_stage1_dyn_PROGNAME = ghc-iserv-dyn
-utils/iserv_stage2_MORE_HC_OPTS += -no-hs-main
-utils/iserv_stage2_p_MORE_HC_OPTS += -no-hs-main
-utils/iserv_stage2_dyn_MORE_HC_OPTS += -no-hs-main
+utils/iserv_stage1_MORE_HC_OPTS += -no-hs-main
+utils/iserv_stage1_p_MORE_HC_OPTS += -no-hs-main
+utils/iserv_stage1_dyn_MORE_HC_OPTS += -no-hs-main
-utils/iserv_stage2_INSTALL = YES
-utils/iserv_stage2_p_INSTALL = YES
-utils/iserv_stage2_dyn_INSTALL = YES
+utils/iserv_stage1_INSTALL = YES
+utils/iserv_stage1_p_INSTALL = YES
+utils/iserv_stage1_dyn_INSTALL = YES
# Install in $(libexec), not in $(bindir)
-utils/iserv_stage2_TOPDIR = YES
-utils/iserv_stage2_p_TOPDIR = YES
-utils/iserv_stage2_dyn_TOPDIR = YES
+utils/iserv_stage1_TOPDIR = YES
+utils/iserv_stage1_p_TOPDIR = YES
+utils/iserv_stage1_dyn_TOPDIR = YES
-utils/iserv_stage2_INSTALL_INPLACE = YES
-utils/iserv_stage2_p_INSTALL_INPLACE = YES
-utils/iserv_stage2_dyn_INSTALL_INPLACE = YES
+utils/iserv_stage1_INSTALL_INPLACE = YES
+utils/iserv_stage1_p_INSTALL_INPLACE = YES
+utils/iserv_stage1_dyn_INSTALL_INPLACE = YES
ifeq "$(CLEANING)" "YES"
@@ -97,17 +97,17 @@ endif
endif
ifeq "$(NEED_iserv)" "YES"
-$(eval $(call build-prog,utils/iserv,stage2,1))
+$(eval $(call build-prog,utils/iserv,stage1,1))
endif
ifeq "$(NEED_iserv_p)" "YES"
-$(eval $(call build-prog,utils/iserv,stage2_p,1))
+$(eval $(call build-prog,utils/iserv,stage1_p,1))
endif
ifeq "$(NEED_iserv_dyn)" "YES"
-$(eval $(call build-prog,utils/iserv,stage2_dyn,1))
+$(eval $(call build-prog,utils/iserv,stage1_dyn,1))
endif
-all_ghc_stage2 : $(iserv-stage2_INPLACE)
-all_ghc_stage2 : $(iserv-stage2_p_INPLACE)
-all_ghc_stage2 : $(iserv-stage2_dyn_INPLACE)
+all_ghc_stage1 : $(iserv-stage1_INPLACE)
+all_ghc_stage1 : $(iserv-stage1_p_INPLACE)
+all_ghc_stage1 : $(iserv-stage1_dyn_INPLACE)
diff --git a/utils/remote-iserv/ghc.mk b/utils/remote-iserv/ghc.mk
index f0cd9ffa49..0959e709c0 100644
--- a/utils/remote-iserv/ghc.mk
+++ b/utils/remote-iserv/ghc.mk
@@ -15,15 +15,15 @@ utils/remote-iserv_PACKAGE = remote-iserv
utils/remote-iserv_EXECUTABLE = remote-iserv
ifeq "$(GhcDebugged)" "YES"
-utils/remote-iserv_stage2_MORE_HC_OPTS += -debug
-utils/remote-iserv_stage2_p_MORE_HC_OPTS += -debug
-utils/remote-iserv_stage2_dyn_MORE_HC_OPTS += -debug
+utils/remote-iserv_stage1_MORE_HC_OPTS += -debug
+utils/remote-iserv_stage1_p_MORE_HC_OPTS += -debug
+utils/remote-iserv_stage1_dyn_MORE_HC_OPTS += -debug
endif
ifeq "$(GhcThreaded)" "YES"
-utils/remote-iserv_stage2_MORE_HC_OPTS += -threaded
-utils/remote-iserv_stage2_p_MORE_HC_OPTS += -threaded
-utils/remote-iserv_stage2_dyn_MORE_HC_OPTS += -threaded
+utils/remote-iserv_stage1_MORE_HC_OPTS += -threaded
+utils/remote-iserv_stage1_p_MORE_HC_OPTS += -threaded
+utils/remote-iserv_stage1_dyn_MORE_HC_OPTS += -threaded
endif
# Add -Wl,--export-dynamic enables GHCi to load dynamic objects that
@@ -34,9 +34,9 @@ ifeq "$(TargetElf)" "YES"
ifneq "$(TargetOS_CPP)" "solaris2"
# The Solaris linker does not support --export-dynamic option. It also
# does not need it since it exports all dynamic symbols by default
-utils/remote-iserv_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic
-utils/remote-iserv_stage2_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
-utils/remote-iserv_stage2_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/remote-iserv_stage1_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/remote-iserv_stage1_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
+utils/remote-iserv_stage1_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
endif
endif
@@ -44,30 +44,30 @@ endif
# program for each way. Note that it's important to do this even for
# the vanilla version, otherwise we get a dynamic executable when
# DYNAMIC_GHC_PROGRAMS=YES.
-utils/remote-iserv_stage2_PROGRAM_WAY = v
-utils/remote-iserv_stage2_p_PROGRAM_WAY = p
-utils/remote-iserv_stage2_dyn_PROGRAM_WAY = dyn
+utils/remote-iserv_stage1_PROGRAM_WAY = v
+utils/remote-iserv_stage1_p_PROGRAM_WAY = p
+utils/remote-iserv_stage1_dyn_PROGRAM_WAY = dyn
-utils/remote-iserv_stage2_PROGNAME = ghc-iserv
-utils/remote-iserv_stage2_p_PROGNAME = ghc-iserv-prof
-utils/remote-iserv_stage2_dyn_PROGNAME = ghc-iserv-dyn
+utils/remote-iserv_stage1_PROGNAME = ghc-iserv
+utils/remote-iserv_stage1_p_PROGNAME = ghc-iserv-prof
+utils/remote-iserv_stage1_dyn_PROGNAME = ghc-iserv-dyn
-utils/remote-iserv_stage2_MORE_HC_OPTS += -no-hs-main
-utils/remote-iserv_stage2_p_MORE_HC_OPTS += -no-hs-main
-utils/remote-iserv_stage2_dyn_MORE_HC_OPTS += -no-hs-main
+utils/remote-iserv_stage1_MORE_HC_OPTS += -no-hs-main
+utils/remote-iserv_stage1_p_MORE_HC_OPTS += -no-hs-main
+utils/remote-iserv_stage1_dyn_MORE_HC_OPTS += -no-hs-main
-utils/remote-iserv_stage2_INSTALL = YES
-utils/remote-iserv_stage2_p_INSTALL = YES
-utils/remote-iserv_stage2_dyn_INSTALL = YES
+utils/remote-iserv_stage1_INSTALL = YES
+utils/remote-iserv_stage1_p_INSTALL = YES
+utils/remote-iserv_stage1_dyn_INSTALL = YES
# Install in $(libexec), not in $(bindir)
-utils/remote-iserv_stage2_TOPDIR = YES
-utils/remote-iserv_stage2_p_TOPDIR = YES
-utils/remote-iserv_stage2_dyn_TOPDIR = YES
+utils/remote-iserv_stage1_TOPDIR = YES
+utils/remote-iserv_stage1_p_TOPDIR = YES
+utils/remote-iserv_stage1_dyn_TOPDIR = YES
-utils/remote-iserv_stage2_INSTALL_INPLACE = YES
-utils/remote-iserv_stage2_p_INSTALL_INPLACE = YES
-utils/remote-iserv_stage2_dyn_INSTALL_INPLACE = YES
+utils/remote-iserv_stage1_INSTALL_INPLACE = YES
+utils/remote-iserv_stage1_p_INSTALL_INPLACE = YES
+utils/remote-iserv_stage1_dyn_INSTALL_INPLACE = YES
ifeq "$(CLEANING)" "YES"
@@ -97,17 +97,17 @@ endif
endif
ifeq "$(NEED_iserv)" "YES"
-$(eval $(call build-prog,utils/remote-iserv,stage2,1))
+$(eval $(call build-prog,utils/remote-iserv,stage1,1))
endif
ifeq "$(NEED_iserv_p)" "YES"
-$(eval $(call build-prog,utils/remote-iserv,stage2_p,1))
+$(eval $(call build-prog,utils/remote-iserv,stage1_p,1))
endif
ifeq "$(NEED_iserv_dyn)" "YES"
-$(eval $(call build-prog,utils/remote-iserv,stage2_dyn,1))
+$(eval $(call build-prog,utils/remote-iserv,stage1_dyn,1))
endif
-all_ghc_stage2 : $(remote-iserv-stage2_INPLACE)
-all_ghc_stage2 : $(remote-iserv-stage2_p_INPLACE)
-all_ghc_stage2 : $(remote-iserv-stage2_dyn_INPLACE)
+all_ghc_stage1 : $(remote-iserv-stage1_INPLACE)
+all_ghc_stage1 : $(remote-iserv-stage1_p_INPLACE)
+all_ghc_stage1 : $(remote-iserv-stage1_dyn_INPLACE)
diff --git a/utils/runghc/Main.hs b/utils/runghc/Main.hs
index 9ed650410d..8923a1ddfb 100644
--- a/utils/runghc/Main.hs
+++ b/utils/runghc/Main.hs
@@ -63,7 +63,7 @@ main = do
-- if $1_$2_SHELL_WRAPPER = NO (which is always the case on Windows). In such
-- a scenario, we must guess where ghc lives. Given a path where ghc might
-- live, we check for the existence of ghc. If we can't find it, we assume that
--- we're building ghc from source, in which case we fall back on ghc-stage2.
+-- we're building ghc from source, in which case we fall back on ghc-stage1.
-- (See #1185.)
--
-- In-tree Hadrian builds of GHC also happen to give us a wrapper-script-less
@@ -77,7 +77,7 @@ findGhc path = do
ghcExists <- doesFileExist ghc
return $ if ghcExists
then ghc
- else ghcDir </> "ghc-stage2" <.> exeExtension
+ else ghcDir </> "ghc-stage1" <.> exeExtension
data RunGhcFlags = RunGhcFlags (Maybe FilePath) -- GHC location
| Help -- Print help text
diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk
index 65a3ca88d6..e4e33cdca5 100644
--- a/utils/runghc/ghc.mk
+++ b/utils/runghc/ghc.mk
@@ -21,7 +21,7 @@ utils/runghc_dist-install_EXTRA_HC_OPTS = -cpp -DVERSION="\"$(ProjectVersion)\""
# Be explicit about which version of ghc to call (#9054).
define utils/runghc_dist-install_INPLACE_SHELL_WRAPPER_EXTRA
-echo 'ghcprog="$(ghc_stage2_INPLACE_SHELL_WRAPPER_NAME)"' >> "$(WRAPPER)"
+echo 'ghcprog="$(ghc_stage1_INPLACE_SHELL_WRAPPER_NAME)"' >> "$(WRAPPER)"
endef
define utils/runghc_dist-install_INSTALL_SHELL_WRAPPER_EXTRA
echo 'ghcprog="$(ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_NAME)"' >> "$(WRAPPER)"
diff --git a/utils/testremove/ghc.mk b/utils/testremove/ghc.mk
index ac9ef6ce03..048d1cd223 100644
--- a/utils/testremove/ghc.mk
+++ b/utils/testremove/ghc.mk
@@ -3,7 +3,7 @@
utils/testremove_all: utils/testremove/wouldrm utils/testremove/checkremove
utils/testremove/wouldrm: $$@.hs
- $(GHC_STAGE1) --make -O $@
+ $(HC_STAGE1) --make -O $@
utils/testremove/checkremove: $$@.hs
- $(GHC_STAGE1) --make -O $@
+ $(HC_STAGE1) --make -O $@
diff --git a/utils/unlit/ghc.mk b/utils/unlit/ghc.mk
index fe38cbbd0f..84729ab0d0 100644
--- a/utils/unlit/ghc.mk
+++ b/utils/unlit/ghc.mk
@@ -10,19 +10,19 @@
#
# -----------------------------------------------------------------------------
-# built by ghc-stage0
+# built by the preexisting bootstrap hc
utils/unlit_dist_C_SRCS = unlit.c fs.c
utils/unlit_dist_PROGNAME = unlit
utils/unlit_dist_TOPDIR = YES
utils/unlit_dist_INSTALL_INPLACE = YES
-# built by ghc-stage1
+# built by ghc-stage0
utils/unlit_dist-install_C_SRCS = $(utils/unlit_dist_C_SRCS)
utils/unlit_dist-install_PROGNAME = $(utils/unlit_dist_PROGNAME)
utils/unlit_dist-install_TOPDIR = $(utils/unlit_dist_TOPDIR)
utils/unlit_dist-install_INSTALL_INPLACE = NO
-ifeq "$(Stage1Only)" "YES"
+ifeq "$(Stage0Only)" "YES"
utils/unlit_dist_INSTALL = YES
utils/unlit_dist-install_INSTALL = NO
else
diff --git a/validate b/validate
index 6bb3399316..40a53dd004 100755
--- a/validate
+++ b/validate
@@ -404,7 +404,7 @@ if [ $testsuite_only -eq 1 ] ||
if [ "$use_hadrian" = "NO" ] ; then
# Use LOCAL=0, see Note [Running tests in /tmp].
$make -C "$basedir"/testsuite/tests $BINDIST "$PYTHON_ARG" \
- $MAKE_TEST_TARGET stage=2 LOCAL=0 $TEST_VERBOSITY THREADS=$threads \
+ $MAKE_TEST_TARGET stage=1 LOCAL=0 $TEST_VERBOSITY THREADS=$threads \
SUMMARY_FILE="$basedir"/testsuite_summary.txt \
JUNIT_FILE="$basedir"/testsuite.xml \
2>&1 | tee testlog
@@ -413,7 +413,7 @@ if [ $testsuite_only -eq 1 ] ||
# See Note [Why is there no stage1 setup function?].
# Don't use BINDIST=YES, as stage1 is not available in a bindist.
$make -C testsuite/tests/stage1 "$PYTHON_ARG" \
- $MAKE_TEST_TARGET stage=1 LOCAL=0 $TEST_VERBOSITY THREADS=$threads \
+ $MAKE_TEST_TARGET stage=0 LOCAL=0 $TEST_VERBOSITY THREADS=$threads \
SUMMARY_FILE="$basedir"/testsuite_summary_stage1.txt \
JUNIT_FILE="$basedir"/testsuite_stage1.xml \
2>&1 | tee testlog-stage1