Skip to content

Commit

Permalink
std: fix linking error and add ci for 32bit TA
Browse files Browse the repository at this point in the history
  • Loading branch information
DemesneGH committed Jul 10, 2024
1 parent 54de282 commit c04fa52
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 15 deletions.
39 changes: 38 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/acipher-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/aes-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/authentication-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/big_int-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/diffie_hellman-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/digest-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/error_handling-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/hotp-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/random-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/secure_storage-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/signature_verification-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/supp_plugin-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion examples/time-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down

0 comments on commit c04fa52

Please sign in to comment.