From 159d11fb069fca88056bc1b8194d520489e3e921 Mon Sep 17 00:00:00 2001 From: Raoul Strackx Date: Tue, 31 Mar 2020 11:28:01 +0200 Subject: Patch compilation test helpers for sgx platform --- src/bootstrap/native.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 9e4d6d0023d..1e233cb3891 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -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")) { @@ -649,7 +656,6 @@ impl Step for TestHelpers { } cfg.compiler(builder.cc(target)); } - cfg.cargo_metadata(false) .out_dir(&dst) .target(&target.triple) -- cgit 1.4.1-3-g733a5