extract_symbols.gni 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright 2018 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//build/toolchain/toolchain.gni")
  5. # Extracts symbols from a binary into a symbol file using dump_app_syms.py.
  6. #
  7. # Args:
  8. # binary: Path to the binary containing symbols to extract, e.g.:
  9. # "$root_out_dir/chrome"
  10. # symbol_file: Desired output file for symbols, e.g.:
  11. # "$root_out_dir/chrome.breakpad.$current_cpu"
  12. template("extract_symbols") {
  13. forward_variables_from(invoker,
  14. [
  15. "deps",
  16. "testonly",
  17. ])
  18. action("${target_name}") {
  19. dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)"
  20. dump_syms_binary =
  21. get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"
  22. pool = "//build/toolchain:link_pool($default_toolchain)"
  23. script = "//build/linux/dump_app_syms.py"
  24. inputs = [
  25. invoker.binary,
  26. dump_syms_binary,
  27. ]
  28. outputs = [ invoker.symbol_file ]
  29. args = [
  30. "./" + rebase_path(dump_syms_binary, root_build_dir),
  31. "0", # strip_binary = false
  32. rebase_path(invoker.binary, root_build_dir),
  33. rebase_path(invoker.symbol_file, root_build_dir),
  34. ]
  35. deps += [ dump_syms_label ]
  36. }
  37. }