This is an automated email from the ASF dual-hosted git repository. yuanz pushed a commit to branch release-v0.3.0 in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git
commit a7ce5812532bc67dbdedbf021412dfe4bb710b6d Author: Yuan Zhuang <[email protected]> AuthorDate: Wed Jun 26 08:38:03 2024 +0000 Add support for ARM32 --- .cargo/config.toml | 4 ++-- .licenserc.yaml | 2 +- Makefile | 2 +- arm-unknown-optee-trustzone.json => arm-unknown-optee.json | 6 +++--- environment | 7 ++++--- examples/acipher-rs/ta/Makefile | 2 +- examples/aes-rs/ta/Makefile | 2 +- examples/authentication-rs/ta/Makefile | 2 +- examples/big_int-rs/ta/Makefile | 2 +- examples/diffie_hellman-rs/ta/Makefile | 2 +- examples/digest-rs/ta/Makefile | 2 +- examples/hello_world-rs/ta/Makefile | 2 +- examples/hotp-rs/ta/Makefile | 2 +- examples/message_passing_interface-rs/ta/Makefile | 2 +- examples/random-rs/ta/Makefile | 2 +- examples/secure_storage-rs/ta/Makefile | 2 +- examples/serde-rs/ta/Makefile | 2 +- examples/signature_verification-rs/ta/Makefile | 2 +- examples/supp_plugin-rs/ta/Makefile | 2 +- examples/tcp_client-rs/ta/Makefile | 2 +- examples/time-rs/ta/Makefile | 2 +- examples/tls_client-rs/ta/Makefile | 2 +- examples/tls_server-rs/ta/Makefile | 2 +- examples/udp_socket-rs/ta/Makefile | 2 +- 24 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index f186993..88f442a 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -35,7 +35,7 @@ rustflags = [ linker = "aarch64-linux-gnu-gcc" ar = "aarch64-linux-gnu-gcc-ar" -[target.arm-unknown-optee-trustzone] +[target.arm-unknown-optee] linker = "arm-linux-gnueabihf-ld.bfd" ar = "arm-linux-gnueabihf-ar" rustflags = [ @@ -44,7 +44,7 @@ rustflags = [ "-C", "link-arg=-Tta.lds", "-C", "link-arg=--sort-section=alignment", "-C", "link-arg=-pie", - "-C", "link-dead-code", +# "-C", "link-dead-code", ] [target.arm-unknown-linux-gnueabihf] diff --git a/.licenserc.yaml b/.licenserc.yaml index 021768d..b968cf5 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -29,7 +29,7 @@ header: - '**/Cargo.lock' - '**/*.lds' - 'aarch64-unknown-optee.json' - - 'arm-unknown-optee-trustzone.json' + - 'arm-unknown-optee.json' - 'KEYS' - 'DISCLAIMER-WIP' - '.gitmodules' diff --git a/Makefile b/Makefile index 2786279..f614a9d 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ else VENDOR := qemu.mk ARCH_CROSS_COMPILE := $(OPTEE_PATH)/toolchains/aarch32/bin/arm-linux-gnueabihf- HOST_TARGET := arm-unknown-linux-gnueabihf - TA_TARGET := arm-unknown-optee-trustzone + TA_TARGET := arm-unknown-optee endif all: toolchains optee-os optee-client examples diff --git a/arm-unknown-optee-trustzone.json b/arm-unknown-optee.json similarity index 78% rename from arm-unknown-optee-trustzone.json rename to arm-unknown-optee.json index d271a94..79cf125 100644 --- a/arm-unknown-optee-trustzone.json +++ b/arm-unknown-optee.json @@ -1,8 +1,7 @@ { "arch": "arm", - "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", + "data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", "dynamic-linking": false, - "env": "trustzone", "executables": true, "features": "+strict-align,+v6,+vfp2", "has-rpath": true, @@ -17,5 +16,6 @@ "target-endian": "little", "target-pointer-width": "32", "vendor": "unknown", - "panic-strategy": "abort" + "panic-strategy": "abort", + "singlethread": true } diff --git a/environment b/environment index 5d141d2..5841b82 100644 --- a/environment +++ b/environment @@ -27,15 +27,16 @@ export OPTEE_CLIENT_DIR="$OPTEE_DIR/optee_client/out" export OPTEE_CLIENT_INCLUDE="$OPTEE_DIR/optee_client/out/export/usr/include" if [ "$ARCH" = "arm" ] then - export ARCH="arm" - export PATH=$PATH:$OPTEE_DIR/toolchains/aarch32/bin + # use our toolchain as the first choice + export PATH=$OPTEE_DIR/toolchains/aarch32/bin:$PATH export VENDOR="qemu.mk" export OPTEE_OS_INCLUDE="$OPTEE_DIR/optee_os/out/arm/export-ta_arm32/include" export CC=$OPTEE_DIR/toolchains/aarch32/bin/arm-linux-gnueabihf-gcc else # export ARCH="aarch64" # comment this because currently optee_os cannot be compiled in the aarch64 target unset ARCH - export PATH=$PATH:$OPTEE_DIR/toolchains/aarch64/bin + # use our toolchain as the first choice + export PATH=$OPTEE_DIR/toolchains/aarch64/bin:$PATH export VENDOR="qemu_v8.mk" export OPTEE_OS_INCLUDE="$OPTEE_DIR/optee_os/out/arm/export-ta_arm64/include" export CC=$OPTEE_DIR/toolchains/aarch64/bin/aarch64-linux-gnu-gcc diff --git a/examples/acipher-rs/ta/Makefile b/examples/acipher-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/acipher-rs/ta/Makefile +++ b/examples/acipher-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/aes-rs/ta/Makefile b/examples/aes-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/aes-rs/ta/Makefile +++ b/examples/aes-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/authentication-rs/ta/Makefile b/examples/authentication-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/authentication-rs/ta/Makefile +++ b/examples/authentication-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/big_int-rs/ta/Makefile b/examples/big_int-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/big_int-rs/ta/Makefile +++ b/examples/big_int-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/diffie_hellman-rs/ta/Makefile b/examples/diffie_hellman-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/diffie_hellman-rs/ta/Makefile +++ b/examples/diffie_hellman-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/digest-rs/ta/Makefile b/examples/digest-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/digest-rs/ta/Makefile +++ b/examples/digest-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/hello_world-rs/ta/Makefile b/examples/hello_world-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/hello_world-rs/ta/Makefile +++ b/examples/hello_world-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/hotp-rs/ta/Makefile b/examples/hotp-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/hotp-rs/ta/Makefile +++ b/examples/hotp-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/message_passing_interface-rs/ta/Makefile b/examples/message_passing_interface-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/message_passing_interface-rs/ta/Makefile +++ b/examples/message_passing_interface-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/random-rs/ta/Makefile b/examples/random-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/random-rs/ta/Makefile +++ b/examples/random-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/secure_storage-rs/ta/Makefile b/examples/secure_storage-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/secure_storage-rs/ta/Makefile +++ b/examples/secure_storage-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/serde-rs/ta/Makefile b/examples/serde-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/serde-rs/ta/Makefile +++ b/examples/serde-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/signature_verification-rs/ta/Makefile b/examples/signature_verification-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/signature_verification-rs/ta/Makefile +++ b/examples/signature_verification-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/supp_plugin-rs/ta/Makefile b/examples/supp_plugin-rs/ta/Makefile index 474b631..cf6a722 100644 --- a/examples/supp_plugin-rs/ta/Makefile +++ b/examples/supp_plugin-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/tcp_client-rs/ta/Makefile b/examples/tcp_client-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/tcp_client-rs/ta/Makefile +++ b/examples/tcp_client-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/time-rs/ta/Makefile b/examples/time-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/time-rs/ta/Makefile +++ b/examples/time-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/tls_client-rs/ta/Makefile b/examples/tls_client-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/tls_client-rs/ta/Makefile +++ b/examples/tls_client-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/tls_server-rs/ta/Makefile b/examples/tls_server-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/tls_server-rs/ta/Makefile +++ b/examples/tls_server-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py diff --git a/examples/udp_socket-rs/ta/Makefile b/examples/udp_socket-rs/ta/Makefile index 1c64ba3..bc22657 100644 --- a/examples/udp_socket-rs/ta/Makefile +++ b/examples/udp_socket-rs/ta/Makefile @@ -26,7 +26,7 @@ ifeq ($(ARCH), arm) SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm32/scripts/sign_encrypt.py OPTEE_BIN := $(OPTEE_DIR)/toolchains/aarch32/bin OBJCOPY := $(OPTEE_BIN)/arm-linux-gnueabihf-objcopy - TARGET := arm-unknown-optee-trustzone + TARGET := arm-unknown-optee else TA_SIGN_KEY ?= $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/keys/default_ta.pem SIGN := $(OPTEE_OS_DIR)/out/arm/export-ta_arm64/scripts/sign_encrypt.py --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
