ChristopherRolland opened a new issue, #185:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/issues/185
//examples/hello_world-rs/ta/build.rs
```rust
use proto;
use optee_utee_build::{TaConfig, RustEdition, Error};
use optee_utee_sys::TA_FLAG_USER_MODE;
use optee_utee_sys::TA_FLAG_EXEC_DDR;
use optee_utee_sys::TA_FLAG_SINGLE_INSTANCE;
use optee_utee_sys::TA_FLAG_MULTI_SESSION;
use optee_utee_sys::TA_FLAG_REMAP_SUPPORT;
use optee_utee_sys::TA_FLAG_CACHE_MAINTENANCE;
use optee_utee_sys::TA_FLAG_INSTANCE_KEEP_ALIVE;
fn main() -> Result<(), Error> {
let flags: u32 = TA_FLAG_USER_MODE |
TA_FLAG_SINGLE_INSTANCE |
TA_FLAG_MULTI_SESSION;
let config = TaConfig::new_default_with_cargo_env(proto::UUID)?
.ta_flags(flags);
optee_utee_build::build(RustEdition::Before2024, config)
}
```
**I want use optee_utee_sys::TA_FLAG_xxx to specify my TA_FLAGS.But had
blow errors.**
```bash
error[E0432]: unresolved import `optee_utee_sys`
--> build.rs:21:5
|
21 | use optee_utee_sys::TA_FLAG_EXEC_DDR;
| ^^^^^^^^^^^^^^ use of undeclared crate or module `optee_utee_sys`
error[E0432]: unresolved import `optee_utee_sys`
--> build.rs:22:5
|
22 | use optee_utee_sys::TA_FLAG_SINGLE_INSTANCE;
| ^^^^^^^^^^^^^^ use of undeclared crate or module `optee_utee_sys`
error[E0432]: unresolved import `optee_utee_sys`
--> build.rs:23:5
|
23 | use optee_utee_sys::TA_FLAG_MULTI_SESSION;
| ^^^^^^^^^^^^^^ use of undeclared crate or module `optee_utee_sys`
error[E0432]: unresolved import `optee_utee_sys`
--> build.rs:24:5
|
24 | use optee_utee_sys::TA_FLAG_REMAP_SUPPORT;
| ^^^^^^^^^^^^^^ use of undeclared crate or module `optee_utee_sys`
error[E0432]: unresolved import `optee_utee_sys`
--> build.rs:25:5
|
25 | use optee_utee_sys::TA_FLAG_CACHE_MAINTENANCE;
| ^^^^^^^^^^^^^^ use of undeclared crate or module `optee_utee_sys`
error[E0432]: unresolved import `optee_utee_sys`
--> build.rs:26:5
|
26 | use optee_utee_sys::TA_FLAG_INSTANCE_KEEP_ALIVE;
| ^^^^^^^^^^^^^^ use of undeclared crate or module `optee_utee_sys`
```
**According to error clues. i try to add**
```bash
diff --git a/examples/hello_world-rs/ta/Cargo.toml
b/examples/hello_world-rs/ta/Cargo.toml
index 264625a..49c85b5 100644
--- a/examples/hello_world-rs/ta/Cargo.toml
+++ b/examples/hello_world-rs/ta/Cargo.toml
@@ -32,6 +32,7 @@ optee-utee = { path = "../../../optee-utee" }
[build-dependencies]
proto = { path = "../proto" }
optee-utee-build = { path = "../../../optee-utee-build" }
+optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" }
[profile.release]
panic = "abort"
```
**Had another errors.**
```bash
/usr/bin/ld:
/home/lsa/Documents/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/ta/target/release/deps/liboptee_utee_sys-f8f47f8412971dff.rlib(user_ta_entry.c.o):
Relocations in generic ELF (EM: 183)
/usr/bin/ld:
/home/lsa/Documents/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/ta/target/release/deps/liboptee_utee_sys-f8f47f8412971dff.rlib(user_ta_entry.c.o):
Relocations in generic ELF (EM: 183)
/usr/bin/ld:
/home/lsa/Documents/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/ta/target/release/deps/liboptee_utee_sys-f8f47f8412971dff.rlib(user_ta_entry.c.o):
Relocations in generic ELF (EM: 183)
/usr/bin/ld:
/home/lsa/Documents/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/ta/target/release/deps/liboptee_utee_sys-f8f47f8412971dff.rlib(user_ta_entry.c.o):
Relocations in generic ELF (EM: 183)
/usr/bin/ld:
/home/lsa/Documents/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/ta/target/release/deps/liboptee_utee_sys-f8f47f8412971dff.rlib(user_ta_entry.c.o):
Relocations in generic ELF (EM: 183)
collect2: error: ld returned 1 exit status
warning: `ta` (build script) generated 4 warnings
error: could not compile `ta` (build script) due to 1 previous error; 4
warnings emitted
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]