build: Build intrinsics.bc

This commit is contained in:
Patrick Walton 2011-05-04 18:28:30 -07:00
parent add7d34164
commit 04f966f0bc
7 changed files with 48 additions and 8 deletions

View File

@ -137,6 +137,12 @@ SREQ2 := stage2/rustc$(X) $(LREQ) stage3/glue.o stage3/$(CFG_STDLIB)
export CFG_SRC_DIR export CFG_SRC_DIR
######################################################################
# Subprograms
######################################################################
LLVM_AS := $(CFG_LLVM_BINDIR)/llvm-as
###################################################################### ######################################################################
# Single-target rules # Single-target rules
@ -145,17 +151,21 @@ export CFG_SRC_DIR
all: rt/$(CFG_RUNTIME) \ all: rt/$(CFG_RUNTIME) \
rustllvm/$(CFG_RUSTLLVM) \ rustllvm/$(CFG_RUSTLLVM) \
stage0/$(CFG_STDLIB) \ stage0/$(CFG_STDLIB) \
stage0/intrinsics.bc \
stage0/rustc$(X) \ stage0/rustc$(X) \
$(GENERATED) \ $(GENERATED) \
$(DOCS) \ $(DOCS) \
stage1/$(CFG_STDLIB) \ stage1/$(CFG_STDLIB) \
stage1/intrinsics.bc \
stage1/glue.o \ stage1/glue.o \
stage1/rustc$(X) \ stage1/rustc$(X) \
stage2/$(CFG_STDLIB) \ stage2/$(CFG_STDLIB) \
stage2/intrinsics.bc \
stage2/glue.o \ stage2/glue.o \
stage2/rustc$(X) \ stage2/rustc$(X) \
stage3/$(CFG_STDLIB) \ stage3/$(CFG_STDLIB) \
stage3/glue.o \ stage3/glue.o \
stage3/intrinsics.bc \
stage3/rustc$(X) stage3/rustc$(X)
@ -172,6 +182,7 @@ config.mk: $(S)configure $(S)Makefile.in
# Additional makefiles # Additional makefiles
###################################################################### ######################################################################
include $(CFG_SRC_DIR)/mk/intrinsics.mk
include $(CFG_SRC_DIR)/mk/stage0.mk include $(CFG_SRC_DIR)/mk/stage0.mk
include $(CFG_SRC_DIR)/mk/stage1.mk include $(CFG_SRC_DIR)/mk/stage1.mk
include $(CFG_SRC_DIR)/mk/stage2.mk include $(CFG_SRC_DIR)/mk/stage2.mk

7
configure vendored
View File

@ -122,6 +122,7 @@ need_cmd find
need_cmd uname need_cmd uname
need_cmd date need_cmd date
need_cmd tr need_cmd tr
need_cmd sed
msg "inspecting environment" msg "inspecting environment"
@ -215,6 +216,10 @@ then
--version \ --version \
| grep version \ | grep version \
| cut -d ' ' -f 5-) | cut -d ' ' -f 5-)
CFG_LLVM_TRIPLE=$("$CFG_LLVM_BINDIR/llc" \
--version \
| grep Host: \
| cut -d ' ' -f 4-)
elif [ ! -z "$CFG_LLVM_CONFIG" ] elif [ ! -z "$CFG_LLVM_CONFIG" ]
then then
CFG_LLVM_VERSION=$(llvm-config --version) CFG_LLVM_VERSION=$(llvm-config --version)
@ -224,6 +229,7 @@ then
CFG_LLVM_CXXFLAGS=$(llvm-config --cxxflags) CFG_LLVM_CXXFLAGS=$(llvm-config --cxxflags)
CFG_LLVM_LDFLAGS=$(llvm-config --ldflags) CFG_LLVM_LDFLAGS=$(llvm-config --ldflags)
CFG_LLVM_LIBS=$(llvm-config --libs) CFG_LLVM_LIBS=$(llvm-config --libs)
CFG_LLVM_TRIPLE=$(llvm-config --host-target)
else else
err "either the \"CFG_LLVM_ROOT\" environment variable must be set, or a \ err "either the \"CFG_LLVM_ROOT\" environment variable must be set, or a \
\"llvm-config\" script must be present" \"llvm-config\" script must be present"
@ -244,6 +250,7 @@ putvar CFG_LLVM_LIBDIR
putvar CFG_LLVM_CXXFLAGS putvar CFG_LLVM_CXXFLAGS
putvar CFG_LLVM_LDFLAGS putvar CFG_LLVM_LDFLAGS
putvar CFG_LLVM_LIBS putvar CFG_LLVM_LIBS
putvar CFG_LLVM_TRIPLE
# Munge any paths that appear in config.mk back to posix-y # Munge any paths that appear in config.mk back to posix-y
perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' \ perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' \

View File

