Comments (6)
Hi @syedelec
Thanks for your advice.
- avoid patching rust-lang, compiler-builtins and libc?
- use latest rust toolchains
The patching of rust-lang and other submodules are necessary for building TAs running on OP-TEE OS. In addition, the other solution is to release these dependencies as prebuilt libraries. But AFAIK Rust and cargo don't support the pre-built libraries yet.
- use pre-built optee libutee.a/libutils.a and libteec.so libraries (to avoid pull optee os/client)
The OP-TEE libraries(for building TA,aka ta_dev_kit) are built when building OP-TEE OS. If you have already built OP-TEE OS, you can avoid building the OP-TEE libraries using export OPTEE_DIR=[YOUR_OPTEE_DIR]
, see the instructions here.
from incubator-teaclave-trustzone-sdk.
Thanks for your inputs.
The patching of rust-lang and other submodules are necessary for building TAs running on OP-TEE OS. In addition, the other solution is to release these dependencies as pre-built libraries. But AFAIK Rust and cargo don't support the pre-built libraries yet.
I understand.
I am not rust expert, but I would like to suggest some modifications if possible to reduce workarounds.
Regarding this part of the code:
##########################################
# install Rust and select a proper version
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2021-09-20
source $HOME/.cargo/env
rustup component add rust-src && rustup target install aarch64-unknown-linux-gnu arm-unknown-linux-gnueabihf
# install Xargo
rustup default 1.44.0 && cargo +1.44.0 install xargo
# switch to nightly
rustup default nightly-2021-09-20
is it possible to use the latest nightly version (nightly-x86_64-unknown-linux-gnu
) ? or why not the stable version (stable-x86_64-unknown-linux-gnu
)?
Also why install xargo from specific 1.44.0 version and not use the stable/nightly version
Currently the script installs 2 toolchains (1.44.0 and nightly-2021-09-20) but only nightly-2021-09-20 is used for compilation and 1.44.0 is used to install xargo.
The OP-TEE libraries(for building TA,aka ta_dev_kit) are built when building OP-TEE OS. If you have already built OP-TEE OS, you can avoid building the OP-TEE libraries using export OPTEE_DIR=[YOUR_OPTEE_DIR], see the instructions here.
I agree. This a viable solution and I am using my own OP-TEE repos to build and it's working fine.
Finally, the source code is for rust, compiler-builtins and libc are taken from https://github.com/mesalock-linux org and these specific repos seems not updated. It would be great if the repos could be updated to a stable version and apply the single commit on top to get it working.
Again, these are suggestions and I would like to know if this is doable because I may get into it to clean repos and make it working with minimal workarounds.
Thanks
from incubator-teaclave-trustzone-sdk.
Hi @syedelec
is it possible to use the latest nightly version (
nightly-x86_64-unknown-linux-gnu
) ?
Yes but not yet. When upgrading toolchains, the std should be upgraded to a proper version at the same time. Because the std code can only be compiled in a certain range of versions of the Rust toolchain.
why not the stable version (
stable-x86_64-unknown-linux-gnu
)?
No. The nightly version is needed for building customized std.
Also why install xargo from specific 1.44.0 version and not use the stable/nightly version
The toolchain for installing xargo can be upgraded to a newer version but we've not tested for it.
Finally, the source code is for rust, compiler-builtins and libc are taken from https://github.com/mesalock-linux org and these specific repos seems not updated. It would be great if the repos could be updated to a stable version and apply the single commit on top to get it working.
The rust, compiler-builtins and libc ported for OP-TEE are based on the stable Rust version 1.56.1. And the patch for OP-TEE is in mesalock-linux/rust@6abda66.
these are suggestions and I would like to know if this is doable because I may get into it to clean repos and make it working with minimal workarounds.
For simplification of the building environment, one considerable way is to add the aarch64-unknown-optee-trustzone
target into the upstream Rust compiler repo. Then we can build binaries for this target by rustup target add aarch64-unknown-optee-trustzone
.
But this needs more work to integrate the customized std into the Rust repo.
What are your needs for the minimal building environment? Any thoughts would be appreciated.
Thanks
Yuan
from incubator-teaclave-trustzone-sdk.
Hi @DemesneGH
Sorry for late answer.
Thank you again for your valuable inputs/clarifications.
What are your needs for the minimal building environment? Any thoughts would be appreciated.
I already have a building environment for a library in Rust and I would like to integrate the TA (host + ta) and not build them separately. This is the main reason.
Thanks
from incubator-teaclave-trustzone-sdk.
Hi @syedelec
I already have a building environment for a library in Rust and I would like to integrate the TA (host + ta) and not build them separately.
The toolchains for building host applications can be upgraded to the new version or changed to the other architecture(such as Android) as you want, because those are normal Linux binaries.
As for building TAs, the specific toolchains and the modified std are needed as stated above. Maybe you can try to include the source code of your library as the third-party crate in TA's Cargo.toml
.
from incubator-teaclave-trustzone-sdk.
Hi @DemesneGH
Thanks for your inputs! It's very helpful.
from incubator-teaclave-trustzone-sdk.
Related Issues (20)
- (Solved) Failed to build example HOT 3
- (Solved) Failed to build repo with optee-3.18.0 HOT 3
- Create a persistent object from an initialized transient object HOT 8
- API doc links broken HOT 3
- Will this library support remote attestation? HOT 1
- Upstream status for rustc aarch64-unknown-optee-trustzone target? HOT 7
- Missing mem::forget(b) in TA_InvokeCommand() error path? HOT 3
- [VOTE] Change the default branch to "no-std" HOT 1
- Error: System ran out of resources. (error code 0xffff000c) HOT 8
- Signature Verification example using ring crate HOT 2
- Get Public/Private key from generated key in TA HOT 2
- Use openssl/serde in host app HOT 2
- Xargo Version? HOT 1
- ECDH shared secret derivation HOT 6
- Performance issues HOT 1
- ./hello_world-rs not found in shared folder HOT 6
- make optee: fatal error: uuid/uuid.h: No such file or directory HOT 6
- Question: returning data from the TA
- Error: Unresolved import 'self::inner'
- Question: Third party crates HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incubator-teaclave-trustzone-sdk.