| # Copyright 2024 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| import("//build/components.gni") | |
| import("//build/rust/rustc_test.gni") | |
| import("//build/testing/cc_test_executable.gni") | |
| # `elf_parse_test`, `static_pie_test_util`, and `elf_parse_tests` remain in GN | |
| # because `elf_parse_test` reads `/pkg/bin/static_pie_test_util` at runtime, and | |
| # `static_pie_test_util` depends on `//sdk/lib/c:static`, which is not yet | |
| # migrated to Bazel. | |
| rustc_test("elf_parse_test") { | |
| name = "elf_parse_lib_test" | |
| edition = "2024" | |
| deps = [ | |
| "//sdk/rust/zx", | |
| "//src/lib/fdio/rust:fdio", | |
| "//third_party/rust_crates:anyhow", | |
| "//third_party/rust_crates:assert_matches", | |
| "//third_party/rust_crates:bitflags", | |
| "//third_party/rust_crates:num-derive", | |
| "//third_party/rust_crates:num-traits", | |
| "//third_party/rust_crates:static_assertions", | |
| "//third_party/rust_crates:thiserror", | |
| "//third_party/rust_crates:zerocopy", | |
| ] | |
| sources = [ "src/lib.rs" ] | |
| inputs = [ | |
| "test-utils/elf_aarch64_file-header.bin", | |
| "test-utils/elf_x86-64_file-header.bin", | |
| "test-utils/elf_riscv64_file-header.bin", | |
| ] | |
| } | |
| cc_test_executable("static_pie_test_util") { | |
| visibility = [ | |
| ":*", | |
| "//src/lib/process_builder:*", | |
| ] | |
| testonly = true | |
| output_name = "static_pie_test_util" | |
| sources = [ "test-utils/static_pie_test_util.cc" ] | |
| configs -= [ "//build/config/fuchsia:fdio_config" ] | |
| configs += [ "//build/config:standalone" ] | |
| ldflags = [ "-Wl,-z,stack-size=0x40000" ] | |
| deps = [ "//sdk/lib/c:static" ] | |
| # The static libc.a doesn't handle the setup needed for things like ASan. | |
| exclude_toolchain_tags = [ "uses-shadow" ] | |
| } | |
| fuchsia_unittest_package("elf_parse_tests") { | |
| deps = [ ":elf_parse_test" ] | |
| data_deps = [ ":static_pie_test_util" ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":elf_parse_tests" ] | |
| } | |
| ## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ## | |
| # | |
| # ________ _________ ________ ________ | |
| # |\ ____\|\___ ___\\ __ \|\ __ \ | |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ | |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ | |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| | |
| # ____\_\ \ \ \__\ \ \_______\ \__\ | |
| # |\_________\ \|__| \|_______|\|__| | |
| # \|_________| | |
| # | |
| # | |
| # AUTO-GENERATED - DO NOT EDIT | |
| # | |
| # The targets below are auto-generated based on the targets defined in the | |
| # BUILD.bazel file from the same directory. If you made changes to targets in | |
| # Bazel, instead of editing this file manually, run: | |
| # | |
| # > fx bazel2gn | |
| # | |
| # Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and | |
| # rerun bazel2gn. | |
| import("//build/tools/bazel2gn/bazel_migration.gni") | |
| rustc_library("elf_parse") { | |
| sources = [ "src/lib.rs" ] | |
| inputs = [ | |
| "test-utils/elf_aarch64_file-header.bin", | |
| "test-utils/elf_riscv64_file-header.bin", | |
| "test-utils/elf_x86-64_file-header.bin", | |
| ] | |
| edition = "2024" | |
| proc_macro_deps = [ "//third_party/rust_crates:num-derive" ] | |
| visibility = [ | |
| ":*", | |
| "//src/bringup/*", | |
| "//src/developer/*", | |
| "//src/lib/elf-search/rust:*", | |
| "//src/lib/process_builder:*", | |
| "//src/performance/*", | |
| "//src/starnix/*", | |
| ] | |
| deps = [ | |
| "//sdk/rust/zx", | |
| "//third_party/rust_crates:bitflags", | |
| "//third_party/rust_crates:num-traits", | |
| "//third_party/rust_crates:static_assertions", | |
| "//third_party/rust_crates:thiserror", | |
| "//third_party/rust_crates:zerocopy", | |
| ] | |
| } |