@ -10,3 +10,9 @@ stage0/glue.o: stage0/rustc$(X)
stage0/$(CFG_STDLIB): stage0/rustc$(X) stage0/$(CFG_STDLIB): stage0/rustc$(X)
$(Q)touch $@ $(Q)touch $@
# TODO: Include as part of the snapshot.
stage0/intrinsics.bc: $(INTRINSICS_BC)
@$(call E, cp: $@)
$(Q)cp $< $@

View File

@ -1,5 +1,6 @@
stage1/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) \ stage1/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) \
stage0/rustc$(X) stage0/$(CFG_STDLIB) $(LREQ) $(MKFILES) stage0/rustc$(X) stage0/$(CFG_STDLIB) stage0/intrinsics.bc \
$(LREQ) $(MKFILES)
@$(call E, compile: $@) @$(call E, compile: $@)
$(STAGE0) -c --shared -o $@ $< $(STAGE0) -c --shared -o $@ $<
@ -12,10 +13,15 @@ stage1/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0)
@$(call E, compile: $@) @$(call E, compile: $@)
$(STAGE0) -c -o $@ $< $(STAGE0) -c -o $@ $<
stage1/glue.o: stage0/rustc$(X) stage0/$(CFG_STDLIB) $(LREQ) $(MKFILES) stage1/glue.o: stage0/rustc$(X) stage0/$(CFG_STDLIB) stage0/intrinsics.bc \
$(LREQ) $(MKFILES)
@$(call E, generate: $@) @$(call E, generate: $@)
$(STAGE0) -c -o $@ --glue $(STAGE0) -c -o $@ --glue
stage1/intrinsics.bc: $(INTRINSICS_BC)
@$(call E, cp: $@)
$(Q)cp $< $@
# Due to make not wanting to run the same implicit rules twice on the same # Due to make not wanting to run the same implicit rules twice on the same
# rule tree (implicit-rule recursion prevention, see "Chains of Implicit # rule tree (implicit-rule recursion prevention, see "Chains of Implicit
# Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here # Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here

View File

@ -1,4 +1,5 @@
stage2/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) stage1/rustc$(X) $(MKFILES) stage2/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) stage1/rustc$(X) \
stage1/intrinsics.bc $(MKFILES)
@$(call E, compile: $@) @$(call E, compile: $@)
$(STAGE1) -c --shared -o $@ $< $(STAGE1) -c --shared -o $@ $<
@ -11,11 +12,15 @@ stage2/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1)
@$(call E, compile: $@) @$(call E, compile: $@)
$(STAGE1) -c -o $@ $< $(STAGE1) -c -o $@ $<
stage2/glue.o: stage1/rustc$(X) stage1/$(CFG_STDLIB) \ 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 $(STAGE1) -c -o $@ --glue
stage2/intrinsics.bc: $(INTRINSICS_BC)
@$(call E, cp: $@)
$(Q)cp $< $@
# Due to make not wanting to run the same implicit rules twice on the same # Due to make not wanting to run the same implicit rules twice on the same
# rule tree (implicit-rule recursion prevention, see "Chains of Implicit # rule tree (implicit-rule recursion prevention, see "Chains of Implicit
# Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here # Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here

View File

@ -1,4 +1,5 @@
stage3/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) stage2/rustc$(X) $(MKFILES) stage3/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) stage2/rustc$(X) \
stage2/intrinsics.bc $(MKFILES)
@$(call E, compile: $@) @$(call E, compile: $@)
$(STAGE2) -c --shared -o $@ $< $(STAGE2) -c --shared -o $@ $<
@ -11,11 +12,15 @@ stage3/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ2)
@$(call E, compile: $@) @$(call E, compile: $@)
$(STAGE2) -c -o $@ $< $(STAGE2) -c -o $@ $<
stage3/glue.o: stage2/rustc$(X) stage2/$(CFG_STDLIB) \ 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 $(STAGE2) -c -o $@ --glue
stage3/intrinsics.bc: $(INTRINSICS_BC)
@$(call E, cp: $@)
$(Q)cp $< $@
# Due to make not wanting to run the same implicit rules twice on the same # Due to make not wanting to run the same implicit rules twice on the same
# rule tree (implicit-rule recursion prevention, see "Chains of Implicit # rule tree (implicit-rule recursion prevention, see "Chains of Implicit
# Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here # Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here

View File

@ -1,6 +1,6 @@
; ModuleID = 'intrinsics.cpp' ; ModuleID = 'intrinsics.cpp'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
target triple = "$(LLVM_TRIPLE)" target triple = "@CFG_LLVM_TRIPLE@"
%0 = type { i32, i8**, i32 } %0 = type { i32, i8**, i32 }
%1 = type { %"struct.hash_map<rust_task *, rust_handle<rust_task> *>::map_entry"* } %1 = type { %"struct.hash_map<rust_task *, rust_handle<rust_task> *>::map_entry"* }