Skip to content

Commit 7be245b

Browse files
committed
---
yaml --- r: 207373 b: refs/heads/auto c: 6122a5f h: refs/heads/master i: 207371: 149ca89 v: v3
1 parent c57d249 commit 7be245b

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 64412a49bed9d6a743ed4d9108fc2da49ed5e9a9
13+
refs/heads/auto: 6122a5f559362dad03ed6e2433b8d71cece649c5
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/rustllvm.mk

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,41 @@ define DEF_RUSTLLVM_TARGETS
1818
# to find the llvm includes (probably because we're not actually installing
1919
# llvm, but using it straight out of the build directory)
2020
ifdef CFG_WINDOWSY_$(1)
21-
LLVM_EXTRA_INCDIRS_$(1)= -iquote $(S)src/llvm/include \
22-
-iquote $$(CFG_LLVM_BUILD_DIR_$(1))/include
21+
LLVM_EXTRA_INCDIRS_$(1)= $$(call CFG_CC_INCLUDE_$(1),$(S)src/llvm/include) \
22+
$$(call CFG_CC_INCLUDE_$(1),\
23+
$$(CFG_LLVM_BUILD_DIR_$(1))/include)
2324
endif
2425

2526
RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, \
2627
ExecutionEngineWrapper.cpp RustWrapper.cpp PassWrapper.cpp)
2728

2829
RUSTLLVM_INCS_$(1) = $$(LLVM_EXTRA_INCDIRS_$(1)) \
29-
-iquote $$(LLVM_INCDIR_$(1)) \
30-
-iquote $$(S)src/rustllvm/include
30+
$$(call CFG_CC_INCLUDE_$(1),$$(LLVM_INCDIR_$(1))) \
31+
$$(call CFG_CC_INCLUDE_$(1),$$(S)src/rustllvm/include)
3132
RUSTLLVM_OBJS_OBJS_$(1) := $$(RUSTLLVM_OBJS_CS_$(1):rustllvm/%.cpp=$(1)/rustllvm/%.o)
32-
ALL_OBJ_FILES += $$(RUSTLLVM_OBJS_OBJS_$(1))
33+
34+
# Note that we appease `cl.exe` and its need for some sort of exception
35+
# handling flag with the `EHsc` argument here as well.
36+
ifeq ($$(findstring msvc,$(1)),msvc)
37+
EXTRA_RUSTLLVM_CXXFLAGS_$(1) := //EHsc
38+
endif
3339

3440
$$(RT_OUTPUT_DIR_$(1))/$$(call CFG_STATIC_LIB_NAME_$(1),rustllvm): \
3541
$$(RUSTLLVM_OBJS_OBJS_$(1))
3642
@$$(call E, link: $$@)
37-
$$(Q)$$(AR_$(1)) rcs $$@ $$(RUSTLLVM_OBJS_OBJS_$(1))
43+
$$(Q)$$(call CFG_CREATE_ARCHIVE_$(1),$$@) $$^
3844

45+
# On MSVC we need to double-escape arguments that llvm-config printed which
46+
# start with a '/'. The shell we're running in will auto-translate the argument
47+
# `/foo` to `C:/msys64/foo` but we really want it to be passed through as `/foo`
48+
# so the argument passed to our shell must be `//foo`.
3949
$(1)/rustllvm/%.o: $(S)src/rustllvm/%.cpp $$(MKFILE_DEPS) $$(LLVM_CONFIG_$(1))
4050
@$$(call E, compile: $$@)
41-
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(LLVM_CXXFLAGS_$(1)) $$(RUSTLLVM_INCS_$(1))) $$<
51+
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@,) \
52+
$$(subst /,//,$$(LLVM_CXXFLAGS_$(1))) \
53+
$$(EXTRA_RUSTLLVM_CXXFLAGS_$(1)) \
54+
$$(RUSTLLVM_INCS_$(1)) \
55+
$$<
4256
endef
4357

4458
# Instantiate template for all stages

0 commit comments

Comments
 (0)