Skip to content

Commit 1d73010

Browse files
msullivanbrson
authored andcommitted
---
yaml --- r: 4043 b: refs/heads/master c: d9286c8 h: refs/heads/master i: 4041: 8786306 4039: dd28794 v: v3
1 parent a71dd7a commit 1d73010

File tree

4 files changed

+42
-30
lines changed

4 files changed

+42
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: ea371a3d37f4e7653b73caae225bb9459956a6f8
2+
refs/heads/master: d9286c8bdd7f90d1d1cf69281781bdf358238fb8

trunk/mk/stage0.mk

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1+
# FIXME: temporary hack: stdlib comes in the lib/ directory, but we want it in
2+
# the base directory, so we move it out.
13
stage0/rustc$(X): $(S)src/snapshots.txt $(S)src/etc/get-snapshot.py $(MKFILES)
24
@$(call E, fetch: $@)
35
$(Q)$(S)src/etc/get-snapshot.py
6+
$(Q)mv stage0/lib/$(CFG_STDLIB) stage0/$(CFG_STDLIB)
47
$(Q)touch $@
58

69
# Host libs will be made in the process of making rustc above.
710

8-
# FIXME: temporary hack: the first two are currently carried in
9-
# lib/ directory only, so we copy them out.
11+
# FIXME: temporary hack: the runtime is currently carried in
12+
# lib/ directory only, so we copy it out.
1013

1114
stage0/$(CFG_RUNTIME): stage0/lib/$(CFG_RUNTIME)
1215
$(Q)cp $< $@
1316

14-
stage0/$(CFG_STDLIB): stage0/lib/$(CFG_STDLIB)
15-
$(Q)cp $< $@
17+
stage0/$(CFG_STDLIB): stage0/rustc$(X)
18+
$(Q)touch $@
1619

1720
stage0/$(CFG_RUSTLLVM): stage0/rustc$(X)
1821
$(Q)touch $@
@@ -28,11 +31,10 @@ stage0/lib/glue.o: stage0/rustc$(X)
2831
stage0/lib/main.o: rt/main.o
2932
$(Q)cp $< $@
3033

34+
3135
stage0/lib/$(CFG_RUNTIME): stage0/rustc$(X)
3236
$(Q)touch $@
3337

34-
stage0/lib/$(CFG_STDLIB): stage0/rustc$(X)
35-
$(Q)touch $@
38+
# stage0/lib/$(CFG_STDLIB) and stage0/lib/libstd.rlib rules are generated
39+
# in stageN.mk
3640

37-
stage0/lib/libstd.rlib: stage0/rustc$(X)
38-
$(Q)touch $@

trunk/mk/stageN.mk

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
#
33
# The easiest way to read this template is to assume we're building stage2
44
# using stage1, and mentally gloss $(1) as 1, $(2) as 2.
5+
#
6+
# STDLIBGEN is pulled out seperately because we need to specially invoke
7+
# it to build stage0/lib/libstd using stage0/rustc.
8+
9+
define STDLIBGEN
10+
stage$(2)/lib/$$(CFG_STDLIB): $$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
11+
stage$(2)/rustc$$(X) \
12+
stage$(2)/$$(CFG_RUNTIME) \
13+
stage$(2)/$$(CFG_RUSTLLVM) \
14+
stage$(2)/lib/glue.o \
15+
$$(SREQ$(1))
16+
@$$(call E, compile_and_link: $$@)
17+
$$(STAGE$(2)) --lib -o $$@ $$<
18+
19+
stage$(2)/lib/libstd.rlib: $$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
20+
stage$(2)/rustc$$(X) \
21+
stage$(2)/$$(CFG_RUNTIME) \
22+
stage$(2)/$$(CFG_RUSTLLVM) \
23+
stage$(2)/lib/glue.o \
24+
$$(SREQ$(1))
25+
@$$(call E, compile_and_link: $$@)
26+
$$(STAGE$(2)) --lib --static -o $$@ $$<
27+
endef
528

629
define STAGEN
730

@@ -56,24 +79,7 @@ stage$(2)/lib/glue.o: stage$(2)/rustc$$(X) \
5679
@$$(call E, generate: $$@)
5780
$$(STAGE$(2)) -c -o $$@ --glue
5881

59-
stage$(2)/lib/$$(CFG_STDLIB): $$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
60-
stage$(2)/rustc$$(X) \
61-
stage$(2)/$$(CFG_RUNTIME) \
62-
stage$(2)/$$(CFG_RUSTLLVM) \
63-
stage$(2)/lib/glue.o \
64-
$$(SREQ$(1))
65-
@$$(call E, compile_and_link: $$@)
66-
$$(STAGE$(2)) --lib -o $$@ $$<
67-
68-
stage$(2)/lib/libstd.rlib: $$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
69-
stage$(2)/rustc$$(X) \
70-
stage$(2)/$$(CFG_RUNTIME) \
71-
stage$(2)/$$(CFG_RUSTLLVM) \
72-
stage$(2)/lib/glue.o \
73-
$$(SREQ$(1))
74-
@$$(call E, compile_and_link: $$@)
75-
$$(STAGE$(2)) --lib --static -o $$@ $$<
76-
82+
$(eval $(call STDLIBGEN,$(1),$(2)))
7783

7884
stage$(2)/lib/main.o: rt/main.o
7985
@$$(call E, cp: $$@)
@@ -90,6 +96,10 @@ stage$(2)/lib/$$(CFG_LIBRUSTC): $$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
9096

9197
endef
9298

99+
# Instantiate template for building initial stdlib
100+
SREQpre = stage0/lib/main.o $(MKFILES)
101+
$(eval $(call STDLIBGEN,pre,0))
102+
93103
# Instantiate template for 0->1, 1->2, 2->3 build dirs
94104

95105
$(eval $(call STAGEN,0,1))

trunk/src/etc/snapshot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ def scrub(b):
1616
download_unpack_base = os.path.join(download_dir_base, "unpack")
1717

1818
snapshot_files = {
19-
"linux": ["rustc", "lib/glue.o", "lib/libstd.so", "lib/libstd.rlib",
19+
"linux": ["rustc", "lib/glue.o", "lib/libstd.so",
2020
"lib/librustrt.so", "librustllvm.so", "lib/intrinsics.bc"],
21-
"macos": ["rustc", "lib/glue.o", "lib/libstd.dylib", "lib/libstd.rlib",
21+
"macos": ["rustc", "lib/glue.o", "lib/libstd.dylib",
2222
"lib/librustrt.dylib", "librustllvm.dylib", "lib/intrinsics.bc"],
23-
"winnt": ["rustc.exe", "lib/glue.o", "lib/std.dll", "lib/libstd.rlib",
23+
"winnt": ["rustc.exe", "lib/glue.o", "lib/std.dll",
2424
"lib/rustrt.dll", "rustllvm.dll", "lib/intrinsics.bc"]
2525
}
2626

0 commit comments

Comments
 (0)