• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2018 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/android/rules.gni")
6
7unwind_table_asset_v1_filename = "unwind_cfi_32"
8
9_dump_syms_target = "//third_party/breakpad:dump_syms($host_toolchain)"
10_dump_syms = get_label_info(_dump_syms_target, "root_out_dir") + "/dump_syms"
11
12template("unwind_table_v1") {
13  action(target_name) {
14    forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
15    _output_path =
16        "$target_out_dir/$target_name/$unwind_table_asset_v1_filename"
17
18    # Strip the "lib" prefix, if present. Add and then remove a space because
19    # our ownly tool is "replace all".
20    _library_name = get_label_info(invoker.library_target, "name")
21    _library_name =
22        string_replace(string_replace(" $_library_name", " $shlib_prefix", ""),
23                       " ",
24                       "")
25    _library_path = "$root_out_dir/lib.unstripped/$shlib_prefix$_library_name$shlib_extension"
26
27    script = "//build/android/gyp/extract_unwind_tables.py"
28    outputs = [ _output_path ]
29    inputs = [
30      _dump_syms,
31      _library_path,
32    ]
33    deps = [
34      _dump_syms_target,
35      invoker.library_target,
36    ]
37
38    args = [
39      "--input_path",
40      rebase_path(_library_path, root_build_dir),
41      "--output_path",
42      rebase_path(_output_path, root_build_dir),
43      "--dump_syms_path",
44      rebase_path(_dump_syms, root_build_dir),
45    ]
46  }
47}
48