-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Document x86_64-fortanix-unknown-sgx platform #101151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/doc/rustc/src/platform-support/x86_64-fortanix-unknown-sgx.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# `x86_64-fortanix-unknown-sgx` | ||
|
||
**Tier: 2** | ||
|
||
Secure enclaves using [Intel Software Guard Extensions | ||
(SGX)](https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/overview.html) | ||
based on the ABI defined by Fortanix for the [Enclave Development Platform | ||
(EDP)](https://edp.fortanix.com/). | ||
|
||
## Target maintainers | ||
|
||
The [EDP team](mailto:edp.maintainers@fortanix.com) at Fortanix. | ||
|
||
- Jethro Beekman [@jethrogb](https://github.com/jethrogb) | ||
- Raoul Strackx [@raoulstrackx](https://github.com/raoulstrackx) | ||
- Mohsen Zohrevandi [@mzohreva](https://github.com/mzohreva) | ||
|
||
## Requirements | ||
|
||
The target supports `std` with a default allocator. Only cross compilation is | ||
supported. | ||
|
||
Binaries support all CPUs that include Intel SGX. Only 64-bit mode is supported. | ||
|
||
Not all `std` features are supported, see [Using Rust's | ||
std](https://edp.fortanix.com/docs/concepts/rust-std/) for details. | ||
|
||
The `extern "C"` calling convention is the System V AMD64 ABI. | ||
|
||
The supported ABI is the | ||
[fortanix-sgx-abi](https://edp.fortanix.com/docs/api/fortanix_sgx_abi/index.html). | ||
|
||
The compiler output is ELF, but the native format for the platform is the SGX | ||
stream (SGXS) format. A converter like | ||
[ftxsgx-elf2sgxs](https://crates.io/crates/fortanix-sgx-tools) is needed. | ||
|
||
Programs in SGXS format adhering to the Fortanix SGX ABI can be run with any | ||
compatible runner, such as | ||
[ftxsgx-runner](https://crates.io/crates/fortanix-sgx-tools). | ||
|
||
See the [EDP installation | ||
guide](https://edp.fortanix.com/docs/installation/guide/) for recommendations | ||
on how to setup a development and runtime environment. | ||
|
||
## Building the target | ||
|
||
As a tier 2 target, the target is built by the Rust project. | ||
|
||
You can configure rustbuild like so: | ||
|
||
```toml | ||
[build] | ||
build-stage = 1 | ||
target = ["x86_64-fortanix-unknown-sgx"] | ||
``` | ||
|
||
## Building Rust programs | ||
|
||
Standard build flows using `cargo` or `rustc` should work. | ||
|
||
## Testing | ||
|
||
The Rust test suite as well as custom unit and integration tests will run on | ||
hardware that has Intel SGX enabled if a cargo runner is configured correctly, | ||
see the requirements section. | ||
|
||
## Cross-compilation toolchains and C code | ||
|
||
C code is not generally supported, as there is no libc. C code compiled for | ||
x86-64 in freestanding mode using the System V AMD64 ABI may work. The | ||
[rs-libc](https://crates.io/crates/rs-libc) crate contains a subset of libc | ||
that's known to work with this target. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.