Upgrade toolchain and std to May 2024 #139
Merged
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.
This PR upgrades the Rust toolchain and standard library to
nightly-2024-05-15
, and the libc crate to0.2.153
, both ported for OP-TEE targets.Additionally, it includes various build script adjustments and code modifications necessary for this upgrade.
Changes:
Port libc 0.2.153 and add OP-TEE implementation:
Pin Rust src and add OP-TEE std implementation:
No Need to Port
compiler_builtins
:link-dead-code
helps avoid linking errors with math functions such as "undefined reference to log10".Unify OP-TEE Target Names:
optee-utee-rs:
quote
andsyn
.systest
as it's not compatible with the new Rust version.Examples:
0x1
, causing a TA panic when dereferencing.0.16.20
and Rustls0.21.0
.Fix some warnings on new version:
.cargo/config.toml
: Xargo uses.cargo.config
, not.cargo/config.toml
(required for the new cargo version).build_dependencies
tobuild-dependencies
: deprecated in favor ofbuild-dependencies
and will not work in the 2024 edition.Polish building scripts
Discussions:
Xargo or
-Zbuild-std
When building std from source:cargo -Zbuild-std
is the recommended feature but has a bug that[patch.crates-io]
does not work. This prevents replacing all libc dependencies for Rust std. Reference: Rust compiler workspace patches are being ignored when compiling with-Zbuild-std
rust-lang/wg-cargo-std-aware#78.cargo -Zbuild-std
since libc (with OP-TEE implementation) will be merged into the official source.cargo -Zbuild-std
at https://github.com/DemesneGH/rust-optee-trustzone-sdk/tree/upgrade-std-202405.Upstream the OP-TEE Targets:
rustup add components rust-src
.cargo -Zbuild-std
instead of Xargo.tier-3
target, we cannot install our target viarustup
, sobuild-std
is still needed.Rustls
andRing
(which use optee-utee-rs APIs such as random and time), we still need to port, or open PR to add our target.TODOs:
symbols.o
for ARM32 Object files with EABI version 0, causing errorsource object xxx.rlib has EABI version 5, but target ta-xxx has EABI version 0
. This can be fixed by applying a patch to the Rust compiler. A PR to the Rust repository will be made.User mode data-abort at address xxx (write permission fault)
before loading TA into an address.This PR is a work in progress. Any comments would be appreciated. Thank you!
Updates: