-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add Trusty OS as tier 3 target #103895
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
Add Trusty OS as tier 3 target #103895
Changes from all commits
dcd0c58
f197145
12053c9
c7f8752
884f307
43c1e77
ab51f64
83369cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Trusty OS target for AArch64. | ||
|
||
use super::{ | ||
crt_objects::LinkSelfContainedDefault, PanicStrategy, RelroLevel, Target, TargetOptions, | ||
}; | ||
|
||
pub fn target() -> Target { | ||
Target { | ||
llvm_target: "aarch64-unknown-unknown-musl".into(), | ||
pointer_width: 64, | ||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(), | ||
arch: "aarch64".into(), | ||
options: TargetOptions { | ||
features: "+neon,+fp-armv8,+reserve-x18".into(), | ||
executables: true, | ||
max_atomic_width: Some(128), | ||
panic_strategy: PanicStrategy::Abort, | ||
os: "trusty".into(), | ||
position_independent_executables: true, | ||
static_position_independent_executables: true, | ||
crt_static_default: true, | ||
crt_static_respected: true, | ||
randomPoison marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dynamic_linking: false, | ||
link_self_contained: LinkSelfContainedDefault::Musl, | ||
relro_level: RelroLevel::Full, | ||
mcount: "\u{1}_mcount".into(), | ||
..Default::default() | ||
}, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use crate::spec::{Target, TargetOptions}; | ||
|
||
use super::{crt_objects::LinkSelfContainedDefault, PanicStrategy, RelroLevel}; | ||
|
||
pub fn target() -> Target { | ||
Target { | ||
// It's important we use "gnueabi" and not "musleabi" here. LLVM uses it | ||
// to determine the calling convention and float ABI, and it doesn't | ||
// support the "musleabi" value. | ||
llvm_target: "armv7-unknown-unknown-gnueabi".into(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really? |
||
pointer_width: 32, | ||
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(), | ||
arch: "arm".into(), | ||
options: TargetOptions { | ||
abi: "eabi".into(), | ||
features: "+v7,+thumb2,+soft-float,-neon,+reserve-x18".into(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Slightly surprised to see this target enables Thumb instructions but is not named There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
max_atomic_width: Some(64), | ||
mcount: "\u{1}mcount".into(), | ||
os: "trusty".into(), | ||
link_self_contained: LinkSelfContainedDefault::Musl, | ||
randomPoison marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dynamic_linking: false, | ||
executables: true, | ||
crt_static_default: true, | ||
crt_static_respected: true, | ||
relro_level: RelroLevel::Full, | ||
panic_strategy: PanicStrategy::Abort, | ||
position_independent_executables: true, | ||
static_position_independent_executables: true, | ||
|
||
..Default::default() | ||
}, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# `aarch64-unknown-trusty` and `armv7-unknown-trusty` | ||
|
||
**Tier: 3** | ||
|
||
[Trusty] is a secure Operating System that provides a Trusted Execution | ||
Environment (TEE) for Android. | ||
|
||
## Target maintainers | ||
|
||
- Nicole LeGare (@randomPoison) | ||
- Stephen Crane (@rinon) | ||
- As a fallback [email protected] can be contacted | ||
|
||
## Requirements | ||
|
||
This target is cross-compiled. It has no special requirements for the host. | ||
|
||
It fully supports alloc with the default allocator, and partially supports std. | ||
Notably, most I/O functionality is not supported, e.g. filesystem support and | ||
networking support are not present and any APIs that rely on them will panic at | ||
runtime. | ||
|
||
Trusty uses the ELF file format. | ||
|
||
## Building the target | ||
|
||
The targets can be built by enabling them for a `rustc` build, for example: | ||
|
||
```toml | ||
[build] | ||
build-stage = 1 | ||
target = ["aarch64-unknown-trusty", "armv7-unknown-trusty"] | ||
``` | ||
|
||
## Building Rust programs | ||
|
||
There is currently no supported way to build a Trusty app with Cargo. You can | ||
follow the [Trusty build instructions] to build the Trusty kernel along with any | ||
Rust apps that are setup in the project. | ||
|
||
## Testing | ||
|
||
See the [Trusty build instructions] for information on how to build Rust code | ||
within the main Trusty project. The main project also includes infrastructure | ||
for testing Rust applications within a QEMU emulator. | ||
|
||
## Cross-compilation toolchains and C code | ||
|
||
See the [Trusty build instructions] for information on how C code is built | ||
within Trusty. | ||
|
||
[Trusty]: https://source.android.com/docs/security/features/trusty | ||
[Trusty build instructions]: https://source.android.com/docs/security/features/trusty/download-and-build |
Uh oh!
There was an error while loading. Please reload this page.