Skip to content

Commit

Permalink
Patch compilation test helpers for sgx platform
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulstrackx committed Sep 25, 2020
1 parent 7d3c3fd commit 159d11f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,14 @@ impl Step for TestHelpers {
if builder.config.dry_run {
return;
}
let target = self.target;
// The x86_64-fortanix-unknown-sgx target doesn't have a working C
// toolchain. However, some x86_64 ELF objects can be linked
// without issues. Use this hack to compile the test helpers.
let target = if self.target == "x86_64-fortanix-unknown-sgx" {
TargetSelection::from_user("x86_64-unknown-linux-gnu")
} else {
self.target
};
let dst = builder.test_helpers_out(target);
let src = builder.src.join("src/test/auxiliary/rust_test_helpers.c");
if up_to_date(&src, &dst.join("librust_test_helpers.a")) {
Expand All @@ -649,7 +656,6 @@ impl Step for TestHelpers {
}
cfg.compiler(builder.cc(target));
}

cfg.cargo_metadata(false)
.out_dir(&dst)
.target(&target.triple)
Expand Down

0 comments on commit 159d11f

Please sign in to comment.