]> git.lizzy.rs Git - rust.git/commitdiff
mk: Fix native LLVM deps for cross-host builds
authorAlex Crichton <alex@alexcrichton.com>
Mon, 11 May 2015 19:30:47 +0000 (12:30 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 19 May 2015 17:36:00 +0000 (10:36 -0700)
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`.

mk/llvm.mk
mk/target.mk
mk/tests.mk

index 1861dd313ce71c02e81b5d2893ca3ec02e3f8000..cce1cab396836f56e426e7e68d03fd34ccad4a84 100644 (file)
@@ -66,7 +66,7 @@ $(foreach host,$(CFG_HOST), \
 
 # 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))
+$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.rustc_llvm: $$(LLVM_LINKAGE_PATH_$(2))
 endef
 
 $(foreach source,$(CFG_HOST), \
index 319f44fd35b77c1058c4627b77640cf913ffc09f..97b08ebb0339c2f6397da911c32e3b7e8da79ac2 100644 (file)
@@ -83,7 +83,7 @@ $$(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)))
-       $(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(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))" \
index f391d8555fc2bff578a2a6c329b79cf71aa84542..44c661c4e20ea61bcb77157bb27a2b1904d4006c 100644 (file)
@@ -382,7 +382,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
                $$(CRATEFILE_$(4)) \
                $$(TESTDEP_$(1)_$(2)_$(3)_$(4))
        @$$(call E, rustc: $$@)
-       $(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
+       $(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
            $$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
                -L "$$(RT_OUTPUT_DIR_$(2))" \
                $$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
@@ -894,7 +894,7 @@ ifeq ($(2),$$(CFG_BUILD))
 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
        @$$(call E, run doc-crate-$(4) [$(2)])
        $$(Q)touch $$@.start_time
-       $$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
+       $$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
            $$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
                $$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && \
                touch -r $$@.start_time $$@ && rm $$@.start_time