From db1752aa4285e0da754aefa7269a80f33bacc96b Mon Sep 17 00:00:00 2001 From: Yuan Zhuang Date: Fri, 13 Mar 2026 09:44:27 +0000 Subject: [PATCH] std: migrate from xargo to cargo -Z build-std --- environment | 14 +++++------ examples/Makefile | 6 ++--- examples/acipher-rs/Makefile | 6 ++--- examples/acipher-rs/ta/Makefile | 11 +++++---- examples/acipher-rs/ta/Xargo.toml | 24 ------------------- examples/aes-rs/Makefile | 6 ++--- examples/aes-rs/ta/Makefile | 11 +++++---- examples/aes-rs/ta/Xargo.toml | 24 ------------------- examples/authentication-rs/Makefile | 6 ++--- examples/authentication-rs/ta/Makefile | 11 +++++---- examples/authentication-rs/ta/Xargo.toml | 24 ------------------- examples/big_int-rs/Makefile | 6 ++--- examples/big_int-rs/ta/Makefile | 11 +++++---- examples/big_int-rs/ta/Xargo.toml | 24 ------------------- .../build_with_optee_utee_sys-rs/Makefile | 6 ++--- .../build_with_optee_utee_sys-rs/ta/Makefile | 9 +++++-- examples/client_pool-rs/Makefile | 6 ++--- examples/client_pool-rs/ta/Makefile | 11 +++++---- examples/client_pool-rs/ta/Xargo.toml | 24 ------------------- examples/diffie_hellman-rs/Makefile | 6 ++--- examples/diffie_hellman-rs/ta/Makefile | 11 +++++---- examples/diffie_hellman-rs/ta/Xargo.toml | 24 ------------------- examples/digest-rs/Makefile | 6 ++--- examples/digest-rs/ta/Makefile | 11 +++++---- examples/digest-rs/ta/Xargo.toml | 24 ------------------- examples/error_handling-rs/Makefile | 6 ++--- examples/error_handling-rs/ta/Makefile | 11 +++++---- examples/error_handling-rs/ta/Xargo.toml | 24 ------------------- examples/hello_world-rs/Makefile | 3 --- examples/hello_world-rs/ta/Makefile | 11 +++++---- examples/hello_world-rs/ta/Xargo.toml | 24 ------------------- examples/hotp-rs/Makefile | 6 ++--- examples/hotp-rs/ta/Makefile | 11 +++++---- examples/hotp-rs/ta/Xargo.toml | 24 ------------------- examples/inter_ta-rs/Makefile | 6 ++--- examples/inter_ta-rs/ta/Makefile | 11 +++++---- examples/inter_ta-rs/ta/Xargo.toml | 24 ------------------- .../message_passing_interface-rs/Makefile | 6 ++--- .../message_passing_interface-rs/ta/Makefile | 11 +++++---- .../ta/Xargo.toml | 24 ------------------- examples/mnist-rs/Makefile | 10 ++++---- examples/property-rs/Makefile | 6 ++--- examples/property-rs/ta/Makefile | 11 +++++---- examples/property-rs/ta/Xargo.toml | 24 ------------------- examples/random-rs/Makefile | 6 ++--- examples/random-rs/ta/Makefile | 11 +++++---- examples/random-rs/ta/Xargo.toml | 24 ------------------- examples/secure_db_abstraction-rs/Makefile | 6 ++--- examples/secure_db_abstraction-rs/ta/Makefile | 12 ++++++++-- .../secure_db_abstraction-rs/ta/Xargo.toml | 24 ------------------- examples/secure_storage-rs/Makefile | 6 ++--- examples/secure_storage-rs/ta/Makefile | 11 +++++---- examples/secure_storage-rs/ta/Xargo.toml | 24 ------------------- examples/serde-rs/Makefile | 6 ++--- examples/serde-rs/ta/Makefile | 12 +++++----- examples/serde-rs/ta/Xargo.toml | 24 ------------------- examples/signature_verification-rs/Makefile | 6 ++--- .../signature_verification-rs/ta/Makefile | 11 +++++---- .../signature_verification-rs/ta/Xargo.toml | 24 ------------------- examples/supp_plugin-rs/Makefile | 6 ++--- examples/supp_plugin-rs/ta/Makefile | 11 +++++---- examples/supp_plugin-rs/ta/Xargo.toml | 24 ------------------- examples/tcp_client-rs/Makefile | 6 ++--- examples/tcp_client-rs/ta/Makefile | 12 ++++++---- examples/tcp_client-rs/ta/Xargo.toml | 24 ------------------- examples/time-rs/Makefile | 6 ++--- examples/time-rs/ta/Makefile | 11 +++++---- examples/time-rs/ta/Xargo.toml | 24 ------------------- examples/tls_client-rs/Makefile | 6 ++--- examples/tls_client-rs/ta/Makefile | 12 ++++++++-- examples/tls_client-rs/ta/Xargo.toml | 24 ------------------- examples/tls_server-rs/Makefile | 6 ++--- examples/tls_server-rs/ta/Makefile | 12 ++++++++-- examples/tls_server-rs/ta/Xargo.toml | 24 ------------------- examples/udp_socket-rs/Makefile | 6 ++--- examples/udp_socket-rs/ta/Makefile | 12 ++++++---- examples/udp_socket-rs/ta/Xargo.toml | 24 ------------------- optee-utee/Xargo.toml | 24 ------------------- optee-utee/optee-utee-sys/src/lib.rs | 2 +- projects/web3/eth_wallet/Makefile | 6 ++--- projects/web3/eth_wallet/ta/Makefile | 10 ++++++-- projects/web3/eth_wallet/ta/Xargo.toml | 24 ------------------- setup_std_dependencies.sh | 11 --------- 83 files changed, 263 insertions(+), 846 deletions(-) delete mode 100644 examples/acipher-rs/ta/Xargo.toml delete mode 100644 examples/aes-rs/ta/Xargo.toml delete mode 100644 examples/authentication-rs/ta/Xargo.toml delete mode 100644 examples/big_int-rs/ta/Xargo.toml delete mode 100644 examples/client_pool-rs/ta/Xargo.toml delete mode 100644 examples/diffie_hellman-rs/ta/Xargo.toml delete mode 100644 examples/digest-rs/ta/Xargo.toml delete mode 100644 examples/error_handling-rs/ta/Xargo.toml delete mode 100644 examples/hello_world-rs/ta/Xargo.toml delete mode 100644 examples/hotp-rs/ta/Xargo.toml delete mode 100644 examples/inter_ta-rs/ta/Xargo.toml delete mode 100644 examples/message_passing_interface-rs/ta/Xargo.toml delete mode 100644 examples/property-rs/ta/Xargo.toml delete mode 100644 examples/random-rs/ta/Xargo.toml delete mode 100644 examples/secure_db_abstraction-rs/ta/Xargo.toml delete mode 100644 examples/secure_storage-rs/ta/Xargo.toml delete mode 100644 examples/serde-rs/ta/Xargo.toml delete mode 100644 examples/signature_verification-rs/ta/Xargo.toml delete mode 100644 examples/supp_plugin-rs/ta/Xargo.toml delete mode 100644 examples/tcp_client-rs/ta/Xargo.toml delete mode 100644 examples/time-rs/ta/Xargo.toml delete mode 100644 examples/tls_client-rs/ta/Xargo.toml delete mode 100644 examples/tls_server-rs/ta/Xargo.toml delete mode 100644 examples/udp_socket-rs/ta/Xargo.toml delete mode 100644 optee-utee/Xargo.toml delete mode 100644 projects/web3/eth_wallet/ta/Xargo.toml diff --git a/environment b/environment index 0d714277..66fe72d3 100644 --- a/environment +++ b/environment @@ -44,15 +44,14 @@ then then export TARGET_TA="arm-unknown-optee" 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" + export CARGO_FLAGS="-Z build-std=std,panic_abort" + export __CARGO_TESTS_ONLY_SRC_ROOT="$(pwd)/rust/rust/library" else export TARGET_TA="arm-unknown-linux-gnueabihf" echo "set TARGET_TA=$TARGET_TA (no-std)" - export BUILDER=cargo export FEATURES="" + export CARGO_FLAGS="" fi export CROSS_COMPILE_TA="$CROSS_COMPILE32" echo "set CROSS_COMPILE_TA=$CROSS_COMPILE_TA" @@ -63,15 +62,14 @@ else then export TARGET_TA="aarch64-unknown-optee" 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" + export CARGO_FLAGS="-Z build-std=std,panic_abort" + export __CARGO_TESTS_ONLY_SRC_ROOT="$(pwd)/rust/rust/library" else export TARGET_TA="aarch64-unknown-linux-gnu" echo "set TARGET_TA=$TARGET_TA (no-std)" - export BUILDER=cargo export FEATURES="" + export CARGO_FLAGS="" fi export CROSS_COMPILE_TA="$CROSS_COMPILE64" echo "set CROSS_COMPILE_TA=$CROSS_COMPILE_TA" diff --git a/examples/Makefile b/examples/Makefile index db510077..c097c314 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -22,8 +22,8 @@ CROSS_COMPILE_HOST ?= $(CROSS_COMPILE) CROSS_COMPILE_TA ?= $(CROSS_COMPILE) TARGET_HOST ?= $(TARGET) TARGET_TA ?= $(TARGET) -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= # Define example categories based on std/no-std support # STD-only examples (require STD=y to build) @@ -89,8 +89,8 @@ $(STD_ONLY_EXAMPLES) $(NO_STD_ONLY_EXAMPLES) $(COMMON_EXAMPLES): CROSS_COMPILE_TA=$(CROSS_COMPILE_TA) \ TA_DEV_KIT_DIR=$(TA_DEV_KIT_DIR) \ OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" # Clean targets clean: $(STD_ONLY_EXAMPLES_CLEAN) $(NO_STD_ONLY_EXAMPLES_CLEAN) $(COMMON_EXAMPLES_CLEAN) diff --git a/examples/acipher-rs/Makefile b/examples/acipher-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/acipher-rs/Makefile +++ b/examples/acipher-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/acipher-rs/ta/Makefile b/examples/acipher-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/acipher-rs/ta/Makefile +++ b/examples/acipher-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/acipher-rs/ta/Xargo.toml b/examples/acipher-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/acipher-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/aes-rs/Makefile b/examples/aes-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/aes-rs/Makefile +++ b/examples/aes-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/aes-rs/ta/Makefile b/examples/aes-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/aes-rs/ta/Makefile +++ b/examples/aes-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/aes-rs/ta/Xargo.toml b/examples/aes-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/aes-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/authentication-rs/Makefile b/examples/authentication-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/authentication-rs/Makefile +++ b/examples/authentication-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/authentication-rs/ta/Makefile b/examples/authentication-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/authentication-rs/ta/Makefile +++ b/examples/authentication-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/authentication-rs/ta/Xargo.toml b/examples/authentication-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/authentication-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/big_int-rs/Makefile b/examples/big_int-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/big_int-rs/Makefile +++ b/examples/big_int-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/big_int-rs/ta/Makefile b/examples/big_int-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/big_int-rs/ta/Makefile +++ b/examples/big_int-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/big_int-rs/ta/Xargo.toml b/examples/big_int-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/big_int-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/build_with_optee_utee_sys-rs/Makefile b/examples/build_with_optee_utee_sys-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/build_with_optee_utee_sys-rs/Makefile +++ b/examples/build_with_optee_utee_sys-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/build_with_optee_utee_sys-rs/ta/Makefile b/examples/build_with_optee_utee_sys-rs/ta/Makefile index bc8d04ea..0e28a9cd 100644 --- a/examples/build_with_optee_utee_sys-rs/ta/Makefile +++ b/examples/build_with_optee_utee_sys-rs/ta/Makefile @@ -23,7 +23,12 @@ OBJCOPY := $(CROSS_COMPILE)objcopy # Configure the linker to use GCC, which works on both cross-compilation and ARM machines 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py @@ -33,10 +38,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy --target $(TARGET) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --target $(TARGET) $(FEATURES) -- -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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/client_pool-rs/Makefile b/examples/client_pool-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/client_pool-rs/Makefile +++ b/examples/client_pool-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/client_pool-rs/ta/Makefile b/examples/client_pool-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/client_pool-rs/ta/Makefile +++ b/examples/client_pool-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/client_pool-rs/ta/Xargo.toml b/examples/client_pool-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/client_pool-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/diffie_hellman-rs/Makefile b/examples/diffie_hellman-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/diffie_hellman-rs/Makefile +++ b/examples/diffie_hellman-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/diffie_hellman-rs/ta/Makefile b/examples/diffie_hellman-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/diffie_hellman-rs/ta/Makefile +++ b/examples/diffie_hellman-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/diffie_hellman-rs/ta/Xargo.toml b/examples/diffie_hellman-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/diffie_hellman-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/digest-rs/Makefile b/examples/digest-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/digest-rs/Makefile +++ b/examples/digest-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/digest-rs/ta/Makefile b/examples/digest-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/digest-rs/ta/Makefile +++ b/examples/digest-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/digest-rs/ta/Xargo.toml b/examples/digest-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/digest-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/error_handling-rs/Makefile b/examples/error_handling-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/error_handling-rs/Makefile +++ b/examples/error_handling-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/error_handling-rs/ta/Makefile b/examples/error_handling-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/error_handling-rs/ta/Makefile +++ b/examples/error_handling-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/error_handling-rs/ta/Xargo.toml b/examples/error_handling-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/error_handling-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/hello_world-rs/Makefile b/examples/hello_world-rs/Makefile index 8cfb9051..282cae93 100644 --- a/examples/hello_world-rs/Makefile +++ b/examples/hello_world-rs/Makefile @@ -21,7 +21,6 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo .PHONY: all host ta clean emulate @@ -35,7 +34,6 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ FEATURES="$(FEATURES)" emulate: @@ -43,7 +41,6 @@ emulate: CROSS_COMPILE=$(CROSS_COMPILE_HOST) $(q)make -C ta emulate TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ FEATURES="$(FEATURES)" clean: diff --git a/examples/hello_world-rs/ta/Makefile b/examples/hello_world-rs/ta/Makefile index 7733b65b..c5ceacfb 100644 --- a/examples/hello_world-rs/ta/Makefile +++ b/examples/hello_world-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/hello_world-rs/ta/Xargo.toml b/examples/hello_world-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/hello_world-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/hotp-rs/Makefile b/examples/hotp-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/hotp-rs/Makefile +++ b/examples/hotp-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/hotp-rs/ta/Makefile b/examples/hotp-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/hotp-rs/ta/Makefile +++ b/examples/hotp-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/hotp-rs/ta/Xargo.toml b/examples/hotp-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/hotp-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/inter_ta-rs/Makefile b/examples/inter_ta-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/inter_ta-rs/Makefile +++ b/examples/inter_ta-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/inter_ta-rs/ta/Makefile b/examples/inter_ta-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/inter_ta-rs/ta/Makefile +++ b/examples/inter_ta-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/inter_ta-rs/ta/Xargo.toml b/examples/inter_ta-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/inter_ta-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/message_passing_interface-rs/Makefile b/examples/message_passing_interface-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/message_passing_interface-rs/Makefile +++ b/examples/message_passing_interface-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/message_passing_interface-rs/ta/Makefile b/examples/message_passing_interface-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/message_passing_interface-rs/ta/Makefile +++ b/examples/message_passing_interface-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/message_passing_interface-rs/ta/Xargo.toml b/examples/message_passing_interface-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/message_passing_interface-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/mnist-rs/Makefile b/examples/mnist-rs/Makefile index fc8410cf..4d4d2dd7 100644 --- a/examples/mnist-rs/Makefile +++ b/examples/mnist-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -38,12 +38,12 @@ host: toolchain ta: toolchain $(q)make -C ta/train TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" $(q)make -C ta/inference TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/property-rs/Makefile b/examples/property-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/property-rs/Makefile +++ b/examples/property-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/property-rs/ta/Makefile b/examples/property-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/property-rs/ta/Makefile +++ b/examples/property-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/property-rs/ta/Xargo.toml b/examples/property-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/property-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/random-rs/Makefile b/examples/random-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/random-rs/Makefile +++ b/examples/random-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/random-rs/ta/Makefile b/examples/random-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/random-rs/ta/Makefile +++ b/examples/random-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/random-rs/ta/Xargo.toml b/examples/random-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/random-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/secure_db_abstraction-rs/Makefile b/examples/secure_db_abstraction-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/secure_db_abstraction-rs/Makefile +++ b/examples/secure_db_abstraction-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/secure_db_abstraction-rs/ta/Makefile b/examples/secure_db_abstraction-rs/ta/Makefile index 086bba13..2f9da99e 100644 --- a/examples/secure_db_abstraction-rs/ta/Makefile +++ b/examples/secure_db_abstraction-rs/ta/Makefile @@ -25,6 +25,14 @@ OBJCOPY := $(CROSS_COMPILE)objcopy # Configure the linker to use GCC, which works on both cross-compilation and ARM machines 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= + TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release @@ -33,10 +41,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @xargo clippy --target $(TARGET) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic ta: clippy - @xargo build --target $(TARGET) --release --config $(LINKER_CFG) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/secure_db_abstraction-rs/ta/Xargo.toml b/examples/secure_db_abstraction-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/secure_db_abstraction-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/secure_storage-rs/Makefile b/examples/secure_storage-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/secure_storage-rs/Makefile +++ b/examples/secure_storage-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/secure_storage-rs/ta/Makefile b/examples/secure_storage-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/secure_storage-rs/ta/Makefile +++ b/examples/secure_storage-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/secure_storage-rs/ta/Xargo.toml b/examples/secure_storage-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/secure_storage-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/serde-rs/Makefile b/examples/serde-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/serde-rs/Makefile +++ b/examples/serde-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/serde-rs/ta/Makefile b/examples/serde-rs/ta/Makefile index c42ea0a4..e76c5eae 100644 --- a/examples/serde-rs/ta/Makefile +++ b/examples/serde-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta @@ -52,4 +53,3 @@ sign: strip clean: @cargo clean - diff --git a/examples/serde-rs/ta/Xargo.toml b/examples/serde-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/serde-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/signature_verification-rs/Makefile b/examples/signature_verification-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/signature_verification-rs/Makefile +++ b/examples/signature_verification-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/signature_verification-rs/ta/Makefile b/examples/signature_verification-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/signature_verification-rs/ta/Makefile +++ b/examples/signature_verification-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/signature_verification-rs/ta/Xargo.toml b/examples/signature_verification-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/signature_verification-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/supp_plugin-rs/Makefile b/examples/supp_plugin-rs/Makefile index 660bcba3..58d41978 100644 --- a/examples/supp_plugin-rs/Makefile +++ b/examples/supp_plugin-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta plugin all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" plugin: $(q)make -C plugin TARGET=$(TARGET_HOST) \ diff --git a/examples/supp_plugin-rs/ta/Makefile b/examples/supp_plugin-rs/ta/Makefile index 515492a1..b16788a0 100644 --- a/examples/supp_plugin-rs/ta/Makefile +++ b/examples/supp_plugin-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/supp_plugin-rs/ta/Xargo.toml b/examples/supp_plugin-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/supp_plugin-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/tcp_client-rs/Makefile b/examples/tcp_client-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/tcp_client-rs/Makefile +++ b/examples/tcp_client-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/tcp_client-rs/ta/Makefile b/examples/tcp_client-rs/ta/Makefile index c5e87862..e76c5eae 100644 --- a/examples/tcp_client-rs/ta/Makefile +++ b/examples/tcp_client-rs/ta/Makefile @@ -26,22 +26,24 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --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/Xargo.toml b/examples/tcp_client-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/tcp_client-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/time-rs/Makefile b/examples/time-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/time-rs/Makefile +++ b/examples/time-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/time-rs/ta/Makefile b/examples/time-rs/ta/Makefile index 4b03489b..e76c5eae 100644 --- a/examples/time-rs/ta/Makefile +++ b/examples/time-rs/ta/Makefile @@ -26,22 +26,23 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/time-rs/ta/Xargo.toml b/examples/time-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/time-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/tls_client-rs/Makefile b/examples/tls_client-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/tls_client-rs/Makefile +++ b/examples/tls_client-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/tls_client-rs/ta/Makefile b/examples/tls_client-rs/ta/Makefile index 086bba13..2f9da99e 100644 --- a/examples/tls_client-rs/ta/Makefile +++ b/examples/tls_client-rs/ta/Makefile @@ -25,6 +25,14 @@ OBJCOPY := $(CROSS_COMPILE)objcopy # Configure the linker to use GCC, which works on both cross-compilation and ARM machines 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= + TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release @@ -33,10 +41,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @xargo clippy --target $(TARGET) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic ta: clippy - @xargo build --target $(TARGET) --release --config $(LINKER_CFG) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --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/Xargo.toml b/examples/tls_client-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/tls_client-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/tls_server-rs/Makefile b/examples/tls_server-rs/Makefile index 3304f50b..e3fa4374 100644 --- a/examples/tls_server-rs/Makefile +++ b/examples/tls_server-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/tls_server-rs/ta/Makefile b/examples/tls_server-rs/ta/Makefile index 086bba13..2f9da99e 100644 --- a/examples/tls_server-rs/ta/Makefile +++ b/examples/tls_server-rs/ta/Makefile @@ -25,6 +25,14 @@ OBJCOPY := $(CROSS_COMPILE)objcopy # Configure the linker to use GCC, which works on both cross-compilation and ARM machines 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= + TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release @@ -33,10 +41,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @xargo clippy --target $(TARGET) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic ta: clippy - @xargo build --target $(TARGET) --release --config $(LINKER_CFG) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/tls_server-rs/ta/Xargo.toml b/examples/tls_server-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/tls_server-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/examples/udp_socket-rs/Makefile b/examples/udp_socket-rs/Makefile index 6b56d78a..e1397553 100644 --- a/examples/udp_socket-rs/Makefile +++ b/examples/udp_socket-rs/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/examples/udp_socket-rs/ta/Makefile b/examples/udp_socket-rs/ta/Makefile index c5e87862..e76c5eae 100644 --- a/examples/udp_socket-rs/ta/Makefile +++ b/examples/udp_socket-rs/ta/Makefile @@ -26,22 +26,24 @@ 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= +# FEATURES is set by sourcing environment (e.g. --features std for std builds) +FEATURES ?= TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET)/release -BUILDER ?= cargo -FEATURES ?= - all: clippy ta strip sign clippy: @cargo fmt - @RUSTFLAGS="$(RUSTFLAGS)" $(BUILDER) clippy --target $(TARGET) $(FEATURES) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --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) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release $(FEATURES) --config $(LINKER_CFG) + strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/examples/udp_socket-rs/ta/Xargo.toml b/examples/udp_socket-rs/ta/Xargo.toml deleted file mode 100644 index 1b1a113e..00000000 --- a/examples/udp_socket-rs/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/optee-utee/Xargo.toml b/optee-utee/Xargo.toml deleted file mode 100644 index 0ad721d3..00000000 --- a/optee-utee/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../rust/libc" } -rustc-std-workspace-core = { path = "../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/optee-utee/optee-utee-sys/src/lib.rs b/optee-utee/optee-utee-sys/src/lib.rs index 89b99568..4fb0bd23 100644 --- a/optee-utee/optee-utee-sys/src/lib.rs +++ b/optee-utee/optee-utee-sys/src/lib.rs @@ -45,7 +45,7 @@ mod utee_syscalls; mod utee_types; // Currently, the libc crate does not support optee_os, and patching it in -// Xargo.toml within the TA project does not affect optee-utee-sys. Therefore, +// build-std within the TA project does not affect optee-utee-sys. Therefore, // we need to define the type directly in the crate to ensure compatibility. #[cfg(feature = "std")] mod libc_compat { diff --git a/projects/web3/eth_wallet/Makefile b/projects/web3/eth_wallet/Makefile index 3304f50b..e3fa4374 100644 --- a/projects/web3/eth_wallet/Makefile +++ b/projects/web3/eth_wallet/Makefile @@ -21,8 +21,8 @@ CROSS_COMPILE_HOST ?= aarch64-linux-gnu- CROSS_COMPILE_TA ?= aarch64-linux-gnu- TARGET_HOST ?= aarch64-unknown-linux-gnu TARGET_TA ?= aarch64-unknown-linux-gnu -BUILDER ?= cargo FEATURES ?= +CARGO_FLAGS ?= .PHONY: host ta all clean @@ -35,8 +35,8 @@ host: ta: $(q)make -C ta TARGET=$(TARGET_TA) \ CROSS_COMPILE=$(CROSS_COMPILE_TA) \ - BUILDER=$(BUILDER) \ - FEATURES="$(FEATURES)" + FEATURES="$(FEATURES)" \ + CARGO_FLAGS="$(CARGO_FLAGS)" clean: $(q)make -C host clean diff --git a/projects/web3/eth_wallet/ta/Makefile b/projects/web3/eth_wallet/ta/Makefile index 14953678..c6bbc194 100644 --- a/projects/web3/eth_wallet/ta/Makefile +++ b/projects/web3/eth_wallet/ta/Makefile @@ -25,6 +25,12 @@ OBJCOPY := $(CROSS_COMPILE_TA)objcopy # Configure the linker to use GCC, which works on both cross-compilation and ARM machines 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 +# CARGO_FLAGS is set by sourcing environment (e.g. -Z build-std=std,panic_abort for std builds) +CARGO_FLAGS ?= + TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py OUT_DIR := $(CURDIR)/target/$(TARGET_TA)/release @@ -33,10 +39,10 @@ all: clippy ta strip sign clippy: @cargo fmt - @xargo clippy --target $(TARGET) -- -D warnings + @RUSTFLAGS="$(RUSTFLAGS)" cargo clippy $(CARGO_FLAGS) --target $(TARGET) -- -D warnings ta: clippy - @xargo build --target $(TARGET) --release --config $(LINKER_CFG) + @RUSTFLAGS="$(RUSTFLAGS)" cargo build $(CARGO_FLAGS) --target $(TARGET) --release --config $(LINKER_CFG) strip: ta @$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta diff --git a/projects/web3/eth_wallet/ta/Xargo.toml b/projects/web3/eth_wallet/ta/Xargo.toml deleted file mode 100644 index 251ee70e..00000000 --- a/projects/web3/eth_wallet/ta/Xargo.toml +++ /dev/null @@ -1,24 +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. - -[dependencies.std] -path = "../../../../rust/rust/library/std" - -[patch.crates-io] -libc = { path = "../../../../rust/libc" } -rustc-std-workspace-core = { path = "../../../../rust/rust/library/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "../../../../rust/rust/library/rustc-std-workspace-alloc" } diff --git a/setup_std_dependencies.sh b/setup_std_dependencies.sh index 5e390ec0..73068d30 100755 --- a/setup_std_dependencies.sh +++ b/setup_std_dependencies.sh @@ -23,17 +23,6 @@ set -xe # move to project root cd "$(dirname "$0")" -########################################## -# install Xargo if not exist -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 / patches RUST_TAG=1.93.1 # commit 01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf