diff options
| author | bors <bors@rust-lang.org> | 2020-09-28 03:28:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-09-28 03:28:04 +0000 |
| commit | 6369a98ebdee8ce01510f5d4307ddb771c8cb0e5 (patch) | |
| tree | 90c8ee36f0e707a658f46bea9fd4de5727615b3d /src/bootstrap | |
| parent | db7ee7cc0ddf46a52f53a8a141cd0747f829999a (diff) | |
| parent | 159d11fb069fca88056bc1b8194d520489e3e921 (diff) | |
| download | rust-6369a98ebdee8ce01510f5d4307ddb771c8cb0e5.tar.gz rust-6369a98ebdee8ce01510f5d4307ddb771c8cb0e5.zip | |
Auto merge of #77008 - fortanix:raoul/lvi-tests, r=Mark-Simulacrum
LVI hardening tests Mitigating the speculative execution LVI attack against SGX enclaves requires compiler changes (i.e., adding lfences). This pull requests adds various tests to check if this happens correctly.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/native.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index bdc58bfbb75..6bba00ee85e 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -630,7 +630,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")) { @@ -654,7 +661,6 @@ impl Step for TestHelpers { } cfg.compiler(builder.cc(target)); } - cfg.cargo_metadata(false) .out_dir(&dst) .target(&target.triple) |
