| # Copyright 2024 The Fuchsia Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components/fuchsia_component.gni") |
| import("//build/components/fuchsia_package.gni") |
| import("//build/components/fuchsia_test.gni") |
| import("//build/components/fuchsia_test_package.gni") |
| import("//build/components/fuchsia_unittest_component.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| rustc_binary("runtime") { |
| edition = "2021" |
| output_name = "ta_runtime" |
| sources = [ |
| "src/main.rs", |
| "src/params.rs", |
| "src/ta_loader.rs", |
| "src/trusted_app.rs", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.tee:fuchsia.tee_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/tee/tee_internal_api:tee_internal_impl", |
| "//src/tee/tee_internal_api:tee_internal_stub_so", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| with_unit_tests = true |
| |
| # This file lists the dynamic symbols for the TEE_... entry points the runtime |
| # implements. These are exported for the TA to resolve when loaded. |
| inputs = [ "ta_runtime_exposed_symbols.sym" ] |
| link_args = [ "--dynamic-list=" + rebase_path(inputs[0], root_build_dir) ] |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_component("runtime-component") { |
| manifest = "meta/ta-runtime.cml" |
| component_name = "ta-runtime" |
| deps = [ ":runtime" ] |
| } |
| |
| fuchsia_unittest_component("runtime-test-component") { |
| deps = [ ":runtime_test" ] |
| component_name = "tee-runtime-test" |
| } |
| |
| shared_library("ta_loader_test_missing_entry_points") { |
| sources = [ "ta_loader_tests/ta_create_entry_point.cc" ] |
| } |
| |
| shared_library("ta_loader_test_complete") { |
| sources = [ "ta_loader_tests/ta_all_entry_points.cc" ] |
| } |
| |
| fuchsia_test_package("tee-runtime-tests-package") { |
| test_components = [ ":runtime-test-component" ] |
| package_name = "tee-runtime-tests" |
| deps = [ |
| ":ta_loader_test_complete", |
| ":ta_loader_test_missing_entry_points", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":tee-runtime-tests-package" ] |
| } |