Skip to content

Commit

Permalink
Move llvm out of stageN/lib so that the host building stage 1+ can
Browse files Browse the repository at this point in the history
have a newer and incompatible llvm with the bots.
  • Loading branch information
cixtor committed Jul 11, 2011
1 parent c893188 commit d151e18
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ X := $(CFG_EXE_SUFFIX)
VPATH := $(S)doc $(S)src

# Compilers we build, we now know how to run.
STAGE0 := $(Q)$(call CFG_RUN_TARG,stage0,\
STAGE0 := $(Q)$(call CFG_RUN_TARG,stage0,stage0,\
stage0/rustc$(X) $(CFG_RUSTC_FLAGS))
STAGE1 := $(Q)$(call CFG_RUN_TARG,stage0, \
STAGE1 := $(Q)$(call CFG_RUN_TARG,stage1,stage0, \
$(CFG_VALGRIND_COMPILE) stage1/rustc$(X) \
$(CFG_RUSTC_FLAGS))
STAGE2 := $(Q)$(call CFG_RUN_TARG,stage1, \
STAGE2 := $(Q)$(call CFG_RUN_TARG,stage2,stage1, \
$(CFG_VALGRIND_COMPILE) stage2/rustc$(X) \
$(CFG_RUSTC_FLAGS))
STAGE3 := $(Q)$(call CFG_RUN_TARG,stage2, \
STAGE3 := $(Q)$(call CFG_RUN_TARG,stage3,stage2, \
$(CFG_VALGRIND_COMPILE) stage3/rustc$(X) \
$(CFG_RUSTC_FLAGS))

Expand Down
8 changes: 4 additions & 4 deletions mk/clean.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ clean:
$(Q)rm -f $(CRATE_DEPFILES:%.d=%.d.tmp)
$(Q)rm -f $(GENERATED)
$(Q)rm -f stage0/rustc$(X) stage0/lib/$(CFG_STDLIB) stage0/lib/glue*
$(Q)rm -f stage0/lib/$(CFG_RUNTIME) stage0/lib/$(CFG_RUSTLLVM)
$(Q)rm -f stage0/lib/$(CFG_RUNTIME) stage0/$(CFG_RUSTLLVM)
$(Q)rm -f stage1/rustc$(X) stage1/lib/$(CFG_STDLIB) stage1/lib/glue*
$(Q)rm -f stage1/lib/$(CFG_RUNTIME) stage1/lib/$(CFG_RUSTLLVM)
$(Q)rm -f stage1/lib/$(CFG_RUNTIME) stage1/$(CFG_RUSTLLVM)
$(Q)rm -f stage2/rustc$(X) stage2/lib/$(CFG_STDLIB) stage2/lib/glue*
$(Q)rm -f stage2/lib/$(CFG_RUNTIME) stage2/lib/$(CFG_RUSTLLVM)
$(Q)rm -f stage2/lib/$(CFG_RUNTIME) stage2/$(CFG_RUSTLLVM)
$(Q)rm -f stage3/rustc$(X) stage3/lib/$(CFG_STDLIB) stage3/lib/glue*
$(Q)rm -f stage3/lib/$(CFG_RUNTIME) stage3/lib/$(CFG_RUSTLLVM)
$(Q)rm -f stage3/lib/$(CFG_RUNTIME) stage3/$(CFG_RUSTLLVM)
$(Q)rm -f rustllvm/$(CFG_RUSTLLVM) rustllvm/rustllvmbits.a
$(Q)rm -f rt/$(CFG_RUNTIME)
$(Q)rm -f rt/main.o
Expand Down
5 changes: 3 additions & 2 deletions mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ ifdef CFG_UNIXY

CFG_PATH_MUNGE := true
CFG_EXE_SUFFIX :=
CFG_RUN_TARG=$(CFG_LDENV)=$(CFG_BUILD_DIR)/$(1)/lib $(2)
CFG_RUN_TARG=\
$(CFG_LDENV)=$(CFG_BUILD_DIR)/$(1):$(CFG_BUILD_DIR)/$(2)/lib $(3)
CFG_RUN_TEST=\
$(CFG_LDENV)=$(call CFG_TESTLIB,$(1)) \
$(CFG_VALGRIND) $(1)
Expand Down Expand Up @@ -118,7 +119,7 @@ ifdef CFG_WINDOWSY
CFG_LDPATH :=$(CFG_LLVM_BINDIR)
CFG_LDPATH :=$(CFG_LDPATH):$$PATH
CFG_RUN_TEST=PATH="$(CFG_LDPATH):$(call CFG_TESTLIB,$(1))" $(1)
CFG_RUN_TARG=PATH="$(CFG_BUILD_DIR)/$(1)/lib:$(CFG_LDPATH)" $(2)
CFG_RUN_TARG=PATH="$(CFG_BUILD_DIR)/$(2)/lib:$(CFG_LDPATH)" $(3)

ifndef CFG_ENABLE_MINGW_CROSS
CFG_PATH_MUNGE := $(strip perl -i.bak -p \
Expand Down
2 changes: 1 addition & 1 deletion mk/pp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L no-reformat)
reformat: $(SREQ1)
@$(call E, reformat [stage1]: $@)
for i in $(PP_INPUTS_FILTERED); \
do $(call CFG_RUN_TARG,stage0, stage1/rustc$(X)) \
do $(call CFG_RUN_TARG,stage0,stage0,stage1/rustc$(X)) \
--pretty normal $$i >$$i.tmp; \
if cmp --silent $$i.tmp $$i; \
then echo no changes to $$i; rm $$i.tmp; \
Expand Down
6 changes: 3 additions & 3 deletions mk/snap.mk
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

snap-stage1: stage1/rustc$(X) stage1/lib/glue.o stage1/lib/$(CFG_STDLIB) \
stage1/lib/libstd.rlib stage1/lib/$(CFG_RUNTIME) \
stage1/lib/$(CFG_RUSTLLVM)
stage1/$(CFG_RUSTLLVM)
$(S)src/etc/make-snapshot.py stage1

snap-stage2: stage2/rustc$(X) stage2/lib/glue.o stage2/lib/$(CFG_STDLIB) \
stage2/lib/libstd.rlib stage2/lib/$(CFG_RUNTIME) \
stage2/lib/$(CFG_RUSTLLVM)
stage2/$(CFG_RUSTLLVM)
$(S)src/etc/make-snapshot.py stage2

snap-stage3: stage3/rustc$(X) stage3/lib/glue.o stage3/lib/$(CFG_STDLIB) \
stage3/lib/libstd.rlib stage3/lib/$(CFG_RUNTIME) \
stage3/lib/$(CFG_RUSTLLVM)
stage3/$(CFG_RUSTLLVM)
$(S)src/etc/make-snapshot.py stage3

6 changes: 6 additions & 0 deletions mk/stage0.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ stage0/lib/$(CFG_STDLIB): stage0/rustc$(X)

stage0/intrinsics.bc: stage0/rustc$(X)
$(Q)touch $@

stage0/lib/$(CFG_RUSTLLVM): stage0/rustc$(X)
$(Q)touch $@

stage0/lib/$(CFG_RUNTIME): stage0/rustc$(X)
$(Q)touch $@
9 changes: 5 additions & 4 deletions mk/stage1.mk
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
stage1/lib/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage1/rustc$(X) stage0/lib/$(CFG_STDLIB) stage1/intrinsics.bc \
stage1/lib/$(CFG_RUNTIME) stage1/lib/$(CFG_RUSTLLVM) \
stage1/lib/$(CFG_RUNTIME) stage1/$(CFG_RUSTLLVM) \
stage1/lib/glue.o $(LREQ) $(MKFILES)
@$(call E, compile_and_link: $@)
$(STAGE1) --lib -o $@ $<

stage1/lib/libstd.rlib: $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage1/rustc$(X) stage0/lib/$(CFG_STDLIB) stage1/intrinsics.bc \
stage1/lib/$(CFG_RUNTIME) stage1/lib/$(CFG_RUSTLLVM) \
stage1/lib/$(CFG_RUNTIME) stage1/$(CFG_RUSTLLVM) \
stage1/lib/glue.o $(LREQ) $(MKFILES)
@$(call E, compile_and_link: $@)
$(STAGE1) --lib --static -o $@ $<

stage1/lib/glue.o: stage1/rustc$(X) stage0/lib/$(CFG_STDLIB) \
stage1/intrinsics.bc $(LREQ) $(MKFILES)
stage1/intrinsics.bc stage1/$(CFG_RUSTLLVM) \
stage0/lib/$(CFG_RUNTIME)
@$(call E, generate: $@)
$(STAGE1) -c -o $@ --glue

Expand All @@ -25,7 +26,7 @@ stage1/lib/$(CFG_RUNTIME): rt/$(CFG_RUNTIME)
@$(call E, cp: $@)
$(Q)cp $< $@

stage1/lib/$(CFG_RUSTLLVM): rustllvm/$(CFG_RUSTLLVM)
stage1/$(CFG_RUSTLLVM): rustllvm/$(CFG_RUSTLLVM)
@$(call E, cp: $@)
$(Q)cp $< $@

Expand Down
9 changes: 5 additions & 4 deletions mk/stage2.mk
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
stage2/lib/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage2/rustc$(X) stage1/lib/$(CFG_STDLIB) stage2/intrinsics.bc \
stage2/lib/$(CFG_RUNTIME) stage2/lib/$(CFG_RUSTLLVM) \
stage2/lib/$(CFG_RUNTIME) stage2/$(CFG_RUSTLLVM) \
stage2/lib/glue.o $(LREQ) $(MKFILES)
@$(call E, compile_and_link: $@)
$(STAGE2) --lib -o $@ $<

stage2/lib/libstd.rlib: $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage2/rustc$(X) stage1/lib/$(CFG_STDLIB) stage2/intrinsics.bc \
stage2/lib/$(CFG_RUNTIME) stage2/lib/$(CFG_RUSTLLVM) \
stage2/lib/$(CFG_RUNTIME) stage2/$(CFG_RUSTLLVM) \
stage2/lib/glue.o $(LREQ) $(MKFILES)
@$(call E, compile_and_link: $@)
$(STAGE2) --lib --static -o $@ $<

stage2/lib/glue.o: stage2/rustc$(X) stage1/lib/$(CFG_STDLIB) \
stage2/intrinsics.bc rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
stage2/intrinsics.bc stage2/$(CFG_RUSTLLVM) \
stage1/lib/$(CFG_RUNTIME)
@$(call E, generate: $@)
$(STAGE2) -c -o $@ --glue

Expand All @@ -25,7 +26,7 @@ stage2/lib/$(CFG_RUNTIME): rt/$(CFG_RUNTIME)
@$(call E, cp: $@)
$(Q)cp $< $@

stage2/lib/$(CFG_RUSTLLVM): rustllvm/$(CFG_RUSTLLVM)
stage2/$(CFG_RUSTLLVM): rustllvm/$(CFG_RUSTLLVM)
@$(call E, cp: $@)
$(Q)cp $< $@

Expand Down
9 changes: 5 additions & 4 deletions mk/stage3.mk
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
stage3/lib/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage3/rustc$(X) stage2/lib/$(CFG_STDLIB) stage3/intrinsics.bc \
stage3/lib/$(CFG_RUNTIME) stage3/lib/$(CFG_RUSTLLVM) \
stage3/lib/$(CFG_RUNTIME) stage3/$(CFG_RUSTLLVM) \
stage3/lib/glue.o $(LREQ) $(MKFILES)
@$(call E, compile_and_link: $@)
$(STAGE3) --lib -o $@ $<

stage3/lib/libstd.rlib: $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage3/rustc$(X) stage2/lib/$(CFG_STDLIB) stage3/intrinsics.bc \
stage3/lib/$(CFG_RUNTIME) stage3/lib/$(CFG_RUSTLLVM) \
stage3/lib/$(CFG_RUNTIME) stage3/$(CFG_RUSTLLVM) \
stage3/lib/glue.o $(LREQ) $(MKFILES)
@$(call E, compile_and_link: $@)
$(STAGE3) --lib --static -o $@ $<

stage3/lib/glue.o: stage3/rustc$(X) stage2/lib/$(CFG_STDLIB) \
stage3/intrinsics.bc rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
stage3/intrinsics.bc stage3/$(CFG_RUSTLLVM) \
stage2/lib/$(CFG_RUNTIME)
@$(call E, generate: $@)
$(STAGE3) -c -o $@ --glue

Expand All @@ -25,7 +26,7 @@ stage3/lib/$(CFG_RUNTIME): rt/$(CFG_RUNTIME)
@$(call E, cp: $@)
$(Q)cp $< $@

stage3/lib/$(CFG_RUSTLLVM): rustllvm/$(CFG_RUSTLLVM)
stage3/$(CFG_RUSTLLVM): rustllvm/$(CFG_RUSTLLVM)
@$(call E, cp: $@)
$(Q)cp $< $@

Expand Down
2 changes: 1 addition & 1 deletion src/etc/get-snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def unpack_snapshot(snap):
print("opening snapshot " + dl_path)
tar = tarfile.open(dl_path)
kernel = get_kernel()
for name in snapshot_files[kernel]:
for name in old_snapshot_files[kernel]:
p = "rust-stage0/" + name
fp = os.path.join("stage0", name)
print("extracting " + fp)
Expand Down
11 changes: 10 additions & 1 deletion src/etc/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def scrub(b):
download_dir_base = "dl"
download_unpack_base = os.path.join(download_dir_base, "unpack")

snapshot_files = {
old_snapshot_files = {
"linux": ["rustc", "lib/glue.o", "lib/libstd.so", "lib/libstd.rlib",
"lib/librustrt.so", "lib/librustllvm.so", "intrinsics.bc"],
"macos": ["rustc", "lib/glue.o", "lib/libstd.dylib", "lib/libstd.rlib",
Expand All @@ -24,6 +24,15 @@ def scrub(b):
"lib/rustrt.dll", "lib/rustllvm.dll", "intrinsics.bc"]
}

snapshot_files = {
"linux": ["rustc", "lib/glue.o", "lib/libstd.so", "lib/libstd.rlib",
"lib/librustrt.so", "librustllvm.so", "intrinsics.bc"],
"macos": ["rustc", "lib/glue.o", "lib/libstd.dylib", "lib/libstd.rlib",
"lib/librustrt.dylib", "librustllvm.dylib", "intrinsics.bc"],
"winnt": ["rustc.exe", "lib/glue.o", "lib/std.dll", "lib/libstd.rlib",
"lib/rustrt.dll", "rustllvm.dll", "intrinsics.bc"]
}

def parse_line(n, line):
global snapshotfile

Expand Down

0 comments on commit d151e18

Please sign in to comment.