Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Side by Side Diff: build/toolchain/gcc_toolchain.gni

Issue 2726983004: Output a linker map file for official builds (Closed)
Patch Set: guard behind is_official_build Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/toolchain/gcc_solink_wrapper.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/clang/clang.gni") 6 import("//build/config/clang/clang.gni")
7 import("//build/config/nacl/config.gni") 7 import("//build/config/nacl/config.gni")
8 import("//build/config/sanitizers/sanitizers.gni") 8 import("//build/config/sanitizers/sanitizers.gni")
9 import("//build/config/v8_target_cpu.gni") 9 import("//build/config/v8_target_cpu.gni")
10 import("//build/toolchain/cc_wrapper.gni") 10 import("//build/toolchain/cc_wrapper.gni")
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 313
314 # These variables are not built into GN but are helpers that 314 # These variables are not built into GN but are helpers that
315 # implement (1) linking to produce a .so, (2) extracting the symbols 315 # implement (1) linking to produce a .so, (2) extracting the symbols
316 # from that file (3) if the extracted list differs from the existing 316 # from that file (3) if the extracted list differs from the existing
317 # .TOC file, overwrite it, otherwise, don't change it. 317 # .TOC file, overwrite it, otherwise, don't change it.
318 tocfile = sofile + ".TOC" 318 tocfile = sofile + ".TOC"
319 319
320 link_command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_s ofile\" -Wl,-soname=\"$soname\" @\"$rspfile\"" 320 link_command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_s ofile\" -Wl,-soname=\"$soname\" @\"$rspfile\""
321 321
322 # Generate a map file to be used for binary size analysis.
323 # Map file adds ~10% to the link time on a z620.
324 # With target_os="android", libchrome.so.map.gz is ~20MB.
325 map_switch = ""
326 if (is_official_build) {
Dirk Pranke 2017/03/03 21:38:48 This'll affect linux and chromeos too, right? Is t
agrieve 2017/03/04 02:01:26 It was intentional, since the size analysis tool s
327 map_switch = "--mapfile \"$unstripped_sofile.map.gz\" "
328 }
329
322 assert(defined(readelf), "to solink you must have a readelf") 330 assert(defined(readelf), "to solink you must have a readelf")
323 assert(defined(nm), "to solink you must have an nm") 331 assert(defined(nm), "to solink you must have an nm")
324 strip_switch = "" 332 strip_switch = ""
325 if (defined(invoker.strip)) { 333 if (defined(invoker.strip)) {
326 strip_switch = "--strip=${invoker.strip}" 334 strip_switch = "--strip=${invoker.strip} "
327 } 335 }
328 336
329 # This needs a Python script to avoid using a complex shell command 337 # This needs a Python script to avoid using a complex shell command
330 # requiring sh control structures, pipelines, and POSIX utilities. 338 # requiring sh control structures, pipelines, and POSIX utilities.
331 # The host might not have a POSIX shell and utilities (e.g. Windows). 339 # The host might not have a POSIX shell and utilities (e.g. Windows).
332 solink_wrapper = rebase_path("//build/toolchain/gcc_solink_wrapper.py") 340 solink_wrapper = rebase_path("//build/toolchain/gcc_solink_wrapper.py")
333 command = "$python_path \"$solink_wrapper\" --readelf=\"$readelf\" --nm=\" $nm\" $strip_switch --sofile=\"$unstripped_sofile\" --tocfile=\"$tocfile\" --out put=\"$sofile\"$whitelist_flag -- $link_command" 341 command = "$python_path \"$solink_wrapper\" --readelf=\"$readelf\" --nm=\" $nm\" $strip_switch--sofile=\"$unstripped_sofile\" --tocfile=\"$tocfile\" $map_s witch--output=\"$sofile\"$whitelist_flag -- $link_command"
334 342
335 rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whol e-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" 343 rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whol e-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix"
336 344
337 description = "SOLINK $sofile" 345 description = "SOLINK $sofile"
338 346
339 # Use this for {{output_extension}} expansions unless a target manually 347 # Use this for {{output_extension}} expansions unless a target manually
340 # overrides it (in which case {{output_extension}} will be what the target 348 # overrides it (in which case {{output_extension}} will be what the target
341 # specifies). 349 # specifies).
342 default_output_extension = default_shlib_extension 350 default_output_extension = default_shlib_extension
343 351
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 forward_variables_from(invoker, [ "strip" ]) 522 forward_variables_from(invoker, [ "strip" ])
515 523
516 toolchain_args = { 524 toolchain_args = {
517 if (defined(invoker.toolchain_args)) { 525 if (defined(invoker.toolchain_args)) {
518 forward_variables_from(invoker.toolchain_args, "*") 526 forward_variables_from(invoker.toolchain_args, "*")
519 } 527 }
520 is_clang = true 528 is_clang = true
521 } 529 }
522 } 530 }
523 } 531 }
OLDNEW
« no previous file with comments | « build/toolchain/gcc_solink_wrapper.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698