Make rustc's host triple agree with the build system's

This commit is contained in:
Brian Anderson 2011-09-29 11:31:28 -07:00
parent 0148daa058
commit ab8338fb5a
3 changed files with 11 additions and 3 deletions

View File

@ -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)

View File

@ -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)) \

View File

@ -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)