mirror of https://github.com/rust-lang/rust.git
Don't use the same llvmdeps.rs for every host.
This commit is contained in:
parent
2264049577
commit
80d520fcf2
|
@ -299,7 +299,8 @@ $(2) += doc/$(1)/index.html
|
|||
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
|
||||
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
|
||||
@$$(call E, rustdoc: $$@)
|
||||
$$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
|
||||
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(CFG_BUILD)) \
|
||||
$$(RUSTDOC) --cfg dox --cfg stage2 $$<
|
||||
endef
|
||||
|
||||
$(foreach crate,$(DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),DOC_TARGETS)))
|
||||
|
|
24
mk/llvm.mk
24
mk/llvm.mk
|
@ -49,6 +49,12 @@ else
|
|||
LLVM_STDCPP_LOCATION_$(1) =
|
||||
endif
|
||||
|
||||
|
||||
# LLVM linkage:
|
||||
LLVM_LINKAGE_PATH_$(1):=$$(abspath $$(RT_OUTPUT_DIR_$(1))/llvmdeps.rs)
|
||||
$$(LLVM_LINKAGE_PATH_$(1)): $(S)src/etc/mklldeps.py $$(LLVM_CONFIG_$(1))
|
||||
$(Q)$(CFG_PYTHON) "$$<" "$$@" "$$(LLVM_COMPONENTS)" "$$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
|
||||
$$(LLVM_CONFIG_$(1))
|
||||
endef
|
||||
|
||||
$(foreach host,$(CFG_HOST), \
|
||||
|
@ -57,10 +63,14 @@ $(foreach host,$(CFG_HOST), \
|
|||
$(foreach host,$(CFG_HOST), \
|
||||
$(eval LLVM_CONFIGS := $(LLVM_CONFIGS) $(LLVM_CONFIG_$(host))))
|
||||
|
||||
$(S)src/librustc_llvm/llvmdeps.rs: \
|
||||
$(LLVM_CONFIGS) \
|
||||
$(S)src/etc/mklldeps.py \
|
||||
$(MKFILE_DEPS)
|
||||
$(Q)$(CFG_PYTHON) $(S)src/etc/mklldeps.py \
|
||||
"$@" "$(LLVM_COMPONENTS)" "$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
|
||||
$(LLVM_CONFIGS)
|
||||
# This can't be done in target.mk because it's included before this file.
|
||||
define LLVM_LINKAGE_DEPS
|
||||
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.rustc_llvm: $$(LLVM_LINKAGE_PATH_$(3))
|
||||
endef
|
||||
|
||||
$(foreach source,$(CFG_HOST), \
|
||||
$(foreach target,$(CFG_TARGET), \
|
||||
$(eval $(call LLVM_LINKAGE_DEPS,0,$(target),$(source))) \
|
||||
$(eval $(call LLVM_LINKAGE_DEPS,1,$(target),$(source))) \
|
||||
$(eval $(call LLVM_LINKAGE_DEPS,2,$(target),$(source))) \
|
||||
$(eval $(call LLVM_LINKAGE_DEPS,3,$(target),$(source)))))
|
||||
|
|
|
@ -79,7 +79,8 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
|
|||
$$(dir $$@)$$(call CFG_LIB_GLOB_$(2),$(4)))
|
||||
$$(call REMOVE_ALL_OLD_GLOB_MATCHES, \
|
||||
$$(dir $$@)$$(call CFG_RLIB_GLOB,$(4)))
|
||||
$$(STAGE$(1)_T_$(2)_H_$(3)) \
|
||||
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
|
||||
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) \
|
||||
$$(RUST_LIB_FLAGS_ST$(1)) \
|
||||
-L "$$(RT_OUTPUT_DIR_$(2))" \
|
||||
-L "$$(LLVM_LIBDIR_$(2))" \
|
||||
|
@ -134,8 +135,6 @@ SNAPSHOT_RUSTC_POST_CLEANUP=$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD))
|
|||
|
||||
define TARGET_HOST_RULES
|
||||
|
||||
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.rustc_llvm: $(S)src/librustc_llvm/llvmdeps.rs
|
||||
|
||||
$$(TBIN$(1)_T_$(2)_H_$(3))/:
|
||||
mkdir -p $$@
|
||||
|
||||
|
|
|
@ -2214,4 +2214,6 @@ pub unsafe fn static_link_hack_this_sucks() {
|
|||
// parts of LLVM that rustllvm depends on aren't thrown away by the linker.
|
||||
// Works to the above fix for #15460 to ensure LLVM dependencies that
|
||||
// are only used by rustllvm don't get stripped by the linker.
|
||||
mod llvmdeps;
|
||||
mod llvmdeps {
|
||||
include!(env!("CFG_LLVM_LINKAGE_FILE"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue