build: Generate an object file for stage0/libstd.dylib

This commit is contained in:
Patrick Walton 2011-03-24 18:43:32 -07:00
parent 1c8a2598fb
commit 0b9cf7902c
2 changed files with 24 additions and 12 deletions

View File

@ -99,8 +99,7 @@ ifdef CFG_UNIXY
CFG_PATH_MUNGE := true
CFG_EXE_SUFFIX :=
CFG_LDPATH :=$(CFG_LDPATH):$(CFG_LLVM_LIBDIR)
CFG_RUN_TARG=\
$(CFG_LDENV)=$(dir $(firstword $(1))):$(CFG_LDPATH) $(1)
CFG_RUN_TARG=$(CFG_LDENV)=$(CFG_LDPATH) $(1)
CFG_RUN_TEST=\
$(CFG_LDENV)=$(dir $(firstword $(1))):$(CFG_LDPATH) \
$(CFG_VALGRIND) $(1)
@ -140,7 +139,7 @@ CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
CFG_LLC_CFLAGS := -march=x86
CFG_LLC_CFLAGS := -march=x86 -relocation-model=pic
ifdef CFG_GCC
CFG_INFO := $(info cfg: using gcc)
@ -438,21 +437,33 @@ boot/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
@$(call E, compile: $@)
$(BOOT) -shared -o $@ $<
stage0/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage0/rustc$(X) $(MKFILES)
stage0/std.bc: $(STDLIB_CRATE) $(STDLIB_INPUTS) stage0/rustc$(X) $(MKFILES)
@$(call E, compile: $@)
$(STAGE0) -shared -o $@ $<
stage1/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage1/rustc$(X) $(MKFILES)
stage0/$(CFG_STDLIB): stage0/std.o stage0/glue.o
@$(call E, link: $@)
$(Q)gcc $(CFG_GCC_CFLAGS) stage0/glue.o $(CFG_GCC_LINK_FLAGS) -o $@ $< \
-Lstage0 -Lrt -lrustrt
stage1/std.bc: $(STDLIB_CRATE) $(STDLIB_INPUTS) stage1/rustc$(X) $(MKFILES)
@$(call E, compile: $@)
$(STAGE1) -shared -o $@ $<
stage2/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage2/rustc$(X) $(MKFILES)
stage1/$(CFG_STDLIB): stage1/std.o stage1/glue.o
@$(call E, link: $@)
$(Q)gcc $(CFG_GCC_CFLAGS) stage1/glue.o $(CFG_GCC_LINK_FLAGS) -o $@ $< \
-Lstage1 -Lrt -lrustrt
stage2/std.bc: $(STDLIB_CRATE) $(STDLIB_INPUTS) stage2/rustc$(X) $(MKFILES)
@$(call E, compile: $@)
$(STAGE2) -shared -o $@ $<
stage2/$(CFG_STDLIB): stage2/std.o stage2/glue.o
@$(call E, link: $@)
$(Q)gcc $(CFG_GCC_CFLAGS) stage2/glue.o $(CFG_GCC_LINK_FLAGS) -o $@ $< \
-Lstage2 -Lrt -lrustrt
stage0/rustc$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) \
@ -475,17 +486,17 @@ stage2/rustc$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) \
stage0/glue.bc: stage0/rustc$(X) stage0/$(CFG_STDLIB) \
stage0/glue.bc: stage0/rustc$(X) boot/$(CFG_STDLIB) \
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
@$(call E, generate: $@)
$(STAGE0) -o $@ -glue
stage1/glue.bc: stage1/rustc$(X) stage1/$(CFG_STDLIB) \
stage1/glue.bc: stage1/rustc$(X) stage0/$(CFG_STDLIB) \
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
@$(call E, generate: $@)
$(STAGE1) -o $@ -glue
stage2/glue.bc: stage2/rustc$(X) stage2/$(CFG_STDLIB) \
stage2/glue.bc: stage2/rustc$(X) stage1/$(CFG_STDLIB) \
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
@$(call E, generate: $@)
$(STAGE2) -o $@ -glue

View File

@ -13,6 +13,7 @@ rand_free
rand_new
rand_next
refcount
rust_dirent_filename
rust_file_is_dir
rust_get_stdin
rust_get_stdout