Skip to content

Commit 159d11f

Browse files
committedSep 25, 2020
Patch compilation test helpers for sgx platform
1 parent 7d3c3fd commit 159d11f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎src/bootstrap/native.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,14 @@ impl Step for TestHelpers {
625625
if builder.config.dry_run {
626626
return;
627627
}
628-
let target = self.target;
628+
// The x86_64-fortanix-unknown-sgx target doesn't have a working C
629+
// toolchain. However, some x86_64 ELF objects can be linked
630+
// without issues. Use this hack to compile the test helpers.
631+
let target = if self.target == "x86_64-fortanix-unknown-sgx" {
632+
TargetSelection::from_user("x86_64-unknown-linux-gnu")
633+
} else {
634+
self.target
635+
};
629636
let dst = builder.test_helpers_out(target);
630637
let src = builder.src.join("src/test/auxiliary/rust_test_helpers.c");
631638
if up_to_date(&src, &dst.join("librust_test_helpers.a")) {
@@ -649,7 +656,6 @@ impl Step for TestHelpers {
649656
}
650657
cfg.compiler(builder.cc(target));
651658
}
652-
653659
cfg.cargo_metadata(false)
654660
.out_dir(&dst)
655661
.target(&target.triple)

0 commit comments

Comments
 (0)