Skip to content

Commit ee258c5

Browse files
committed
mk: Fix native LLVM deps for cross-host builds
We use a script called `mklldeps.py` to run `llvm-config` to generate a list of LLVM libraries and native dependencies needed by LLVM, but all cross-compiled LLVM builds were using the *host triple's* `llvm-config` instead of the *target's* `llvm-config`. This commit alters this to require the right `llvmdeps.rs` to be generated which will run the correct `llvm-config`.
1 parent 150663c commit ee258c5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ $(foreach host,$(CFG_HOST), \
6666

6767
# This can't be done in target.mk because it's included before this file.
6868
define LLVM_LINKAGE_DEPS
69-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.rustc_llvm: $$(LLVM_LINKAGE_PATH_$(3))
69+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.rustc_llvm: $$(LLVM_LINKAGE_PATH_$(2))
7070
endef
7171

7272
$(foreach source,$(CFG_HOST), \

mk/target.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8383
$$(dir $$@)$$(call CFG_LIB_GLOB_$(2),$(4)))
8484
$$(call REMOVE_ALL_OLD_GLOB_MATCHES, \
8585
$$(dir $$@)$$(call CFG_RLIB_GLOB,$(4)))
86-
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
86+
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
8787
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) \
8888
$$(RUST_LIB_FLAGS_ST$(1)) \
8989
-L "$$(RT_OUTPUT_DIR_$(2))" \

mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
382382
$$(CRATEFILE_$(4)) \
383383
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))
384384
@$$(call E, rustc: $$@)
385-
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
385+
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
386386
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
387387
-L "$$(RT_OUTPUT_DIR_$(2))" \
388388
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
@@ -894,7 +894,7 @@ ifeq ($(2),$$(CFG_BUILD))
894894
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
895895
@$$(call E, run doc-crate-$(4) [$(2)])
896896
$$(Q)touch $$@.start_time
897-
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
897+
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
898898
$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
899899
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && \
900900
touch -r $$@.start_time $$@ && rm $$@.start_time

0 commit comments

Comments
 (0)