Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions environment
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions examples/acipher-rs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions examples/acipher-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 0 additions & 24 deletions examples/acipher-rs/ta/Xargo.toml

This file was deleted.

6 changes: 3 additions & 3 deletions examples/aes-rs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions examples/aes-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 0 additions & 24 deletions examples/aes-rs/ta/Xargo.toml

This file was deleted.

6 changes: 3 additions & 3 deletions examples/authentication-rs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions examples/authentication-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 0 additions & 24 deletions examples/authentication-rs/ta/Xargo.toml

This file was deleted.

6 changes: 3 additions & 3 deletions examples/big_int-rs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions examples/big_int-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 0 additions & 24 deletions examples/big_int-rs/ta/Xargo.toml

This file was deleted.

6 changes: 3 additions & 3 deletions examples/build_with_optee_utee_sys-rs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Loading
Loading