mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
build: Build intrinsics.bc
This commit is contained in:
parent
add7d34164
commit
04f966f0bc
11
Makefile.in
11
Makefile.in
@ -137,6 +137,12 @@ SREQ2 := stage2/rustc$(X) $(LREQ) stage3/glue.o stage3/$(CFG_STDLIB)
|
||||
|
||||
export CFG_SRC_DIR
|
||||
|
||||
######################################################################
|
||||
# Subprograms
|
||||
######################################################################
|
||||
|
||||
LLVM_AS := $(CFG_LLVM_BINDIR)/llvm-as
|
||||
|
||||
|
||||
######################################################################
|
||||
# Single-target rules
|
||||
@ -145,17 +151,21 @@ export CFG_SRC_DIR
|
||||
all: rt/$(CFG_RUNTIME) \
|
||||
rustllvm/$(CFG_RUSTLLVM) \
|
||||
stage0/$(CFG_STDLIB) \
|
||||
stage0/intrinsics.bc \
|
||||
stage0/rustc$(X) \
|
||||
$(GENERATED) \
|
||||
$(DOCS) \
|
||||
stage1/$(CFG_STDLIB) \
|
||||
stage1/intrinsics.bc \
|
||||
stage1/glue.o \
|
||||
stage1/rustc$(X) \
|
||||
stage2/$(CFG_STDLIB) \
|
||||
stage2/intrinsics.bc \
|
||||
stage2/glue.o \
|
||||
stage2/rustc$(X) \
|
||||
stage3/$(CFG_STDLIB) \
|
||||
stage3/glue.o \
|
||||
stage3/intrinsics.bc \
|
||||
stage3/rustc$(X)
|
||||
|
||||
|
||||
@ -172,6 +182,7 @@ config.mk: $(S)configure $(S)Makefile.in
|
||||
# Additional makefiles
|
||||
######################################################################
|
||||
|
||||
include $(CFG_SRC_DIR)/mk/intrinsics.mk
|
||||
include $(CFG_SRC_DIR)/mk/stage0.mk
|
||||
include $(CFG_SRC_DIR)/mk/stage1.mk
|
||||
include $(CFG_SRC_DIR)/mk/stage2.mk
|
||||
|
7
configure
vendored
7
configure
vendored
@ -122,6 +122,7 @@ need_cmd find
|
||||
need_cmd uname
|
||||
need_cmd date
|
||||
need_cmd tr
|
||||
need_cmd sed
|
||||
|
||||
msg "inspecting environment"
|
||||
|
||||
@ -215,6 +216,10 @@ then
|
||||
--version \
|
||||
| grep version \
|
||||
| cut -d ' ' -f 5-)
|
||||
CFG_LLVM_TRIPLE=$("$CFG_LLVM_BINDIR/llc" \
|
||||
--version \
|
||||
| grep Host: \
|
||||
| cut -d ' ' -f 4-)
|
||||
elif [ ! -z "$CFG_LLVM_CONFIG" ]
|
||||
then
|
||||
CFG_LLVM_VERSION=$(llvm-config --version)
|
||||
@ -224,6 +229,7 @@ then
|
||||
CFG_LLVM_CXXFLAGS=$(llvm-config --cxxflags)
|
||||
CFG_LLVM_LDFLAGS=$(llvm-config --ldflags)
|
||||
CFG_LLVM_LIBS=$(llvm-config --libs)
|
||||
CFG_LLVM_TRIPLE=$(llvm-config --host-target)
|
||||
else
|
||||
err "either the \"CFG_LLVM_ROOT\" environment variable must be set, or a \
|
||||
\"llvm-config\" script must be present"
|
||||
@ -244,6 +250,7 @@ putvar CFG_LLVM_LIBDIR
|
||||
putvar CFG_LLVM_CXXFLAGS
|
||||
putvar CFG_LLVM_LDFLAGS
|
||||
putvar CFG_LLVM_LIBS
|
||||
putvar CFG_LLVM_TRIPLE
|
||||
|
||||
# Munge any paths that appear in config.mk back to posix-y
|
||||
perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' \
|
||||
|
@ -10,3 +10,9 @@ stage0/glue.o: stage0/rustc$(X)
|
||||
|
||||
stage0/$(CFG_STDLIB): stage0/rustc$(X)
|
||||
$(Q)touch $@
|
||||
|
||||
# TODO: Include as part of the snapshot.
|
||||
stage0/intrinsics.bc: $(INTRINSICS_BC)
|
||||
@$(call E, cp: $@)
|
||||
$(Q)cp $< $@
|
||||
|
||||
|
10
mk/stage1.mk
10
mk/stage1.mk
@ -1,5 +1,6 @@
|
||||
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: $@)
|
||||
$(STAGE0) -c --shared -o $@ $<
|
||||
|
||||
@ -12,10 +13,15 @@ stage1/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0)
|
||||
@$(call E, compile: $@)
|
||||
$(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: $@)
|
||||
$(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
|
||||
# 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
|
||||
|
11
mk/stage2.mk
11
mk/stage2.mk
@ -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: $@)
|
||||
$(STAGE1) -c --shared -o $@ $<
|
||||
|
||||
@ -11,11 +12,15 @@ stage2/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1)
|
||||
@$(call E, compile: $@)
|
||||
$(STAGE1) -c -o $@ $<
|
||||
|
||||
stage2/glue.o: stage1/rustc$(X) stage1/$(CFG_STDLIB) \
|
||||
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
|
||||
stage2/glue.o: stage1/rustc$(X) stage1/$(CFG_STDLIB) stage1/intrinsics.bc \
|
||||
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
|
||||
@$(call E, generate: $@)
|
||||
$(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
|
||||
# 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
|
||||
|
@ -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: $@)
|
||||
$(STAGE2) -c --shared -o $@ $<
|
||||
|
||||
@ -11,11 +12,15 @@ stage3/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ2)
|
||||
@$(call E, compile: $@)
|
||||
$(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)
|
||||
@$(call E, generate: $@)
|
||||
$(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
|
||||
# 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
; 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 triple = "$(LLVM_TRIPLE)"
|
||||
target triple = "@CFG_LLVM_TRIPLE@"
|
||||
|
||||
%0 = type { i32, i8**, i32 }
|
||||
%1 = type { %"struct.hash_map<rust_task *, rust_handle<rust_task> *>::map_entry"* }
|
||||
|
Loading…
Reference in New Issue
Block a user