Skip to content

Commit d295709

Browse files
committed
auto merge of #6733 : alexcrichton/rust/issue-2400, r=brson
Most of the relevant information can be found in the commit messages. r? @brson - I just wanted to make sure the make changes aren't completely bogus This would close #2400, #6517, and #6489 (although a run through incoming-full on linux would have to confirm the latter two)
2 parents 562069c + ba33472 commit d295709

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

mk/target.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
# option. This file may not be copied, modified, or distributed
99
# except according to those terms.
1010

11+
# This is the compile-time target-triple for the compiler. For the compiler at
12+
# runtime, this should be considered the host-triple. More explanation for why
13+
# this exists can be found on issue #2400
14+
export CFG_COMPILER_TRIPLE
15+
1116
# TARGET_STAGE_N template: This defines how target artifacts are built
1217
# for all stage/target architecture combinations. The arguments:
1318
# $(1) is the stage
@@ -62,6 +67,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)): \
6267
@$$(call E, cp: $$@)
6368
$$(Q)cp $$< $$@
6469

70+
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): CFG_COMPILER_TRIPLE = $(2)
6571
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): \
6672
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
6773
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)) \

mk/tests.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ $(3)/stage$(1)/test/syntaxtest-$(2)$$(X_$(2)): \
307307
@$$(call E, compile_and_link: $$@)
308308
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
309309

310+
$(3)/stage$(1)/test/rustctest-$(2)$$(X_$(2)): CFG_COMPILER_TRIPLE = $(2)
310311
$(3)/stage$(1)/test/rustctest-$(2)$$(X_$(2)): \
311312
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
312313
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM_$(2)) \

src/librustc/driver/driver.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -518,15 +518,15 @@ pub fn host_triple() -> ~str {
518518
// idea of the host triple is the same as for the set of libraries we've
519519
// actually built. We can't just take LLVM's host triple because they
520520
// normalize all ix86 architectures to i386.
521-
522-
// FIXME (#2400): Instead of grabbing the host triple we really should
523-
// be grabbing (at compile time) the target triple that this rustc is
524-
// built with and calling that (at runtime) the host triple.
525-
let ht = env!("CFG_BUILD_TRIPLE");
521+
//
522+
// Instead of grabbing the host triple (for the current host), we grab (at
523+
// compile time) the target triple that this rustc is built with and
524+
// calling that (at runtime) the host triple.
525+
let ht = env!("CFG_COMPILER_TRIPLE");
526526
return if ht != ~"" {
527527
ht
528528
} else {
529-
fail!("rustc built without CFG_BUILD_TRIPLE")
529+
fail!("rustc built without CFG_COMPILER_TRIPLE")
530530
};
531531
}
532532

@@ -536,15 +536,15 @@ pub fn host_triple() -> ~str {
536536
// idea of the host triple is the same as for the set of libraries we've
537537
// actually built. We can't just take LLVM's host triple because they
538538
// normalize all ix86 architectures to i386.
539-
540-
// FIXME (#2400): Instead of grabbing the host triple we really should
541-
// be grabbing (at compile time) the target triple that this rustc is
542-
// built with and calling that (at runtime) the host triple.
543-
let ht = env!("CFG_BUILD_TRIPLE");
539+
//
540+
// Instead of grabbing the host triple (for the current host), we grab (at
541+
// compile time) the target triple that this rustc is built with and
542+
// calling that (at runtime) the host triple.
543+
let ht = env!("CFG_COMPILER_TRIPLE");
544544
return if ht != "" {
545545
ht.to_owned()
546546
} else {
547-
fail!("rustc built without CFG_BUILD_TRIPLE")
547+
fail!("rustc built without CFG_COMPILER_TRIPLE")
548548
};
549549
}
550550

src/librusti/rusti.rc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,9 @@ mod tests {
454454
}
455455
}
456456

457-
#[test] #[ignore]
457+
#[test]
458458
fn run_all() {
459+
// FIXME(#6511):
459460
// By default, unit tests are run in parallel. Rusti, on the other hand,
460461
// does not enjoy doing this. I suspect that it is because the LLVM
461462
// bindings are not thread-safe (when running parallel tests, some tests
@@ -468,7 +469,7 @@ mod tests {
468469
run_cmds([""]);
469470

470471
debug!("regression test for #5937");
471-
run_cmds(["use core;", ""]);
472+
run_cmds(["use std;", ""]);
472473

473474
debug!("regression test for #5784");
474475
run_cmds(["let a = 1;"]);

src/librustpkg/tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ fn test_sysroot() -> Path {
9393
self_path.pop()
9494
}
9595

96-
// Ignored on i686 -- see #6517
9796
#[test]
98-
#[ignore(cfg(target_arch = "x86"))]
9997
fn test_make_dir_rwx() {
10098
let temp = &os::tmpdir();
10199
let dir = temp.push("quux");
@@ -109,7 +107,6 @@ fn test_make_dir_rwx() {
109107
}
110108

111109
#[test]
112-
#[ignore(cfg(target_arch = "x86"))]
113110
fn test_install_valid() {
114111
let sysroot = test_sysroot();
115112
debug!("sysroot = %s", sysroot.to_str());
@@ -135,7 +132,6 @@ fn test_install_valid() {
135132
}
136133

137134
#[test]
138-
#[ignore(cfg(target_arch = "x86"))]
139135
fn test_install_invalid() {
140136
use conditions::nonexistent_package::cond;
141137
use cond1 = conditions::missing_pkg_files::cond;
@@ -158,7 +154,6 @@ fn test_install_invalid() {
158154
}
159155

160156
#[test]
161-
#[ignore(cfg(target_arch = "x86"))]
162157
fn test_install_url() {
163158
let workspace = mkdtemp(&os::tmpdir(), "test").expect("couldn't create temp dir");
164159
let sysroot = test_sysroot();

0 commit comments

Comments
 (0)