Switch to using the rustc driver in the bootstrap process.
This commit is contained in:
parent
02c0501a61
commit
32895ad990
18
Makefile.in
18
Makefile.in
|
@ -44,7 +44,6 @@ endif
|
||||||
CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
|
CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
|
||||||
CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
|
CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
|
||||||
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
|
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
|
||||||
CFG_RUSTCLIB :=$(call CFG_LIB_NAME,rustc)
|
|
||||||
|
|
||||||
# version-string calculation
|
# version-string calculation
|
||||||
CFG_GIT_DIR := $(CFG_SRC_DIR).git
|
CFG_GIT_DIR := $(CFG_SRC_DIR).git
|
||||||
|
@ -107,12 +106,15 @@ VPATH := $(S)doc $(S)src
|
||||||
|
|
||||||
# Compilers we build, we now know how to run.
|
# Compilers we build, we now know how to run.
|
||||||
STAGE0 := $(Q)$(call CFG_RUN_TARG,stage0,\
|
STAGE0 := $(Q)$(call CFG_RUN_TARG,stage0,\
|
||||||
stage0/rustc$(X) $(CFG_RUSTC_FLAGS) -L stage1)
|
stage0/rustc$(X) $(CFG_RUSTC_FLAGS) -L stage0)
|
||||||
STAGE1 := $(Q)$(call CFG_RUN_TARG,stage1, \
|
STAGE1 := $(Q)$(call CFG_RUN_TARG,stage0, \
|
||||||
$(CFG_VALGRIND_COMPILE) stage1/rustc$(X) \
|
$(CFG_VALGRIND_COMPILE) stage1/rustc$(X) \
|
||||||
$(CFG_RUSTC_FLAGS) -L stage2)
|
$(CFG_RUSTC_FLAGS) -L stage1)
|
||||||
STAGE2 := $(Q)$(call CFG_RUN_TARG,stage2, \
|
STAGE2 := $(Q)$(call CFG_RUN_TARG,stage1, \
|
||||||
$(CFG_VALGRIND_COMPILE) stage2/rustc$(X) \
|
$(CFG_VALGRIND_COMPILE) stage2/rustc$(X) \
|
||||||
|
$(CFG_RUSTC_FLAGS) -L stage2)
|
||||||
|
STAGE3 := $(Q)$(call CFG_RUN_TARG,stage2, \
|
||||||
|
$(CFG_VALGRIND_COMPILE) stage3/rustc$(X) \
|
||||||
$(CFG_RUSTC_FLAGS) -L stage3)
|
$(CFG_RUSTC_FLAGS) -L stage3)
|
||||||
|
|
||||||
# "Source" files we generate in builddir along the way.
|
# "Source" files we generate in builddir along the way.
|
||||||
|
@ -146,9 +148,9 @@ COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/comp/, \
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
LREQ := rt/$(CFG_RUNTIME) rustllvm/$(CFG_RUSTLLVM)
|
LREQ := rt/$(CFG_RUNTIME) rustllvm/$(CFG_RUSTLLVM)
|
||||||
SREQ0 := stage0/rustc$(X) $(LREQ) rt/main.o stage1/glue.o stage1/$(CFG_STDLIB)
|
SREQ0 := stage0/rustc$(X) $(LREQ) rt/main.o stage0/glue.o stage0/$(CFG_STDLIB)
|
||||||
SREQ1 := stage1/rustc$(X) $(LREQ) rt/main.o stage2/glue.o stage2/$(CFG_STDLIB)
|
SREQ1 := stage1/rustc$(X) $(LREQ) rt/main.o stage1/glue.o stage1/$(CFG_STDLIB)
|
||||||
SREQ2 := stage2/rustc$(X) $(LREQ) rt/main.o stage3/glue.o stage3/$(CFG_STDLIB)
|
SREQ2 := stage2/rustc$(X) $(LREQ) rt/main.o stage2/glue.o stage2/$(CFG_STDLIB)
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
|
FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
|
||||||
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
|
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
|
||||||
|
|
||||||
stage2/fuzzer.o: $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1) \
|
stage2/fuzzer.o: $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1)
|
||||||
stage2/$(CFG_RUSTCLIB)
|
|
||||||
@$(call E, compile: $@)
|
@$(call E, compile: $@)
|
||||||
$(STAGE1) -c -o $@ $<
|
$(STAGE1) -c -o $@ $<
|
||||||
|
|
||||||
|
|
41
mk/stage1.mk
41
mk/stage1.mk
|
@ -1,31 +1,13 @@
|
||||||
stage1/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) \
|
stage1/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
|
||||||
stage0/rustc$(X) stage0/$(CFG_STDLIB) stage0/intrinsics.bc \
|
stage1/rustc$(X) stage0/$(CFG_STDLIB) stage1/intrinsics.bc \
|
||||||
$(LREQ) $(MKFILES)
|
$(LREQ) $(MKFILES)
|
||||||
@$(call E, compile: $@)
|
@$(call E, compile_and_link: $@)
|
||||||
$(STAGE0) -c --shared -o $@ $<
|
$(STAGE1) --shared -o $@ $<
|
||||||
|
|
||||||
stage1/$(CFG_STDLIB): stage1/std.o stage1/glue.o
|
stage1/glue.o: stage1/rustc$(X) stage0/$(CFG_STDLIB) stage0/intrinsics.bc \
|
||||||
@$(call E, link: $@)
|
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage1/glue.o $(CFG_GCCISH_LINK_FLAGS) \
|
|
||||||
-o $@ $< -Lstage1 -Lrt -lrustrt
|
|
||||||
|
|
||||||
stage1/librustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0)
|
|
||||||
@$(call E, compile: $@)
|
|
||||||
$(STAGE0) -c --shared -o $@ $<
|
|
||||||
|
|
||||||
stage1/$(CFG_RUSTCLIB): stage1/librustc.o stage1/glue.o
|
|
||||||
@$(call E, link: $@)
|
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage1/glue.o $(CFG_GCCISH_LINK_FLAGS) \
|
|
||||||
-o $@ $< -Lstage1 -Lrustllvm -Lrt -lrustrt -lrustllvm -lstd
|
|
||||||
|
|
||||||
stage1/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0)
|
|
||||||
@$(call E, compile: $@)
|
|
||||||
$(STAGE0) -c -o $@ $<
|
|
||||||
|
|
||||||
stage1/glue.o: stage0/rustc$(X) stage0/$(CFG_STDLIB) stage0/intrinsics.bc \
|
|
||||||
$(LREQ) $(MKFILES)
|
$(LREQ) $(MKFILES)
|
||||||
@$(call E, generate: $@)
|
@$(call E, generate: $@)
|
||||||
$(STAGE0) -c -o $@ --glue
|
$(STAGE1) -c -o $@ --glue
|
||||||
|
|
||||||
stage1/intrinsics.bc: $(INTRINSICS_BC)
|
stage1/intrinsics.bc: $(INTRINSICS_BC)
|
||||||
@$(call E, cp: $@)
|
@$(call E, cp: $@)
|
||||||
|
@ -41,11 +23,6 @@ stage1/%.o: stage1/%.s
|
||||||
@$(call E, assemble [gcc]: $@)
|
@$(call E, assemble [gcc]: $@)
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) -o $@ -c $<
|
$(Q)gcc $(CFG_GCCISH_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
stage1/%$(X): stage1/%.o $(SREQ0)
|
stage1/%$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0)
|
||||||
@$(call E, link [gcc]: $@)
|
@$(call E, compile_and_link: $@)
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage1/glue.o -o $@ $< \
|
$(STAGE0) -o $@ $<
|
||||||
-Lstage1 -Lrustllvm -Lrt rt/main.o -lrustrt -lrustllvm -lstd -lm
|
|
||||||
@# dsymutil sometimes fails or prints a warning, but the
|
|
||||||
@# program still runs. Since it simplifies debugging other
|
|
||||||
@# programs, I\'ll live with the noise.
|
|
||||||
-$(Q)$(CFG_DSYMUTIL) $@
|
|
||||||
|
|
41
mk/stage2.mk
41
mk/stage2.mk
|
@ -1,31 +1,13 @@
|
||||||
stage2/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) \
|
stage2/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
|
||||||
stage1/rustc$(X) stage1/$(CFG_STDLIB) stage1/intrinsics.bc \
|
stage2/rustc$(X) stage1/$(CFG_STDLIB) stage2/intrinsics.bc \
|
||||||
$(LREQ) $(MKFILES)
|
$(LREQ) $(MKFILES)
|
||||||
@$(call E, compile: $@)
|
@$(call E, compile_and_link: $@)
|
||||||
$(STAGE1) -c --shared -o $@ $<
|
$(STAGE2) --shared -o $@ $<
|
||||||
|
|
||||||
stage2/$(CFG_STDLIB): stage2/std.o stage2/glue.o
|
stage2/glue.o: stage2/rustc$(X) stage1/$(CFG_STDLIB) stage1/intrinsics.bc \
|
||||||
@$(call E, link: $@)
|
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage2/glue.o $(CFG_GCCISH_LINK_FLAGS) -o \
|
|
||||||
$@ $< -Lstage2 -Lrt -lrustrt
|
|
||||||
|
|
||||||
stage2/librustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1)
|
|
||||||
@$(call E, compile: $@)
|
|
||||||
$(STAGE1) -c --shared -o $@ $<
|
|
||||||
|
|
||||||
stage2/$(CFG_RUSTCLIB): stage2/librustc.o stage2/glue.o
|
|
||||||
@$(call E, link: $@)
|
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage2/glue.o $(CFG_GCCISH_LINK_FLAGS) \
|
|
||||||
-o $@ $< -Lstage2 -Lrustllvm -Lrt -lrustrt -lrustllvm -lstd
|
|
||||||
|
|
||||||
stage2/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1)
|
|
||||||
@$(call E, compile: $@)
|
|
||||||
$(STAGE1) -c -o $@ $<
|
|
||||||
|
|
||||||
stage2/glue.o: stage1/rustc$(X) stage1/$(CFG_STDLIB) stage1/intrinsics.bc \
|
|
||||||
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
|
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
|
||||||
@$(call E, generate: $@)
|
@$(call E, generate: $@)
|
||||||
$(STAGE1) -c -o $@ --glue
|
$(STAGE2) -c -o $@ --glue
|
||||||
|
|
||||||
stage2/intrinsics.bc: $(INTRINSICS_BC)
|
stage2/intrinsics.bc: $(INTRINSICS_BC)
|
||||||
@$(call E, cp: $@)
|
@$(call E, cp: $@)
|
||||||
|
@ -41,11 +23,6 @@ stage2/%.o: stage2/%.s
|
||||||
@$(call E, assemble [gcc]: $@)
|
@$(call E, assemble [gcc]: $@)
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) -o $@ -c $<
|
$(Q)gcc $(CFG_GCCISH_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
stage2/%$(X): stage2/%.o $(SREQ1)
|
stage2/%$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1)
|
||||||
@$(call E, link [gcc]: $@)
|
@$(call E, compile_and_link: $@)
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage2/glue.o -o $@ $< \
|
$(STAGE1) -o $@ $<
|
||||||
-Lstage2 -Lrustllvm -Lrt rt/main.o -lrustrt -lrustllvm -lstd -lm
|
|
||||||
@# dsymutil sometimes fails or prints a warning, but the
|
|
||||||
@# program still runs. Since it simplifies debugging other
|
|
||||||
@# programs, I\'ll live with the noise.
|
|
||||||
-$(Q)$(CFG_DSYMUTIL) $@
|
|
||||||
|
|
17
mk/stage3.mk
17
mk/stage3.mk
|
@ -1,22 +1,13 @@
|
||||||
stage3/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
|
stage3/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
|
||||||
stage2/rustc$(X) stage2/$(CFG_STDLIB) stage2/intrinsics.bc \
|
stage3/rustc$(X) stage2/$(CFG_STDLIB) stage3/intrinsics.bc \
|
||||||
$(LREQ) $(MKFILES)
|
$(LREQ) $(MKFILES)
|
||||||
@$(call E, compile_and_link: $@)
|
@$(call E, compile_and_link: $@)
|
||||||
$(STAGE2) --shared -o $@ $<
|
$(STAGE3) --shared -o $@ $<
|
||||||
|
|
||||||
stage3/librustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ2)
|
stage3/glue.o: stage3/rustc$(X) stage2/$(CFG_STDLIB) stage3/intrinsics.bc \
|
||||||
@$(call E, compile: $@)
|
|
||||||
$(STAGE2) -c --shared -o $@ $<
|
|
||||||
|
|
||||||
stage3/$(CFG_RUSTCLIB): stage2/librustc.o stage2/glue.o
|
|
||||||
@$(call E, link: $@)
|
|
||||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage2/glue.o $(CFG_GCCISH_LINK_FLAGS) \
|
|
||||||
-o $@ $< -Lstage2 -Lrustllvm -Lrt -lrustrt -lrustllvm -lstd
|
|
||||||
|
|
||||||
stage3/glue.o: stage2/rustc$(X) stage2/$(CFG_STDLIB) stage2/intrinsics.bc \
|
|
||||||
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
|
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
|
||||||
@$(call E, generate: $@)
|
@$(call E, generate: $@)
|
||||||
$(STAGE2) -c -o $@ --glue
|
$(STAGE3) -c -o $@ --glue
|
||||||
|
|
||||||
stage3/intrinsics.bc: $(INTRINSICS_BC)
|
stage3/intrinsics.bc: $(INTRINSICS_BC)
|
||||||
@$(call E, cp: $@)
|
@$(call E, cp: $@)
|
||||||
|
|
Loading…
Reference in New Issue