diff --git a/Makefile.in b/Makefile.in index 360c76214b0..1561f2869e9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -198,7 +198,7 @@ endif STAGE$(1) := $$(Q)$$(call CFG_RUN_TARG,stage$(1), \ $$(CFG_VALGRIND_COMPILE$(1)) stage$(1)/bin/rustc$$(X) \ - $$(CFG_RUSTC_FLAGS) --target=$(2)) + $$(CFG_RUSTC_FLAGS)) endef FUZZ := stage1/bin/fuzzer$(X) diff --git a/mk/tests.mk b/mk/tests.mk index 6032b5bd506..dc216d541e1 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -189,7 +189,7 @@ CTEST_COMMON_ARGS$(2) := --compile-lib-path stage$(2)/lib \ --run-lib-path stage$(2)/lib/$$(CFG_HOST_TRIPLE) \ --rustc-path stage$(2)/bin/rustc$$(X) \ --stage-id stage$(2) \ - --rustcflags "--target=$$(CFG_HOST_TRIPLE) $$(CFG_RUSTC_FLAGS)" \ + --rustcflags "$$(CFG_RUSTC_FLAGS)" \ $$(CTEST_TESTARGS) \ CFAIL_ARGS$(2) := $$(CTEST_COMMON_ARGS$(2)) \ diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 9ed3aaa2e70..1d5b39f9ac2 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -309,7 +309,15 @@ fn build_target_config(sopts: @session::options) -> @session::config { } fn host_triple() -> str { - str::str_from_cstr(llvm::llvm::LLVMRustGetHostTriple()) + // Get the host triple out of the build environment. This ensures that our + // idea of the host triple is the same as for the set of libraries we've + // actually built. We can't just take LLVM's host triple because they + // normalize all ix86 architectures to i386. + // FIXME: Instead of grabbing the host triple we really should be + // grabbing (at compile time) the target triple that this rustc is + // built with and calling that (at runtime) the host triple. + let ht = #env("CFG_HOST_TRIPLE"); + ret ht != "" ? ht : fail "rustc built without CFG_HOST_TRIPLE"; } fn build_session_options(binary: str, match: getopts::match)