提交 bdbac006 编写于 作者: M Michael Sullivan

Build the stage1 compiler against the newly built librustrt.

上级 c62a9fec
# FIXME: temporary hack: stdlib comes in the lib/ directory, but we want it in
# the base directory, so we move it out.
# FIXME: temporary hack: stdlib and rustrt come in the lib/ directory,
# but we want them in the base directory, so we move them out.
stage0/rustc$(X): $(S)src/snapshots.txt $(S)src/etc/get-snapshot.py $(MKFILES)
@$(call E, fetch: $@)
$(Q)$(S)src/etc/get-snapshot.py
......@@ -8,11 +8,8 @@ stage0/rustc$(X): $(S)src/snapshots.txt $(S)src/etc/get-snapshot.py $(MKFILES)
# Host libs will be made in the process of making rustc above.
# FIXME: temporary hack: the runtime is currently carried in
# lib/ directory only, so we copy it out.
stage0/$(CFG_RUNTIME): stage0/lib/$(CFG_RUNTIME)
$(Q)cp $< $@
stage0/$(CFG_RUNTIME): stage0/rustc$(X)
$(Q)touch $@
stage0/$(CFG_STDLIB): stage0/rustc$(X)
$(Q)touch $@
......@@ -31,12 +28,8 @@ stage0/lib/glue.o: stage0/rustc$(X)
stage0/lib/main.o: rt/main.o
$(Q)cp $< $@
stage0/lib/$(CFG_RUNTIME): stage0/rustc$(X)
$(Q)touch $@
# Instantiate template (in stageN.mk) for building
# stage0/lib/$(CFG_STDLIB) and stage0/lib/libstd.rlib.
SREQpre = stage0/lib/main.o $(MKFILES)
$(eval $(call STDLIBGEN,pre,0))
$(eval $(call LIBGEN,pre,0))
......@@ -3,10 +3,11 @@
# The easiest way to read this template is to assume we're building stage2
# using stage1, and mentally gloss $(1) as 1, $(2) as 2.
#
# STDLIBGEN is pulled out seperately because we need to specially invoke
# it to build stage0/lib/libstd using stage0/rustc.
# LIBGEN is pulled out seperately because we need to specially invoke
# it to build stage0/lib/libstd using stage0/rustc and to use the
# new rustrt in stage0/lib/.
define STDLIBGEN
define LIBGEN
stage$(2)/lib/$$(CFG_STDLIB): $$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
stage$(2)/rustc$$(X) \
stage$(2)/$$(CFG_RUNTIME) \
......@@ -24,6 +25,11 @@ stage$(2)/lib/libstd.rlib: $$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
$$(SREQ$(1))
@$$(call E, compile_and_link: $$@)
$$(STAGE$(2)) --lib --static -o $$@ $$<
stage$(2)/lib/$$(CFG_RUNTIME): rt/$$(CFG_RUNTIME)
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
endef
define STAGEN
......@@ -79,16 +85,12 @@ stage$(2)/lib/glue.o: stage$(2)/rustc$$(X) \
@$$(call E, generate: $$@)
$$(STAGE$(2)) -c -o $$@ --glue
$(eval $(call STDLIBGEN,$(1),$(2)))
$(eval $(call LIBGEN,$(1),$(2)))
stage$(2)/lib/main.o: rt/main.o
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
stage$(2)/lib/$$(CFG_RUNTIME): rt/$$(CFG_RUNTIME)
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
stage$(2)/lib/$$(CFG_LIBRUSTC): $$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
$$(SREQ$(2))
@$$(call E, compile_and_link: $$@)
......
......@@ -9,7 +9,7 @@ def unpack_snapshot(snap):
print("opening snapshot " + dl_path)
tar = tarfile.open(dl_path)
kernel = get_kernel()
for name in old_snapshot_files[kernel]:
for name in snapshot_files[kernel]:
p = "rust-stage0/" + name
fp = os.path.join("stage0", name)
print("extracting " + fp)
......
......@@ -23,14 +23,6 @@ snapshot_files = {
"winnt": ["rustc.exe", "lib/glue.o", "lib/std.dll",
"rustrt.dll", "rustllvm.dll", "lib/intrinsics.bc"]
}
old_snapshot_files = {
"linux": ["rustc", "lib/glue.o", "lib/libstd.so",
"lib/librustrt.so", "librustllvm.so", "lib/intrinsics.bc"],
"macos": ["rustc", "lib/glue.o", "lib/libstd.dylib",
"lib/librustrt.dylib", "librustllvm.dylib", "lib/intrinsics.bc"],
"winnt": ["rustc.exe", "lib/glue.o", "lib/std.dll",
"lib/rustrt.dll", "rustllvm.dll", "lib/intrinsics.bc"]
}
def parse_line(n, line):
global snapshotfile
......
S 2011-07-21 c62a9fe
linux-i386 3c8f658093adea1cb0e5b84150d3d342571013b4
macos-i386 1833b475fd1adec3df02ab3dd2fb7c6f280a33a5
winnt-i386 f6b6b42d00f25d82603b9466229d3229bfce3317
S 2011-07-20 8a7f2e0
linux-i386 c4881df0302a4a1e126a7ea847e1d7b4de49b943
macos-i386 d5d486af50fade251fd04a24062385d67cfff30a
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册