diff --git a/aarch64-unknown-optee.json b/aarch64-unknown-optee.json index 34c36960..bed042e8 100644 --- a/aarch64-unknown-optee.json +++ b/aarch64-unknown-optee.json @@ -1,6 +1,6 @@ { "arch": "aarch64", - "data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", "features": "+strict-align", "dynamic-linking": false, "executables": true, @@ -12,9 +12,9 @@ "os": "optee", "position-independent-executables": true, "relro-level": "full", - "target-c-int-width": "32", + "target-c-int-width": 32, "target-endian": "little", - "target-pointer-width": "64", + "target-pointer-width": 64, "vendor": "unknown", "panic-strategy": "abort" } diff --git a/arm-unknown-optee.json b/arm-unknown-optee.json index 79cf1257..1151d046 100644 --- a/arm-unknown-optee.json +++ b/arm-unknown-optee.json @@ -7,14 +7,15 @@ "has-rpath": true, "linker-flavor": "ld", "linker-is-gnu": true, + "llvm-floatabi": "hard", "llvm-target": "arm-unknown-linux-gnueabihf", "max-atomic-width": 64, "os": "optee", "position-independent-executables": true, "relro-level": "full", - "target-c-int-width": "32", + "target-c-int-width": 32, "target-endian": "little", - "target-pointer-width": "32", + "target-pointer-width": 32, "vendor": "unknown", "panic-strategy": "abort", "singlethread": true diff --git a/environment b/environment index e740560d..0d714277 100644 --- a/environment +++ b/environment @@ -19,6 +19,11 @@ export PATH=$PATH:$HOME/.cargo/bin # for std: specify the target json file export RUST_TARGET_PATH="$(pwd)" +# Disable incremental compilation to avoid ICE with recent nightly +# error: internal compiler error: encountered incremental compilation error +# with lints_that_dont_need_to_run(0-0) +export CARGO_INCREMENTAL=0 + if [ -z "$OPTEE_DIR" ] then echo -e "OPTEE_DIR has not set, use $PWD/optee/ as default\n" @@ -41,6 +46,8 @@ then echo "set TARGET_TA=$TARGET_TA (std)" export BUILDER=xargo export FEATURES="--features std" + export XARGO_RUST_SRC="$(pwd)/rust/rust/library" + export RUSTFLAGS="-Zunstable-options" else export TARGET_TA="arm-unknown-linux-gnueabihf" echo "set TARGET_TA=$TARGET_TA (no-std)" @@ -58,6 +65,8 @@ else echo "set TARGET_TA=$TARGET_TA (std)" export BUILDER=xargo export FEATURES="--features std" + export XARGO_RUST_SRC="$(pwd)/rust/rust/library" + export RUSTFLAGS="-Zunstable-options" else export TARGET_TA="aarch64-unknown-linux-gnu" echo "set TARGET_TA=$TARGET_TA (no-std)" diff --git a/examples/client_pool-rs/ta/Cargo.toml b/examples/client_pool-rs/ta/Cargo.toml index d6c609fc..e8fbed1f 100644 --- a/examples/client_pool-rs/ta/Cargo.toml +++ b/examples/client_pool-rs/ta/Cargo.toml @@ -31,7 +31,7 @@ std = ["optee-utee/std", "optee-utee-sys/std"] [dependencies] proto = { path = "../proto" } optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" } -optee-utee = { path = "../../../optee-utee" } +optee-utee = { path = "../../../optee-utee", features = ["unwind_stubs"] } hex = { version = "0.4.3", default-features = false } [build-dependencies] diff --git a/examples/message_passing_interface-rs/ta/Cargo.lock b/examples/message_passing_interface-rs/ta/Cargo.lock index 538e6260..b31ff891 100644 --- a/examples/message_passing_interface-rs/ta/Cargo.lock +++ b/examples/message_passing_interface-rs/ta/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "bitflags" @@ -60,12 +60,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7581282928bc99698341d1de7590964c28db747c164eaac9409432a3eaed098a" -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" - [[package]] name = "log" version = "0.4.27" @@ -93,9 +87,9 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro2 1.0.95", - "quote 1.0.40", - "syn 2.0.101", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -106,7 +100,7 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "optee-utee" -version = "0.7.0" +version = "0.8.0" dependencies = [ "bitflags", "hex", @@ -120,30 +114,26 @@ dependencies = [ [[package]] name = "optee-utee-build" -version = "0.7.0" +version = "0.8.0" dependencies = [ - "litemap", "prettyplease", - "proc-macro2 1.0.95", - "quote 1.0.40", - "syn 2.0.101", - "uuid 1.17.0", - "zerofrom", + "proc-macro2", + "quote", + "syn", + "uuid 1.22.0", ] [[package]] name = "optee-utee-macros" -version = "0.7.0" +version = "0.8.0" dependencies = [ - "litemap", - "quote 0.6.13", - "syn 0.15.44", - "zerofrom", + "quote", + "syn", ] [[package]] name = "optee-utee-sys" -version = "0.7.0" +version = "0.8.0" dependencies = [ "libc", ] @@ -154,17 +144,8 @@ version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dee91521343f4c5c6a63edd65e54f31f5c92fe8978c40a4282f8372194c6a7d" dependencies = [ - "proc-macro2 1.0.95", - "syn 2.0.101", -] - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid", + "proc-macro2", + "syn", ] [[package]] @@ -184,22 +165,13 @@ dependencies = [ "serde", ] -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ - "proc-macro2 1.0.95", + "proc-macro2", ] [[package]] @@ -244,9 +216,9 @@ version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ - "proc-macro2 1.0.95", - "quote 1.0.40", - "syn 2.0.101", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -268,21 +240,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", - "proc-macro2 1.0.95", - "quote 1.0.40", + "proc-macro2", + "quote", "rustversion", - "syn 2.0.101", -] - -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid", + "syn", ] [[package]] @@ -291,8 +252,8 @@ version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ - "proc-macro2 1.0.95", - "quote 1.0.40", + "proc-macro2", + "quote", "unicode-ident", ] @@ -313,12 +274,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "uuid" version = "0.8.2" @@ -327,9 +282,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.17.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" dependencies = [ "js-sys", "wasm-bindgen", @@ -355,9 +310,9 @@ checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "proc-macro2 1.0.95", - "quote 1.0.40", - "syn 2.0.101", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-shared", ] @@ -367,7 +322,7 @@ version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ - "quote 1.0.40", + "quote", "wasm-bindgen-macro-support", ] @@ -377,9 +332,9 @@ version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ - "proc-macro2 1.0.95", - "quote 1.0.40", - "syn 2.0.101", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -392,9 +347,3 @@ checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ "unicode-ident", ] - -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" diff --git a/examples/message_passing_interface-rs/ta/Cargo.toml b/examples/message_passing_interface-rs/ta/Cargo.toml index 5dfab1fd..02abc592 100644 --- a/examples/message_passing_interface-rs/ta/Cargo.toml +++ b/examples/message_passing_interface-rs/ta/Cargo.toml @@ -31,7 +31,7 @@ std = ["optee-utee/std", "optee-utee-sys/std"] [dependencies] proto = { path = "../proto" } optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" } -optee-utee = { path = "../../../optee-utee" } +optee-utee = { path = "../../../optee-utee", features = ["unwind_stubs"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } [build-dependencies] diff --git a/examples/message_passing_interface-rs/ta/Makefile b/examples/message_passing_interface-rs/ta/Makefile index edaa38d1..4b03489b 100644 --- a/examples/message_passing_interface-rs/ta/Makefile +++ b/examples/message_passing_interface-rs/ta/Makefile @@ -26,11 +26,6 @@ LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)gcc\" # fix for the error: "unwinding panics are not supported without std" reported by clippy # Set panic=abort for std and no-std RUSTFLAGS := -C panic=abort -ifeq ($(BUILDER),xargo) -EXTRA_FLAGS = -else -EXTRA_FLAGS = -Z build-std=core,alloc -Z build-std-features=panic_immediate_abort -endif TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py @@ -43,10 +38,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(EXTRA_FLAGS) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic ta: clippy - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) build --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) $(EXTRA_FLAGS) + @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) build --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/mnist-rs/rust-toolchain.toml b/examples/mnist-rs/rust-toolchain.toml deleted file mode 100644 index 77b51bcd..00000000 --- a/examples/mnist-rs/rust-toolchain.toml +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Toolchain override, burn currently requires Rust channel current and prev. - -[toolchain] -channel = "nightly-2025-05-16" -components = [ "rust-src", "rustfmt", "clippy" ] -targets = ["aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabihf"] -# minimal profile: install rustc, cargo, and rust-std -profile = "minimal" diff --git a/examples/mnist-rs/ta/Cargo.toml b/examples/mnist-rs/ta/Cargo.toml index 5fa5ec72..c1a8e807 100644 --- a/examples/mnist-rs/ta/Cargo.toml +++ b/examples/mnist-rs/ta/Cargo.toml @@ -33,7 +33,7 @@ authors = ["Teaclave Contributors "] [workspace.dependencies] optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" } -optee-utee = { path = "../../../optee-utee" } +optee-utee = { path = "../../../optee-utee", features = ["unwind_stubs"] } optee-utee-build = { path = "../../../optee-utee-build" } proto = { path = "../proto" } diff --git a/examples/mnist-rs/ta/inference/Makefile b/examples/mnist-rs/ta/inference/Makefile index 00bf71fb..62e344ef 100644 --- a/examples/mnist-rs/ta/inference/Makefile +++ b/examples/mnist-rs/ta/inference/Makefile @@ -25,7 +25,6 @@ OBJCOPY := $(CROSS_COMPILE)objcopy LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)gcc\" # fix for the error: "unwinding panics are not supported without std" reported by clippy RUSTFLAGS := -C panic=abort -EXTRA_FLAGS = -Z build-std=core,alloc -Z build-std-features=panic_immediate_abort TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py @@ -35,10 +34,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy --target $(TARGET) $(EXTRA_FLAGS) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy --target $(TARGET) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic ta: clippy - @RUSTFLAGS="$(RUSTFLAGS)" cargo build --target $(TARGET) --release --config $(LINKER_CFG) $(EXTRA_FLAGS) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build --target $(TARGET) --release --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/stripped_$(NAME) diff --git a/examples/mnist-rs/ta/train/Makefile b/examples/mnist-rs/ta/train/Makefile index 34594c51..02fd96f5 100644 --- a/examples/mnist-rs/ta/train/Makefile +++ b/examples/mnist-rs/ta/train/Makefile @@ -25,7 +25,6 @@ OBJCOPY := $(CROSS_COMPILE)objcopy LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)gcc\" # fix for the error: "unwinding panics are not supported without std" reported by clippy RUSTFLAGS := -C panic=abort -EXTRA_FLAGS = -Z build-std=core,alloc TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py @@ -35,10 +34,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy --target $(TARGET) $(EXTRA_FLAGS) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy --target $(TARGET) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic ta: clippy - @RUSTFLAGS="$(RUSTFLAGS)" cargo build --target $(TARGET) --release --config $(LINKER_CFG) $(EXTRA_FLAGS) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build --target $(TARGET) --release --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/stripped_$(NAME) diff --git a/examples/property-rs/ta/Cargo.toml b/examples/property-rs/ta/Cargo.toml index b607aced..0ea029a8 100644 --- a/examples/property-rs/ta/Cargo.toml +++ b/examples/property-rs/ta/Cargo.toml @@ -31,7 +31,7 @@ std = ["optee-utee/std", "optee-utee-sys/std"] [dependencies] proto = { path = "../proto" } optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" } -optee-utee = { path = "../../../optee-utee" } +optee-utee = { path = "../../../optee-utee", features = ["unwind_stubs"] } [build-dependencies] proto = { path = "../proto" } diff --git a/examples/secure_db_abstraction-rs/ta/Cargo.lock b/examples/secure_db_abstraction-rs/ta/Cargo.lock index 1ce801f0..7924bfaf 100644 --- a/examples/secure_db_abstraction-rs/ta/Cargo.lock +++ b/examples/secure_db_abstraction-rs/ta/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "allocator-api2" @@ -10,9 +10,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "bincode" @@ -25,9 +25,21 @@ dependencies = [ [[package]] name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "equivalent" @@ -66,43 +78,54 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "libc" -version = "0.2.172" +name = "js-sys" +version = "0.3.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "14dc6f6450b3f6d4ed5b16327f38fed626d375a886159ca555bd7822c0c3a5a6" +dependencies = [ + "once_cell", + "wasm-bindgen", +] [[package]] -name = "libc_alloc" -version = "1.0.5" +name = "libc" +version = "0.2.182" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004feaae88f49fe8cfeffb4565dae94ac608313e454ebab4a4d0d0202b553fb3" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] -name = "litemap" -version = "0.7.4" +name = "libc_alloc" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "7581282928bc99698341d1de7590964c28db747c164eaac9409432a3eaed098a" [[package]] name = "num_enum" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" dependencies = [ "num_enum_derive", + "rustversion", ] [[package]] name = "num_enum_derive" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + [[package]] name = "optee-utee" version = "0.8.0" @@ -121,23 +144,19 @@ dependencies = [ name = "optee-utee-build" version = "0.8.0" dependencies = [ - "litemap", "prettyplease", "proc-macro2", "quote", "syn", - "uuid 1.13.1", - "zerofrom", + "uuid 1.22.0", ] [[package]] name = "optee-utee-macros" version = "0.8.0" dependencies = [ - "litemap", "quote", "syn", - "zerofrom", ] [[package]] @@ -149,9 +168,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.29" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", "syn", @@ -159,9 +178,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -175,9 +194,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] @@ -193,9 +212,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "secure_db" @@ -217,18 +236,28 @@ checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -250,9 +279,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -274,9 +303,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "uuid" @@ -286,12 +315,55 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.13.1" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced87ca4be083373936a67f8de945faa23b6b42384bd5b64434850802c6dccd0" +checksum = "60722a937f594b7fde9adb894d7c092fc1bb6612897c46368d18e7a20208eff2" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] [[package]] -name = "zerofrom" -version = "0.1.5" +name = "wasm-bindgen-macro" +version = "0.2.113" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac8c6395094b6b91c4af293f4c79371c163f9a6f56184d2c9a85f5a95f3950" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.113" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3fabce6159dc20728033842636887e4877688ae94382766e00b180abac9d60" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "de0e091bdb824da87dc01d967388880d017a0a9bc4f3bdc0d86ee9f9336e3bb5" +dependencies = [ + "unicode-ident", +] diff --git a/examples/serde-rs/ta/Cargo.lock b/examples/serde-rs/ta/Cargo.lock index 07166a86..28647736 100644 --- a/examples/serde-rs/ta/Cargo.lock +++ b/examples/serde-rs/ta/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "bitflags" @@ -60,12 +60,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7581282928bc99698341d1de7590964c28db747c164eaac9409432a3eaed098a" -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" - [[package]] name = "memchr" version = "2.7.6" @@ -88,9 +82,9 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" dependencies = [ - "proc-macro2 1.0.103", - "quote 1.0.42", - "syn 2.0.109", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -101,7 +95,7 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "optee-utee" -version = "0.7.0" +version = "0.8.0" dependencies = [ "bitflags", "hex", @@ -115,30 +109,26 @@ dependencies = [ [[package]] name = "optee-utee-build" -version = "0.7.0" +version = "0.8.0" dependencies = [ - "litemap", "prettyplease", - "proc-macro2 1.0.103", - "quote 1.0.42", - "syn 2.0.109", - "uuid 1.18.1", - "zerofrom", + "proc-macro2", + "quote", + "syn", + "uuid 1.22.0", ] [[package]] name = "optee-utee-macros" -version = "0.7.0" +version = "0.8.0" dependencies = [ - "litemap", - "quote 0.6.13", - "syn 0.15.44", - "zerofrom", + "quote", + "syn", ] [[package]] name = "optee-utee-sys" -version = "0.7.0" +version = "0.8.0" dependencies = [ "libc", ] @@ -149,17 +139,8 @@ version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ - "proc-macro2 1.0.103", - "syn 2.0.109", -] - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid", + "proc-macro2", + "syn", ] [[package]] @@ -179,22 +160,13 @@ dependencies = [ "serde", ] -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ - "proc-macro2 1.0.103", + "proc-macro2", ] [[package]] @@ -249,9 +221,9 @@ version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ - "proc-macro2 1.0.103", - "quote 1.0.42", - "syn 2.0.109", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -274,21 +246,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", - "proc-macro2 1.0.103", - "quote 1.0.42", + "proc-macro2", + "quote", "rustversion", - "syn 2.0.109", -] - -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid", + "syn", ] [[package]] @@ -297,8 +258,8 @@ version = "2.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f17c7e013e88258aa9543dcbe81aca68a667a9ac37cd69c9fbc07858bfe0e2f" dependencies = [ - "proc-macro2 1.0.103", - "quote 1.0.42", + "proc-macro2", + "quote", "unicode-ident", ] @@ -320,12 +281,6 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "uuid" version = "0.8.2" @@ -334,9 +289,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.18.1" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" dependencies = [ "js-sys", "wasm-bindgen", @@ -361,7 +316,7 @@ version = "0.2.105" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" dependencies = [ - "quote 1.0.42", + "quote", "wasm-bindgen-macro-support", ] @@ -372,9 +327,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" dependencies = [ "bumpalo", - "proc-macro2 1.0.103", - "quote 1.0.42", - "syn 2.0.109", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-shared", ] @@ -386,9 +341,3 @@ checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" dependencies = [ "unicode-ident", ] - -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" diff --git a/examples/serde-rs/ta/Cargo.toml b/examples/serde-rs/ta/Cargo.toml index 1037dc06..879a793f 100644 --- a/examples/serde-rs/ta/Cargo.toml +++ b/examples/serde-rs/ta/Cargo.toml @@ -31,7 +31,7 @@ std = ["optee-utee/std", "optee-utee-sys/std"] [dependencies] proto = { path = "../proto" } optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" } -optee-utee = { path = "../../../optee-utee" } +optee-utee = { path = "../../../optee-utee", features = ["unwind_stubs"] } serde = { version = "1.0", default-features = false, features = ["derive"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } diff --git a/examples/serde-rs/ta/Makefile b/examples/serde-rs/ta/Makefile index fcb50dae..c42ea0a4 100644 --- a/examples/serde-rs/ta/Makefile +++ b/examples/serde-rs/ta/Makefile @@ -26,11 +26,6 @@ LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)gcc\" # fix for the error: "unwinding panics are not supported without std" reported by clippy # Set panic=abort for std and no-std RUSTFLAGS := -C panic=abort -ifeq ($(BUILDER),xargo) -EXTRA_FLAGS = -else -EXTRA_FLAGS = -Z build-std=core,alloc -Z build-std-features=panic_immediate_abort -endif TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py @@ -43,10 +38,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(EXTRA_FLAGS) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic ta: clippy - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) build --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) $(EXTRA_FLAGS) + @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) build --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/tcp_client-rs/ta/Cargo.toml b/examples/tcp_client-rs/ta/Cargo.toml index fe36e12d..7350c8f7 100644 --- a/examples/tcp_client-rs/ta/Cargo.toml +++ b/examples/tcp_client-rs/ta/Cargo.toml @@ -31,7 +31,7 @@ std = ["optee-utee/std", "optee-utee-sys/std"] [dependencies] proto = { path = "../proto" } optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" } -optee-utee = { path = "../../../optee-utee" } +optee-utee = { path = "../../../optee-utee", features = ["unwind_stubs"] } cfg_block = "0.2.0" [build-dependencies] diff --git a/examples/tcp_client-rs/ta/Makefile b/examples/tcp_client-rs/ta/Makefile index 8830d17d..c5e87862 100644 --- a/examples/tcp_client-rs/ta/Makefile +++ b/examples/tcp_client-rs/ta/Makefile @@ -15,8 +15,6 @@ # specific language governing permissions and limitations # under the License. -# STD-ONLY example - UUID ?= $(shell cat "../uuid.txt") TARGET ?= aarch64-unknown-linux-gnu @@ -44,7 +42,6 @@ clippy: ta: clippy @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) build --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) - strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/tls_client-rs/ta/Cargo.lock b/examples/tls_client-rs/ta/Cargo.lock index ea6bcc1c..18967dff 100644 --- a/examples/tls_client-rs/ta/Cargo.lock +++ b/examples/tls_client-rs/ta/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aead" @@ -428,12 +428,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" - [[package]] name = "log" version = "0.4.27" @@ -538,23 +532,19 @@ dependencies = [ name = "optee-utee-build" version = "0.8.0" dependencies = [ - "litemap", "prettyplease", "proc-macro2", "quote", "syn", - "uuid 1.17.0", - "zerofrom", + "uuid 1.22.0", ] [[package]] name = "optee-utee-macros" version = "0.8.0" dependencies = [ - "litemap", "quote", "syn", - "zerofrom", ] [[package]] @@ -1056,9 +1046,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.17.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" dependencies = [ "js-sys", "wasm-bindgen", @@ -1247,12 +1237,6 @@ dependencies = [ "syn", ] -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" - [[package]] name = "zeroize" version = "1.8.1" diff --git a/examples/tls_server-rs/ta/Cargo.lock b/examples/tls_server-rs/ta/Cargo.lock index 75d23647..c540d072 100644 --- a/examples/tls_server-rs/ta/Cargo.lock +++ b/examples/tls_server-rs/ta/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aead" @@ -428,12 +428,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" - [[package]] name = "log" version = "0.4.27" @@ -538,23 +532,19 @@ dependencies = [ name = "optee-utee-build" version = "0.8.0" dependencies = [ - "litemap", "prettyplease", "proc-macro2", "quote", "syn", - "uuid 1.18.0", - "zerofrom", + "uuid 1.22.0", ] [[package]] name = "optee-utee-macros" version = "0.8.0" dependencies = [ - "litemap", "quote", "syn", - "zerofrom", ] [[package]] @@ -1056,9 +1046,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.18.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" dependencies = [ "js-sys", "wasm-bindgen", @@ -1238,12 +1228,6 @@ dependencies = [ "syn", ] -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" - [[package]] name = "zeroize" version = "1.8.1" diff --git a/examples/udp_socket-rs/ta/Cargo.toml b/examples/udp_socket-rs/ta/Cargo.toml index fe36e12d..7350c8f7 100644 --- a/examples/udp_socket-rs/ta/Cargo.toml +++ b/examples/udp_socket-rs/ta/Cargo.toml @@ -31,7 +31,7 @@ std = ["optee-utee/std", "optee-utee-sys/std"] [dependencies] proto = { path = "../proto" } optee-utee-sys = { path = "../../../optee-utee/optee-utee-sys" } -optee-utee = { path = "../../../optee-utee" } +optee-utee = { path = "../../../optee-utee", features = ["unwind_stubs"] } cfg_block = "0.2.0" [build-dependencies] diff --git a/examples/udp_socket-rs/ta/Makefile b/examples/udp_socket-rs/ta/Makefile index e407b272..c5e87862 100644 --- a/examples/udp_socket-rs/ta/Makefile +++ b/examples/udp_socket-rs/ta/Makefile @@ -15,8 +15,6 @@ # specific language governing permissions and limitations # under the License. -# STD-ONLY example - UUID ?= $(shell cat "../uuid.txt") TARGET ?= aarch64-unknown-linux-gnu @@ -35,7 +33,6 @@ OUT_DIR := $(CURDIR)/target/$(TARGET)/release BUILDER ?= cargo FEATURES ?= -FEATURES ?= all: clippy ta strip sign @@ -45,7 +42,6 @@ clippy: ta: clippy @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) build --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) - strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/optee-teec/Cargo.toml b/optee-teec/Cargo.toml index 7b10587a..251db677 100644 --- a/optee-teec/Cargo.toml +++ b/optee-teec/Cargo.toml @@ -27,7 +27,7 @@ edition = "2018" [dependencies] optee-teec-sys = { version = "0.8.0", path = "optee-teec-sys" } optee-teec-macros = { version = "0.8.0", path = "macros" } -uuid = "0.7" +uuid = "1.22.0" hex = "0.3" num_enum = { version = "0.7.3", default-features = false } diff --git a/optee-teec/macros/Cargo.toml b/optee-teec/macros/Cargo.toml index 48bdc348..1699f635 100644 --- a/optee-teec/macros/Cargo.toml +++ b/optee-teec/macros/Cargo.toml @@ -31,9 +31,3 @@ proc-macro = true quote = "1.0" syn = { version = "2.0", features = ["full"] } -# The newer versions of these crates require rustc 1.81, while our custom -# patched STD version is 1.80, causing compatibility issues. To resolve this, -# we have to set the crates to an exact compatible version. -# Remove them after we upgrade our patched STD rustc. -litemap = "=0.7.4" -zerofrom = "=0.1.5" diff --git a/optee-utee-build/Cargo.toml b/optee-utee-build/Cargo.toml index b50d73fd..21d845cf 100644 --- a/optee-utee-build/Cargo.toml +++ b/optee-utee-build/Cargo.toml @@ -29,11 +29,6 @@ quote = "1.0.37" proc-macro2 = "1.0.92" syn = "2.0.90" prettyplease = "0.2.25" +uuid = "1.22.0" + -# The newer versions of these crates require rustc 1.81, while our custom -# patched STD version is 1.80, causing compatibility issues. To resolve this, -# we have to set the crates to an exact compatible version. -# Remove them after we upgrade our patched STD rustc. -litemap = "=0.7.4" -uuid = "=1.20.0" -zerofrom = "=0.1.5" diff --git a/optee-utee/Cargo.toml b/optee-utee/Cargo.toml index 38b3a753..9a37c393 100644 --- a/optee-utee/Cargo.toml +++ b/optee-utee/Cargo.toml @@ -45,6 +45,7 @@ optee-utee-sys = { version = "0.8.0", path = "optee-utee-sys", features = ["mock default = [] std = ["optee-utee-sys/std", "optee-utee-macros/std"] no_panic_handler = [] +unwind_stubs = [] [workspace] resolver = "2" diff --git a/optee-utee/macros/Cargo.toml b/optee-utee/macros/Cargo.toml index 44d8450b..c956cf37 100644 --- a/optee-utee/macros/Cargo.toml +++ b/optee-utee/macros/Cargo.toml @@ -30,12 +30,6 @@ proc-macro = true [dependencies] quote = "1.0" syn = { version = "2.0", features = ["full"] } -# The newer versions of these crates require rustc 1.81, while our custom -# patched STD version is 1.80, causing compatibility issues. To resolve this, -# we have to set the crates to an exact compatible version. -# Remove them after we upgrade our patched STD rustc. -litemap = "=0.7.4" -zerofrom = "=0.1.5" [features] default = [] diff --git a/optee-utee/src/arithmetical.rs b/optee-utee/src/arithmetical.rs index 7f29dd81..1aaef3e2 100644 --- a/optee-utee/src/arithmetical.rs +++ b/optee-utee/src/arithmetical.rs @@ -34,7 +34,7 @@ impl BigInt { // size represents BigInt bits pub fn size_in_u32(size: u32) -> u32 { - ((size + 31) / 32) + 2 + size.div_ceil(32) + 2 } pub fn new(bits: u32) -> Self { diff --git a/optee-utee/src/crypto_op.rs b/optee-utee/src/crypto_op.rs index 1554a426..bc555008 100644 --- a/optee-utee/src/crypto_op.rs +++ b/optee-utee/src/crypto_op.rs @@ -56,22 +56,22 @@ impl OperationInfo { /// 1) `algorithm`: One of the algorithm of [AlgorithmId](AlgorithmId). /// 2) `mode`: One of the mode of [OperationMode](OperationMode). /// 3) `maxKeySize`: The maximum key sizes of different algorithms as defined in - /// [TransientObjectType](../object/enum.TransientObjectType.html). + /// [TransientObjectType](../object/enum.TransientObjectType.html). /// 4) `operationClass`: One of the constants from [OperationConstant](OperationConstant). /// 5) `keySize`: - /// 5.1) For an operation that makes no use of keys, 0. - /// 5.2) For an operation that uses a single key, the actual size of this key. - /// 5.3) For an operation that uses multiple keys, 0. (The actual value of `keySize` can be obtained from - /// [OperationInfoMultiple](OperationInfoMultiple)). + /// 5.1) For an operation that makes no use of keys, 0. + /// 5.2) For an operation that uses a single key, the actual size of this key. + /// 5.3) For an operation that uses multiple keys, 0. (The actual value of `keySize` can be obtained from + /// [OperationInfoMultiple](OperationInfoMultiple)). /// 6) `requiredKeyUsage`: - /// 6.1) For an operation that makes no use of keys, 0. - /// 6.2) For an operation that uses a single key, a bit vector that describes the necessary bits in the object - /// usage for `set_key` functions to succeed without panicking. - /// 6.3) For an operation that uses multiple keys, 0. (The actual value of `requiredKeyUsage` can be obtained from - /// [OperationInfoMultiple](OperationInfoMultiple). + /// 6.1) For an operation that makes no use of keys, 0. + /// 6.2) For an operation that uses a single key, a bit vector that describes the necessary bits in the object + /// usage for `set_key` functions to succeed without panicking. + /// 6.3) For an operation that uses multiple keys, 0. (The actual value of `requiredKeyUsage` can be obtained from + /// [OperationInfoMultiple](OperationInfoMultiple)). /// 7) `digestLength`: For a [Mac](Mac), [AE](AE), or [Digest](Digest), describes the number of bytes in the digest or tag. /// 8) `handleState`: A bit vector describing the current state of the operation. Contains one or more of the - /// [HandleFlag](../object/struct.HandleFlag.html). + /// [HandleFlag](../object/struct.HandleFlag.html). pub fn from_raw(raw: raw::TEE_OperationInfo) -> Self { Self { raw } } @@ -129,19 +129,20 @@ impl OperationInfoMultiple { /// 1) `algorithm`: One of the algorithm of [AlgorithmId](AlgorithmId). /// 2) `mode`: One of the mode of [OperationMode](OperationMode). /// 3) `maxKeySize`: The maximum key sizes of different algorithms as defined in - /// [TransientObjectType](../object/enum.TransientObjectType.html). + /// [TransientObjectType](../object/enum.TransientObjectType.html). /// 4) `operationClass`: One of the constants from [OperationConstant](OperationConstant). /// 5) `digestLength`: For a [Mac](Mac), [AE](AE), or [Digest](Digest), describes the number of bytes in the digest or tag. - /// 6) `handleState`: A bit vector describing the current state of the operation. Contains one or more of the [HandleFlag](../object/struct.HandleFlag.html). + /// 6) `handleState`: A bit vector describing the current state of the operation. Contains one or more of the + /// [HandleFlag](../object/struct.HandleFlag.html). /// 7) `operationState`: Every operation has two states which are defined as /// [OperationStates](OperationStates). /// 8) `numberOfKeys`: This is set to the number of keys required by this operation. May be 0 for an operation which requires no keys. /// 9) `keyInformation`: This array contains numberOfKeys entries, each of which defines the details for one key used by the operation, - /// in the order they are defined. - /// If the buffer is larger than required to support `numberOfKeys` entries, the additional space is not initialized or modified. - /// For each element: - /// 9.1) `keySize`: If a key is programmed in the operation, the actual size of this key, otherwise 0. - /// 9.2) `requiredKeyUsage`: A bit vector that describes the necessary bits in the object usage for `set_key` or `set_key_2` to succeed without panicking. + /// in the order they are defined. + /// If the buffer is larger than required to support `numberOfKeys` entries, the additional space is not initialized or modified. + /// For each element: + /// 9.1) `keySize`: If a key is programmed in the operation, the actual size of this key, otherwise 0. + /// 9.2) `requiredKeyUsage`: A bit vector that describes the necessary bits in the object usage for `set_key` or `set_key_2` to succeed without panicking. pub fn from_raw(raw: *mut raw::TEE_OperationInfoMultiple, size: usize) -> Self { Self { raw, size } } @@ -379,7 +380,7 @@ impl Digest { /// # Panics /// /// 1) If the Implementation detects any error associated with this function which is not - /// explicitly associated with a defined return code for this function. + /// explicitly associated with a defined return code for this function. pub fn allocate(algo: AlgorithmId) -> Result { match OperationHandle::allocate(algo, OperationMode::Digest, 0) { Ok(handle) => Ok(Self(handle)), @@ -417,8 +418,8 @@ impl Digest { /// # Parameters /// /// 1) `info_buf`: The buffer is supposed to save multiple keys, and its size should be large enough before passed in. - /// The number of keys about this operation can be calculated as: OperationInfoMultiple::size - - /// size_of([OperationInfoMultiple](OperationInfoMultiple)) / size_of ( raw::TEE_OperationInfoKey)+1. + /// The number of keys about this operation can be calculated as: OperationInfoMultiple::size - + /// size_of([OperationInfoMultiple](OperationInfoMultiple)) / size_of ( raw::TEE_OperationInfoKey)+1. /// /// # Example /// @@ -477,9 +478,9 @@ impl Digest { /// # Parameters /// /// 1) `src`: the source operation. - /// 1.1) If `src` has no key programmed, then the key of this operation is cleared. If there is a key - /// programmed in srcOperation, then the maximum key size of current SHALL be greater than or - /// equal to the actual key size of src. + /// 1.1) If `src` has no key programmed, then the key of this operation is cleared. If there is a key + /// programmed in srcOperation, then the maximum key size of current SHALL be greater than or + /// equal to the actual key size of src. /// /// # Example /// @@ -537,13 +538,13 @@ impl Cipher { /// # Parameters /// /// 1) `iv`: buffer contains the operation Initialization Vector, which is used for: - /// 1.1) [AesCbcNopad](AlgorithmId::AesCbcNopad): IV; - /// 1.2) [AesCtr](AlgorithmId::AesCtr): Initial Counter Value; - /// 1.3) [AesCts](AlgorithmId::AesCts): IV; - /// 1.4) [AesXts](AlgorithmId::AesXts): Tweak Value; - /// 1.5) [AesCcm](AlgorithmId::AesCcm): Nonce Value; - /// 1.6) [AesGcm](AlgorithmId::AesGcm): Nonce Value; - /// 1.7) [AesCbcNopad](AlgorithmId::AesCbcNopad): IV. + /// 1.1) [AesCbcNopad](AlgorithmId::AesCbcNopad): IV; + /// 1.2) [AesCtr](AlgorithmId::AesCtr): Initial Counter Value; + /// 1.3) [AesCts](AlgorithmId::AesCts): IV; + /// 1.4) [AesXts](AlgorithmId::AesXts): Tweak Value; + /// 1.5) [AesCcm](AlgorithmId::AesCcm): Nonce Value; + /// 1.6) [AesGcm](AlgorithmId::AesGcm): Nonce Value; + /// 1.7) [AesCbcNopad](AlgorithmId::AesCbcNopad): IV. /// /// # Panics /// @@ -601,7 +602,7 @@ impl Cipher { /// # Errors /// /// 1) `ShortBuffer`: If the output buffer is not large enough to contain the output. - /// In this case, the input is not fed into the algorithm. + /// In this case, the input is not fed into the algorithm. /// /// # Panics /// @@ -976,8 +977,8 @@ impl AE { /// /// 1) `nonce`: The peration nonce or IV /// 2) `tag_len`: Size in bits of the tag: - /// 2.1) for `AES-GCM`, can be 128, 120, 112, 104, or 96; - /// 2.2) for `AES-CCM`, can be 128, 112, 96, 80, 64, 48, or 32. + /// 2.1) for `AES-GCM`, can be 128, 120, 112, 104, or 96; + /// 2.2) for `AES-CCM`, can be 128, 112, 96, 80, 64, 48, or 32. /// 3) `aad_len`: length in bytes of the AAD (Used only for AES-CCM. Ignored for AES-GCM). /// 4) `pay_load_len`: Length in bytes of the payload (Used only for AES-CCM. Ignored for AES-GCM). /// diff --git a/optee-utee/src/lib.rs b/optee-utee/src/lib.rs index 113cee2e..59b6b5b5 100644 --- a/optee-utee/src/lib.rs +++ b/optee-utee/src/lib.rs @@ -44,6 +44,20 @@ fn panic(_info: &core::panic::PanicInfo) -> ! { loop {} } +// Stubs for unwinding symbols required by the precompiled sysroot when not using +// `-Z build-std`. These are never actually called because we compile with +// `-C panic=abort`, but the linker requires the symbols to be present. +#[cfg(all(not(feature = "std"), feature = "unwind_stubs"))] +mod unwind_stubs { + #[no_mangle] + extern "C" fn _Unwind_Resume() -> ! { + loop {} + } + + #[no_mangle] + extern "C" fn rust_eh_personality() {} +} + pub use self::arithmetical::*; pub use self::crypto_op::*; pub use self::error::{Error, ErrorKind, Result}; diff --git a/optee-utee/src/net/socket.rs b/optee-utee/src/net/socket.rs index db1690bc..cb34b939 100644 --- a/optee-utee/src/net/socket.rs +++ b/optee-utee/src/net/socket.rs @@ -27,7 +27,7 @@ use core::time::Duration; /// protocol-related tasks, including but not limited to: /// * Defining its own Setup type and using it to establish a new connection; /// * Sending and receiving data over the connection, while managing protocol -/// errors (such as permitting certain warnings but raising others). +/// errors (such as permitting certain warnings but raising others). pub trait SocketAdapter: Sized { type Setup; type Handle; diff --git a/optee-utee/src/object/generic_object.rs b/optee-utee/src/object/generic_object.rs index 5d9bfa57..6da58a3b 100644 --- a/optee-utee/src/object/generic_object.rs +++ b/optee-utee/src/object/generic_object.rs @@ -34,10 +34,10 @@ pub trait GenericObject { /// For [PersistentObject](crate::PersistentObject): /// /// * `CorruptObject`: If the persistent object is corrupt. The object - /// handle SHALL behave based on the - /// `gpd.ta.doesNotCloseHandleOnCorruptObject` property. + /// handle SHALL behave based on the + /// `gpd.ta.doesNotCloseHandleOnCorruptObject` property. /// * `StorageNotAvailable`: If the persistent object is stored in a - /// storage area which is currently inaccessible. + /// storage area which is currently inaccessible. /// /// # Panics /// @@ -61,10 +61,10 @@ pub trait GenericObject { /// For [PersistentObject](crate::PersistentObject): /// /// * `CorruptObject`: If the persistent object is corrupt. The object - /// handle SHALL behave based on the - /// `gpd.ta.doesNotCloseHandleOnCorruptObject` property. + /// handle SHALL behave based on the + /// `gpd.ta.doesNotCloseHandleOnCorruptObject` property. /// * `StorageNotAvailable`: If the persistent object is stored in a - /// storage area which is currently inaccessible. + /// storage area which is currently inaccessible. /// /// # Panics /// @@ -88,15 +88,15 @@ pub trait GenericObject { /// /// * `ItemNotFound`: If the attribute is not found on this object. /// * `SHORT_BUFFER`: If buffer is NULL or too small to contain the key - /// part. + /// part. /// /// For [PersistentObject](crate::PersistentObject): /// /// * `CorruptObject`: If the persistent object is corrupt. The object - /// handle SHALL behave based on the - /// `gpd.ta.doesNotCloseHandleOnCorruptObject` property. + /// handle SHALL behave based on the + /// `gpd.ta.doesNotCloseHandleOnCorruptObject` property. /// * `StorageNotAvailable`: If the persistent object is stored in a - /// storage area which is currently inaccessible. + /// storage area which is currently inaccessible. /// /// # Panics /// @@ -134,15 +134,15 @@ pub trait GenericObject { /// /// * `ItemNotFound`: If the attribute is not found on this object. /// * `SHORT_BUFFER`: If buffer is NULL or too small to contain the key - /// part. + /// part. /// /// For [PersistentObject](crate::PersistentObject): /// /// * `CorruptObject`: If the persistent object is corrupt. The object - /// handle SHALL behave based on the - /// `gpd.ta.doesNotCloseHandleOnCorruptObject` property. + /// handle SHALL behave based on the + /// `gpd.ta.doesNotCloseHandleOnCorruptObject` property. /// * `StorageNotAvailable`: If the persistent object is stored in a - /// storage area which is currently inaccessible. + /// storage area which is currently inaccessible. /// /// # Panics /// diff --git a/optee-utee/src/object/transient_object.rs b/optee-utee/src/object/transient_object.rs index 6c17587a..acb18b8e 100644 --- a/optee-utee/src/object/transient_object.rs +++ b/optee-utee/src/object/transient_object.rs @@ -56,7 +56,7 @@ pub enum TransientObjectType { RsaKeypair = 0xA1000030, /// Depends on Algorithm: /// 1) [DsaSha1](crate::AlgorithmId::DsaSha1): - /// Between 512 and 1024 bits, multiple of 64 bits + /// Between 512 and 1024 bits, multiple of 64 bits /// 2) [DsaSha224](crate::AlgorithmId::DsaSha224): 2048 bits /// 3) [DsaSha256](crate::AlgorithmId::DsaSha256): 2048 or 3072 bits DsaPublicKey = 0xA0000031, diff --git a/optee-utee/src/parameter.rs b/optee-utee/src/parameter.rs index db2475bb..ffdd2536 100644 --- a/optee-utee/src/parameter.rs +++ b/optee-utee/src/parameter.rs @@ -108,7 +108,7 @@ impl Parameter { /// # Safety /// The caller must ensure that the raw pointer is valid and points to a properly initialized TEE_Param. - pub unsafe fn as_value(&mut self) -> Result { + pub unsafe fn as_value(&mut self) -> Result> { match self.param_type { ParamType::ValueInput | ParamType::ValueInout | ParamType::ValueOutput => { Ok(ParamValue { @@ -123,7 +123,7 @@ impl Parameter { /// # Safety /// The caller must ensure that the raw pointer is valid and points to a properly initialized TEE_Param. - pub unsafe fn as_memref(&mut self) -> Result { + pub unsafe fn as_memref(&mut self) -> Result> { match self.param_type { ParamType::MemrefInout | ParamType::MemrefInput | ParamType::MemrefOutput => { Ok(ParamMemref { diff --git a/optee-utee/src/time.rs b/optee-utee/src/time.rs index ededa713..5dcd393f 100644 --- a/optee-utee/src/time.rs +++ b/optee-utee/src/time.rs @@ -89,7 +89,6 @@ impl Time { /// # Panics /// /// 1) If the Implementation detects any error. - pub fn wait(timeout: u32) -> Result<()> { match unsafe { raw::TEE_Wait(timeout) } { raw::TEE_SUCCESS => Ok(()), diff --git a/projects/web3/eth_wallet/host/Cargo.toml b/projects/web3/eth_wallet/host/Cargo.toml index 011d9adb..e2ed6cd9 100644 --- a/projects/web3/eth_wallet/host/Cargo.toml +++ b/projects/web3/eth_wallet/host/Cargo.toml @@ -33,11 +33,7 @@ bincode = "1.3.3" anyhow = "1.0" hex = { version = "0.4", features = ["serde"] } -# The newer versions of these crates require rustc > 1.80, while our custom -# patched STD version is 1.80, causing compatibility issues. To resolve this, -# we have to set the crates to an exact compatible version. -# Remove them after we upgrade our patched STD rustc. -uuid = { version = "=1.20.0", features = ["serde"] } +uuid = { version = "1.22.0", features = ["serde"] } [profile.release] lto = true diff --git a/projects/web3/eth_wallet/ta/Cargo.lock b/projects/web3/eth_wallet/ta/Cargo.lock index 4da11a2d..17d9f125 100644 --- a/projects/web3/eth_wallet/ta/Cargo.lock +++ b/projects/web3/eth_wallet/ta/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "allocator-api2" @@ -93,6 +93,12 @@ dependencies = [ "sha2", ] +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + [[package]] name = "bytes" version = "1.9.0" @@ -321,6 +327,16 @@ dependencies = [ "digest 0.9.0", ] +[[package]] +name = "js-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + [[package]] name = "k256" version = "0.10.4" @@ -344,28 +360,22 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "libc" -version = "0.2.153" - [[package]] name = "libc" version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libc" +version = "0.2.182" + [[package]] name = "libc_alloc" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7581282928bc99698341d1de7590964c28db747c164eaac9409432a3eaed098a" -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" - [[package]] name = "num-traits" version = "0.2.19" @@ -425,23 +435,19 @@ dependencies = [ name = "optee-utee-build" version = "0.8.0" dependencies = [ - "litemap", "prettyplease", "proc-macro2", "quote", "syn", - "uuid 1.11.0", - "zerofrom", + "uuid 1.22.0", ] [[package]] name = "optee-utee-macros" version = "0.8.0" dependencies = [ - "litemap", "quote", "syn", - "zerofrom", ] [[package]] @@ -485,7 +491,7 @@ version = "0.4.0" dependencies = [ "num_enum", "serde", - "uuid 1.11.0", + "uuid 1.22.0", ] [[package]] @@ -606,18 +612,28 @@ checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -714,7 +730,7 @@ dependencies = [ "bip32", "ethereum-tx-sign", "hex", - "libc 0.2.153", + "libc 0.2.182", "optee-utee", "optee-utee-build", "optee-utee-sys", @@ -723,7 +739,7 @@ dependencies = [ "secure_db", "serde", "sha3 0.10.8", - "uuid 1.11.0", + "uuid 1.22.0", ] [[package]] @@ -755,11 +771,13 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.11.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" dependencies = [ - "serde", + "js-sys", + "serde_core", + "wasm-bindgen", ] [[package]] @@ -769,10 +787,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] -name = "zerofrom" -version = "0.1.5" +name = "wasm-bindgen" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +dependencies = [ + "unicode-ident", +] [[package]] name = "zeroize" diff --git a/projects/web3/eth_wallet/ta/Cargo.toml b/projects/web3/eth_wallet/ta/Cargo.toml index f60daa43..b57841c0 100644 --- a/projects/web3/eth_wallet/ta/Cargo.toml +++ b/projects/web3/eth_wallet/ta/Cargo.toml @@ -39,11 +39,7 @@ sha3 = "0.10.6" secp256k1 = "0.27.0" ethereum-tx-sign = "6.1.3" bincode = "1.3.3" -# The newer versions of these crates require rustc 1.81, while our custom -# patched STD version is 1.80, causing compatibility issues. To resolve this, -# we have to set the crates to an exact compatible version. -# Remove them after we upgrade our patched STD rustc. -uuid = { version = "=1.20.0", default-features = false } +uuid = { version = "1.22.0", default-features = false } [build-dependencies] uuid = { version = "1.8", default-features = false } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a2b17a9a..1e0d2a77 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -18,7 +18,7 @@ # Toolchain override for rustup [toolchain] -channel = "nightly-2024-05-15" +channel = "nightly-2025-12-11" components = [ "rust-src", "rustfmt", "clippy" ] targets = ["aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabihf"] # minimal profile: install rustc, cargo, and rust-std diff --git a/setup_std_dependencies.sh b/setup_std_dependencies.sh index adc3537d..5e390ec0 100755 --- a/setup_std_dependencies.sh +++ b/setup_std_dependencies.sh @@ -25,12 +25,19 @@ cd "$(dirname "$0")" ########################################## # install Xargo if not exist -which xargo || cargo install xargo +if ! command -v xargo >/dev/null 2>&1; then + # xargo 0.3.26 does not compile on recent toolchains (TryLockError API change). + # Build it with an older known-good nightly. + # Since we're working on migrating to cargo -Z build-std, we can remove the xargo then. + XARGO_BOOTSTRAP_TOOLCHAIN=${XARGO_BOOTSTRAP_TOOLCHAIN:-nightly-2024-05-15} + rustup toolchain install "$XARGO_BOOTSTRAP_TOOLCHAIN" --profile minimal + cargo +"$XARGO_BOOTSTRAP_TOOLCHAIN" install xargo --locked +fi ########################################## -# initialize submodules: rust / libc -RUST_BRANCH=optee-xargo -LIBC_BRANCH=optee +# initialize submodules: rust / libc / patches +RUST_TAG=1.93.1 # commit 01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf +LIBC_TAG=0.2.182 # commit e879ee90b6cd8f79b352d4d4d1f8ca05f94f2f53 if [ -d rust/ ] then @@ -39,11 +46,20 @@ fi mkdir rust && cd rust -git clone --depth=1 -b $RUST_BRANCH https://github.com/DemesneGH/rust.git && \ +# Clone official Rust source at specific tag +git clone --depth=1 --branch $RUST_TAG https://github.com/rust-lang/rust.git && \ (cd rust && \ git submodule update --init library/stdarch && \ git submodule update --init library/backtrace) -git clone --depth=1 -b $LIBC_BRANCH https://github.com/DemesneGH/libc.git +# Clone official libc at specific tag +git clone --depth=1 --branch $LIBC_TAG https://github.com/rust-lang/libc.git + +# Clone patches repository +git clone --depth=1 https://github.com/apache/teaclave-crates.git patches + +# Apply patches +(cd rust && git apply ../patches/rust-1.93.1-01f6ddf/optee-0001-std-adaptation.patch) +(cd libc && git apply ../patches/libc-0.2.182-e879ee9/optee-0001-libc-adaptation.patch) -echo "Rust submodules initialized" +echo "Rust and libc sources initialized and patched"