1 # `x86_64-fortanix-unknown-sgx`
5 Secure enclaves using [Intel Software Guard Extensions
6 (SGX)](https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/overview.html)
7 based on the ABI defined by Fortanix for the [Enclave Development Platform
8 (EDP)](https://edp.fortanix.com/).
12 The [EDP team](mailto:edp.maintainers@fortanix.com) at Fortanix.
14 - Jethro Beekman [@jethrogb](https://github.com/jethrogb)
15 - Raoul Strackx [@raoulstrackx](https://github.com/raoulstrackx)
16 - Mohsen Zohrevandi [@mzohreva](https://github.com/mzohreva)
20 The target supports `std` with a default allocator. Only cross compilation is
23 Binaries support all CPUs that include Intel SGX. Only 64-bit mode is supported.
25 Not all `std` features are supported, see [Using Rust's
26 std](https://edp.fortanix.com/docs/concepts/rust-std/) for details.
28 The `extern "C"` calling convention is the System V AMD64 ABI.
30 The supported ABI is the
31 [fortanix-sgx-abi](https://edp.fortanix.com/docs/api/fortanix_sgx_abi/index.html).
33 The compiler output is ELF, but the native format for the platform is the SGX
34 stream (SGXS) format. A converter like
35 [ftxsgx-elf2sgxs](https://crates.io/crates/fortanix-sgx-tools) is needed.
37 Programs in SGXS format adhering to the Fortanix SGX ABI can be run with any
38 compatible runner, such as
39 [ftxsgx-runner](https://crates.io/crates/fortanix-sgx-tools).
41 See the [EDP installation
42 guide](https://edp.fortanix.com/docs/installation/guide/) for recommendations
43 on how to setup a development and runtime environment.
45 ## Building the target
47 As a tier 2 target, the target is built by the Rust project.
49 You can configure rustbuild like so:
54 target = ["x86_64-fortanix-unknown-sgx"]
57 ## Building Rust programs
59 Standard build flows using `cargo` or `rustc` should work.
63 The Rust test suite as well as custom unit and integration tests will run on
64 hardware that has Intel SGX enabled if a cargo runner is configured correctly,
65 see the requirements section.
67 ## Cross-compilation toolchains and C code
69 C code is not generally supported, as there is no libc. C code compiled for
70 x86-64 in freestanding mode using the System V AMD64 ABI may work. The
71 [rs-libc](https://crates.io/crates/rs-libc) crate contains a subset of libc
72 that's known to work with this target.