Skip to content
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

what can i do update the Rust version ? #140

Open
hallowsman opened this issue Jul 2, 2024 · 8 comments
Open

what can i do update the Rust version ? #140

hallowsman opened this issue Jul 2, 2024 · 8 comments

Comments

@hallowsman
Copy link

when i compile the open source gmsm = "0.1",

the optee returned like this:
package byteorder v1.5.0 cannot be built because it requires rustc 1.60 or newer, while the currently active rustc version is 1.57.0-nightly.

how can i update the rust version?

@DemesneGH
Copy link
Contributor

Hi @hallowsman , please refer to the release-v0.3.0 branch (https://github.com/apache/incubator-teaclave-trustzone-sdk/tree/release-v0.3.0) which has updated the Rust version to May 2024, thanks!

@hallowsman
Copy link
Author

Hi @hallowsman , please refer to the release-v0.3.0 branch (https://github.com/apache/incubator-teaclave-trustzone-sdk/tree/release-v0.3.0) which has updated the Rust version to May 2024, thanks!

这个编译流程和以前的一样吗 我这边执行了source environment make -C examples/helloworld-rs 然后编译错误

@hallowsman
Copy link
Author

联想截图_20240702133124

@DemesneGH
Copy link
Contributor

try the following steps in SDK root:

$ ./setup.sh
$ source environment
$ make optee
$ make -C examples/hello_world-rs

@hallowsman
Copy link
Author

hallowsman commented Jul 2, 2024

try the following steps in SDK root:

$ ./setup.sh
$ source environment
$ make optee
$ make -C examples/hello_world-rs

when i executed make -C examples/hello_world-rs it shows like this

make: 进入目录“/incubator-teaclave-trustzone-sdk/examples/hello_world-rs”
make[1]: 进入目录“/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host”
warning: /root/.cargo/config is deprecated in favor of config.toml
note: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml
Compiling hello_world-rs v0.3.0 (/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host)
error: linking with cc failed: exit status: 1
|
= note: LC_ALL="C" PATH="/root/.rustup/toolchains/nightly-2024-05-15-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/incubator-teaclave-trustzone-sdk/optee/toolchains/aarch64/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/root/.cargo/bin" VSLANG="1033" "cc" "/tmp/rustcakcQQs/symbols.o" "/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host/target/aarch64-unknown-linux-gnu/release/deps/hello_world_rs-57cf63159004a962.hello_world_rs.de1e8a22ccd3c5d6-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host/target/aarch64-unknown-linux-gnu/release/deps" "-L" "/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host/target/release/deps" "-L" "/incubator-teaclave-trustzone-sdk/optee/optee_client/out/libteec" "-L" "/root/.rustup/toolchains/nightly-2024-05-15-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/root/.rustup/toolchains/nightly-2024-05-15-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libcompiler_builtins-8750659c02157b46.rlib" "-Wl,-Bdynamic" "-lteec" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/nightly-2024-05-15-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-o" "/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host/target/aarch64-unknown-linux-gnu/release/deps/hello_world_rs-57cf63159004a962" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
= note: /usr/bin/ld: /incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host/target/aarch64-unknown-linux-gnu/release/deps/hello_world_rs-57cf63159004a962.hello_world_rs.de1e8a22ccd3c5d6-cgu.0.rcgu.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host/target/aarch64-unknown-linux-gnu/release/deps/hello_world_rs-57cf63159004a962.hello_world_rs.de1e8a22ccd3c5d6-cgu.0.rcgu.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host/target/aarch64-unknown-linux-gnu/release/deps/hello_world_rs-57cf63159004a962.hello_world_rs.de1e8a22ccd3c5d6-cgu.0.rcgu.o: Relocations in generic ELF (EM: 183)

@DemesneGH
Copy link
Contributor

Seems you're using the other "cc" which should be aarch64-linux-gnu-gcc, do you sync all files from "release-v0.3.0" branch?

warning: /root/.cargo/config is deprecated in favor of config.toml
note: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml

this warning should not exist in the v0.3.0 version and in config.toml we set the linker as aarch64-linux-gnu-gcc

@hallowsman
Copy link
Author

hallowsman commented Jul 2, 2024

Seems you're using the other "cc" which should be aarch64-linux-gnu-gcc, do you sync all files from "release-v0.3.0" branch?

warning: /root/.cargo/config is deprecated in favor of config.toml
note: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml

this warning should not exist in the v0.3.0 version and in config.toml we set the linker as aarch64-linux-gnu-gcc

now it shows the error like this:
error: couldn't canonicalize ../../../rust/rust/library/rustc-std-workspace-alloc
caused by: No such file or directory (os error 2)

oot@rust-optee:/incubator-teaclave-trustzone-sdk# make -C examples/hello_world-rs/
make: 进入目录“/incubator-teaclave-trustzone-sdk/examples/hello_world-rs”
make[1]: 进入目录“/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host”
Updating crates.io index
Downloaded proc-macro2 v0.4.30
Downloaded hex v0.3.2
Downloaded uuid v1.8.0
Downloaded unicode-xid v0.1.0
Downloaded quote v0.6.13
Downloaded syn v0.15.44
Downloaded libc v0.2.95
Downloaded uuid v0.7.2
Downloaded 8 crates (856.0 KB) in 1.11s
Compiling proc-macro2 v0.4.30
Compiling unicode-xid v0.1.0
Compiling syn v0.15.44
Compiling libc v0.2.95
Compiling uuid v1.8.0
Compiling hex v0.3.2
Compiling uuid v0.7.2
Compiling proto v0.3.0 (/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/proto)
Compiling quote v0.6.13
Compiling optee-teec-sys v0.2.0 (/incubator-teaclave-trustzone-sdk/optee-teec/optee-teec-sys)
Compiling optee-teec-macros v0.2.0 (/incubator-teaclave-trustzone-sdk/optee-teec/macros)
Compiling optee-teec v0.2.0 (/incubator-teaclave-trustzone-sdk/optee-teec)
Compiling hello_world-rs v0.3.0 (/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host)
Finished release profile [optimized] target(s) in 16.95s
make[1]: 离开目录“/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/host”
make[1]: 进入目录“/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/ta”

  • "rustc" "--print" "sysroot"
  • "rustc" "--print" "target-list"
    error: couldn't canonicalize ../../../rust/rust/library/rustc-std-workspace-alloc
    caused by: No such file or directory (os error 2)
    note: run with RUST_BACKTRACE=1 for a backtrace
    make[1]: *** [Makefile:43:ta] 错误 1
    make[1]: 离开目录“/incubator-teaclave-trustzone-sdk/examples/hello_world-rs/ta”
    make: *** [Makefile:20:all] 错误 2
    make: 离开目录“/incubator-teaclave-trustzone-sdk/examples/hello_world-rs”

@DemesneGH
Copy link
Contributor

Try update setup.sh and run it.
If still having problem, recommend creating a new directory and making sure the code is up-to-date, then setup the environment on a new docker container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants