This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit 9e3906e9d82f0471e96bf892afe0df37dd90a86e
Author: Yuan Zhuang <[email protected]>
AuthorDate: Wed Jul 10 03:33:05 2024 +0000

    std: fix linking error and add ci for 32bit TA
---
 .github/workflows/ci.yml                       | 39 +++++++++++++++++++++++++-
 examples/acipher-rs/ta/build.rs                |  2 +-
 examples/aes-rs/ta/build.rs                    |  2 +-
 examples/authentication-rs/ta/build.rs         |  2 +-
 examples/big_int-rs/ta/build.rs                |  2 +-
 examples/diffie_hellman-rs/ta/build.rs         |  2 +-
 examples/digest-rs/ta/build.rs                 |  2 +-
 examples/error_handling-rs/ta/build.rs         |  2 +-
 examples/hello_world-rs/ta/build.rs            |  2 +-
 examples/hotp-rs/ta/build.rs                   |  2 +-
 examples/random-rs/ta/build.rs                 |  2 +-
 examples/secure_storage-rs/ta/build.rs         |  2 +-
 examples/signature_verification-rs/ta/build.rs |  2 +-
 examples/supp_plugin-rs/ta/build.rs            |  2 +-
 examples/time-rs/ta/build.rs                   |  2 +-
 15 files changed, 52 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8d486b8..6f42b77 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -97,7 +97,7 @@ jobs:
           apt update && apt install libslirp-dev -y
           source environment
           (cd ci && ./ci.sh)
-  build-and-test-examples-for-std-TAs:
+  build-and-test-examples-for-64bit-std-TAs:
     runs-on: ubuntu-latest
     container: teaclave/teaclave-trustzone-sdk-build:0.3.0
     steps:
@@ -132,6 +132,43 @@ jobs:
           export STD=y
           source environment
           (cd ci && ./ci.sh)
+  build-and-test-examples-for-32bit-std-TAs:
+    runs-on: ubuntu-latest
+    container: teaclave/teaclave-trustzone-sdk-build:0.3.0
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v2
+      - name: Setting up $HOME
+        run: |
+          cp /root/.bashrc $HOME/.bashrc &&
+          ln -sf /root/.rustup ~/.rustup &&
+          ln -sf /root/.cargo ~/.cargo
+      - name: Building Arm 64-bit both host and TA (with STD enabled)
+        run: |
+          # Setup Rust and toolchains
+          ./setup.sh
+
+          # Setup std dependencies
+          ./setup_std_dependencies.sh
+
+          # Build optee_os and optee_client for qemu_v8
+          ./build_optee_libraries.sh $HOME
+
+          # Setup environment
+          export OPTEE_DIR=$HOME
+          export ARCH_TA=arm
+          export STD=y
+          source environment
+
+          # Build OP-TEE Rust examples for Arm 64-bit both host and TA
+          make -j`nproc`
+      - name: Run tests for Arm 64-bit both host and TA
+        run: |
+          apt update && apt install libslirp-dev -y
+          export ARCH_TA=arm
+          export STD=y
+          source environment
+          (cd ci && ./ci.sh)
   OPTEE-repo-build-and-run-examples-64bit-TAs:
     runs-on: ubuntu-latest
     container: teaclave/teaclave-trustzone-sdk-build:0.3.0
diff --git a/examples/acipher-rs/ta/build.rs b/examples/acipher-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/acipher-rs/ta/build.rs
+++ b/examples/acipher-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/aes-rs/ta/build.rs b/examples/aes-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/aes-rs/ta/build.rs
+++ b/examples/aes-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/authentication-rs/ta/build.rs 
b/examples/authentication-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/authentication-rs/ta/build.rs
+++ b/examples/authentication-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/big_int-rs/ta/build.rs b/examples/big_int-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/big_int-rs/ta/build.rs
+++ b/examples/big_int-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/diffie_hellman-rs/ta/build.rs 
b/examples/diffie_hellman-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/diffie_hellman-rs/ta/build.rs
+++ b/examples/diffie_hellman-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/digest-rs/ta/build.rs b/examples/digest-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/digest-rs/ta/build.rs
+++ b/examples/digest-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/error_handling-rs/ta/build.rs 
b/examples/error_handling-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/error_handling-rs/ta/build.rs
+++ b/examples/error_handling-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/hello_world-rs/ta/build.rs 
b/examples/hello_world-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/hello_world-rs/ta/build.rs
+++ b/examples/hello_world-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/hotp-rs/ta/build.rs b/examples/hotp-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/hotp-rs/ta/build.rs
+++ b/examples/hotp-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/random-rs/ta/build.rs b/examples/random-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/random-rs/ta/build.rs
+++ b/examples/random-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/secure_storage-rs/ta/build.rs 
b/examples/secure_storage-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/secure_storage-rs/ta/build.rs
+++ b/examples/secure_storage-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/signature_verification-rs/ta/build.rs 
b/examples/signature_verification-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/signature_verification-rs/ta/build.rs
+++ b/examples/signature_verification-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/supp_plugin-rs/ta/build.rs 
b/examples/supp_plugin-rs/ta/build.rs
index 9890b99..7d43891 100644
--- a/examples/supp_plugin-rs/ta/build.rs
+++ b/examples/supp_plugin-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },
diff --git a/examples/time-rs/ta/build.rs b/examples/time-rs/ta/build.rs
index 0b70d4a..fa0d195 100644
--- a/examples/time-rs/ta/build.rs
+++ b/examples/time-rs/ta/build.rs
@@ -45,7 +45,7 @@ fn main() -> std::io::Result<()> {
 
     let mut aarch64_flag = true;
     match env::var("TARGET_TA") {
-        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" => {
+        Ok(ref v) if v == "arm-unknown-linux-gnueabihf" || v == 
"arm-unknown-optee" => {
             println!("cargo:rustc-link-arg=--no-warn-mismatch");
             aarch64_flag = false;
         },


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to