extract_symbols.gni (1397B)
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 5 import("//chromium/build/toolchain/toolchain.gni") 6 7 # Extracts symbols from a binary into a symbol file using dump_app_syms.py. 8 # 9 # Args: 10 # binary: Path to the binary containing symbols to extract, e.g.: 11 # "$root_out_dir/chrome" 12 # symbol_file: Desired output file for symbols, e.g.: 13 # "$root_out_dir/chrome.breakpad.$target_cpu" 14 template("extract_symbols") { 15 forward_variables_from(invoker, 16 [ 17 "deps", 18 "testonly", 19 ]) 20 action("${target_name}") { 21 dump_syms_label = 22 "//third_party/breakpad:dump_syms($host_system_allocator_toolchain)" 23 dump_syms_binary = 24 get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms" 25 26 pool = "//chromium/build/toolchain:link_pool($default_toolchain)" 27 script = "//chromium/build/linux/dump_app_syms.py" 28 inputs = [ 29 invoker.binary, 30 dump_syms_binary, 31 ] 32 outputs = [ invoker.symbol_file ] 33 args = [ 34 "./" + rebase_path(dump_syms_binary, root_build_dir), 35 "0", # strip_binary = false 36 rebase_path(invoker.binary, root_build_dir), 37 rebase_path(invoker.symbol_file, root_build_dir), 38 ] 39 40 deps += [ dump_syms_label ] 41 } 42 }