summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-09-29 11:31:28 -0700
committerBrian Anderson <banderson@mozilla.com>2011-09-29 22:58:33 -0700
commitab8338fb5ad71d577f7c056087e2c81505f51eff (patch)
treebec9a9edc5efd280b2ce31379661cbdf7c72d6af /src/comp
parent0148daa0588a857e7a844bae672f8265b3e3aef8 (diff)
downloadrust-ab8338fb5ad71d577f7c056087e2c81505f51eff.tar.gz
rust-ab8338fb5ad71d577f7c056087e2c81505f51eff.zip
Make rustc's host triple agree with the build system's
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/driver/rustc.rs10
1 files changed, 9 insertions, 1 deletions
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)