File tree Expand file tree Collapse file tree 7 files changed +48
-8
lines changed Expand file tree Collapse file tree 7 files changed +48
-8
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,12 @@ SREQ2 := stage2/rustc$(X) $(LREQ) stage3/glue.o stage3/$(CFG_STDLIB)
137
137
138
138
export CFG_SRC_DIR
139
139
140
+ # #####################################################################
141
+ # Subprograms
142
+ # #####################################################################
143
+
144
+ LLVM_AS := $(CFG_LLVM_BINDIR ) /llvm-as
145
+
140
146
141
147
# #####################################################################
142
148
# Single-target rules
@@ -145,17 +151,21 @@ export CFG_SRC_DIR
145
151
all : rt/$(CFG_RUNTIME ) \
146
152
rustllvm/$(CFG_RUSTLLVM) \
147
153
stage0/$(CFG_STDLIB) \
154
+ stage0/intrinsics.bc \
148
155
stage0/rustc$(X) \
149
156
$(GENERATED) \
150
157
$(DOCS) \
151
158
stage1/$(CFG_STDLIB) \
159
+ stage1/intrinsics.bc \
152
160
stage1/glue.o \
153
161
stage1/rustc$(X) \
154
162
stage2/$(CFG_STDLIB) \
163
+ stage2/intrinsics.bc \
155
164
stage2/glue.o \
156
165
stage2/rustc$(X) \
157
166
stage3/$(CFG_STDLIB) \
158
167
stage3/glue.o \
168
+ stage3/intrinsics.bc \
159
169
stage3/rustc$(X)
160
170
161
171
@@ -172,6 +182,7 @@ config.mk: $(S)configure $(S)Makefile.in
172
182
# Additional makefiles
173
183
# #####################################################################
174
184
185
+ include $(CFG_SRC_DIR ) /mk/intrinsics.mk
175
186
include $(CFG_SRC_DIR ) /mk/stage0.mk
176
187
include $(CFG_SRC_DIR ) /mk/stage1.mk
177
188
include $(CFG_SRC_DIR ) /mk/stage2.mk
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ need_cmd find
122
122
need_cmd uname
123
123
need_cmd date
124
124
need_cmd tr
125
+ need_cmd sed
125
126
126
127
msg " inspecting environment"
127
128
@@ -215,6 +216,10 @@ then
215
216
--version \
216
217
| grep version \
217
218
| cut -d ' ' -f 5-)
219
+ CFG_LLVM_TRIPLE=$( " $CFG_LLVM_BINDIR /llc" \
220
+ --version \
221
+ | grep Host: \
222
+ | cut -d ' ' -f 4-)
218
223
elif [ ! -z " $CFG_LLVM_CONFIG " ]
219
224
then
220
225
CFG_LLVM_VERSION=$( llvm-config --version)
224
229
CFG_LLVM_CXXFLAGS=$( llvm-config --cxxflags)
225
230
CFG_LLVM_LDFLAGS=$( llvm-config --ldflags)
226
231
CFG_LLVM_LIBS=$( llvm-config --libs)
232
+ CFG_LLVM_TRIPLE=$( llvm-config --host-target)
227
233
else
228
234
err " either the \" CFG_LLVM_ROOT\" environment variable must be set, or a \
229
235
\" llvm-config\" script must be present"
@@ -244,6 +250,7 @@ putvar CFG_LLVM_LIBDIR
244
250
putvar CFG_LLVM_CXXFLAGS
245
251
putvar CFG_LLVM_LDFLAGS
246
252
putvar CFG_LLVM_LIBS
253
+ putvar CFG_LLVM_TRIPLE
247
254
248
255
# Munge any paths that appear in config.mk back to posix-y
249
256
perl -i.bak -p -e ' s@ ([a-zA-Z]):[/\\]@ /\1/@go;' \
Original file line number Diff line number Diff line change @@ -10,3 +10,9 @@ stage0/glue.o: stage0/rustc$(X)
10
10
11
11
stage0/$(CFG_STDLIB ) : stage0/rustc$(X )
12
12
$(Q ) touch $@
13
+
14
+ # TODO: Include as part of the snapshot.
15
+ stage0/intrinsics.bc : $(INTRINSICS_BC )
16
+ @$(call E, cp: $@ )
17
+ $(Q ) cp $< $@
18
+
Original file line number Diff line number Diff line change 1
1
stage1/std.o : $(STDLIB_CRATE ) $(STDLIB_INPUTS ) \
2
- stage0/rustc$(X) stage0/$(CFG_STDLIB) $(LREQ) $(MKFILES)
2
+ stage0/rustc$(X) stage0/$(CFG_STDLIB) stage0/intrinsics.bc \
3
+ $(LREQ) $(MKFILES)
3
4
@$(call E, compile: $@)
4
5
$(STAGE0) -c --shared -o $@ $<
5
6
@@ -12,10 +13,15 @@ stage1/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0)
12
13
@$(call E, compile: $@ )
13
14
$(STAGE0 ) -c -o $@ $<
14
15
15
- stage1/glue.o : stage0/rustc$(X ) stage0/$(CFG_STDLIB ) $(LREQ ) $(MKFILES )
16
+ stage1/glue.o : stage0/rustc$(X ) stage0/$(CFG_STDLIB ) stage0/intrinsics.bc \
17
+ $(LREQ) $(MKFILES)
16
18
@$(call E, generate: $@)
17
19
$(STAGE0) -c -o $@ --glue
18
20
21
+ stage1/intrinsics.bc : $(INTRINSICS_BC )
22
+ @$(call E, cp: $@ )
23
+ $(Q ) cp $< $@
24
+
19
25
# Due to make not wanting to run the same implicit rules twice on the same
20
26
# rule tree (implicit-rule recursion prevention, see "Chains of Implicit
21
27
# Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here
Original file line number Diff line number Diff line change 1
- stage2/std.o : $(STDLIB_CRATE ) $(STDLIB_INPUTS ) stage1/rustc$(X ) $(MKFILES )
1
+ stage2/std.o : $(STDLIB_CRATE ) $(STDLIB_INPUTS ) stage1/rustc$(X ) \
2
+ stage1/intrinsics.bc $(MKFILES)
2
3
@$(call E, compile: $@)
3
4
$(STAGE1) -c --shared -o $@ $<
4
5
@@ -11,11 +12,15 @@ stage2/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1)
11
12
@$(call E, compile: $@ )
12
13
$(STAGE1 ) -c -o $@ $<
13
14
14
- stage2/glue.o : stage1/rustc$(X ) stage1/$(CFG_STDLIB ) \
15
- rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
15
+ stage2/glue.o : stage1/rustc$(X ) stage1/$(CFG_STDLIB ) stage1/intrinsics.bc \
16
+ rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
16
17
@$(call E, generate: $@)
17
18
$(STAGE1) -c -o $@ --glue
18
19
20
+ stage2/intrinsics.bc : $(INTRINSICS_BC )
21
+ @$(call E, cp: $@ )
22
+ $(Q ) cp $< $@
23
+
19
24
# Due to make not wanting to run the same implicit rules twice on the same
20
25
# rule tree (implicit-rule recursion prevention, see "Chains of Implicit
21
26
# Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here
Original file line number Diff line number Diff line change 1
- stage3/std.o : $(STDLIB_CRATE ) $(STDLIB_INPUTS ) stage2/rustc$(X ) $(MKFILES )
1
+ stage3/std.o : $(STDLIB_CRATE ) $(STDLIB_INPUTS ) stage2/rustc$(X ) \
2
+ stage2/intrinsics.bc $(MKFILES)
2
3
@$(call E, compile: $@)
3
4
$(STAGE2) -c --shared -o $@ $<
4
5
@@ -11,11 +12,15 @@ stage3/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ2)
11
12
@$(call E, compile: $@ )
12
13
$(STAGE2 ) -c -o $@ $<
13
14
14
- stage3/glue.o : stage2/rustc$(X ) stage2/$(CFG_STDLIB ) \
15
+ stage3/glue.o : stage2/rustc$(X ) stage2/$(CFG_STDLIB ) stage2/intrinsics.bc \
15
16
rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)
16
17
@$(call E, generate: $@)
17
18
$(STAGE2) -c -o $@ --glue
18
19
20
+ stage3/intrinsics.bc : $(INTRINSICS_BC )
21
+ @$(call E, cp: $@ )
22
+ $(Q ) cp $< $@
23
+
19
24
# Due to make not wanting to run the same implicit rules twice on the same
20
25
# rule tree (implicit-rule recursion prevention, see "Chains of Implicit
21
26
# Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here
Original file line number Diff line number Diff line change 1
1
; ModuleID = 'intrinsics.cpp'
2
2
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"
3
- target triple = "$(LLVM_TRIPLE) "
3
+ target triple = "@CFG_LLVM_TRIPLE@ "
4
4
5
5
%0 = type { i32, i8**, i32 }
6
6
%1 = type { %"struct.hash_map<rust_task *, rust_handle<rust_task> *>::map_entry"* }
You can’t perform that action at this time.
0 commit comments