| # Copyright 2021 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. |
| # |
| |
| config("target_archive_config") { |
| include_dirs = [ "include" ] |
| } |
| |
| source_set("target_archive_headers") { |
| public = [ "include/target_archive/target_archive.h" ] |
| public_configs = [ ":target_archive_config" ] |
| } |
| |
| source_set("target_archive_sources") { |
| public_deps = [ ":target_archive_headers" ] |
| sources = [ |
| "include/target_archive/target_archive.h", |
| "target_archive.c", |
| ] |
| } |
| |
| # |
| # Concatenates one or more binaries prefixed by a table containing the |
| # number of binaries and the offset and size of each binary. |
| # |
| if (is_host) { |
| executable("target_archive") { |
| deps = [ ":target_archive_sources" ] |
| # output_name = "target-archive" |
| } |
| } |
| |
| # This is used by the target_archive() template in gn/target_archive.gni. It's |
| # added to configs in an executable() target to make it do a link appropriate |
| # for extracting standalone raw binary image containing only RODATA. |
| # See the linker script for more details. |
| config("struct_sources.config") { |
| inputs = [ "rodata-extract.ld" ] |
| ldflags = [ |
| "-nostdlib", |
| "-nostartfiles", |
| "-Wl,--build-id=none", |
| "-Wl,-T," + rebase_path(inputs[0], root_build_dir), |
| |
| # TODO(https://fxbug.dev/42177378): Suppress complaints about library-selection |
| # options from standard configs that are moot with -nostdlib. |
| "-Wno-unused-command-line-argument", |
| ] |
| configs = [ "//build/config/sanitizers:no_sanitizers" ] |
| } |