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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 2890573002: build: Enable -fwhole-program-vtables under ThinLTO. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | 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/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/chromecast_build.gni") 7 import("//build/config/chromecast_build.gni")
8 import("//build/config/compiler/compiler.gni") 8 import("//build/config/compiler/compiler.gni")
9 import("//build/toolchain/cc_wrapper.gni") 9 import("//build/toolchain/cc_wrapper.gni")
10 import("//build/toolchain/toolchain.gni") 10 import("//build/toolchain/toolchain.gni")
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 if (use_lld) { 480 if (use_lld) {
481 ldflags += [ 481 ldflags += [
482 "-Wl,--thinlto-jobs=8", 482 "-Wl,--thinlto-jobs=8",
483 "-Wl,--thinlto-cache-dir=" + 483 "-Wl,--thinlto-cache-dir=" +
484 rebase_path("$root_out_dir/thinlto-cache", root_build_dir), 484 rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
485 ] 485 ]
486 } else { 486 } else {
487 ldflags += [ "-Wl,-plugin-opt,jobs=8" ] 487 ldflags += [ "-Wl,-plugin-opt,jobs=8" ]
488 } 488 }
489 } else { 489 } else {
490 # Note: ThinLTO does not currently have this feature implemented 490 cflags += [ "-flto" ]
491 # For Full LTO, it provides a measurable runtime speedup of Chrome. 491 ldflags += [ "-flto" ]
492 cflags += [
493 "-flto",
494 "-fwhole-program-vtables",
495 ]
496 ldflags += [
497 "-flto",
498 "-fwhole-program-vtables",
499 ]
500 492
501 # Apply a lower LTO optimization level as the default is too slow. 493 # Apply a lower LTO optimization level as the default is too slow.
502 if (is_linux) { 494 if (is_linux) {
503 if (use_lld) { 495 if (use_lld) {
504 ldflags += [ "-Wl,--lto-O1" ] 496 ldflags += [ "-Wl,--lto-O1" ]
505 } else { 497 } else {
506 ldflags += [ "-Wl,-plugin-opt,O1" ] 498 ldflags += [ "-Wl,-plugin-opt,O1" ]
507 } 499 }
508 } else if (is_mac) { 500 } else if (is_mac) {
509 ldflags += [ "-Wl,-mllvm,-O1" ] 501 ldflags += [ "-Wl,-mllvm,-O1" ]
510 } 502 }
511 } 503 }
512 504
505 cflags += [ "-fwhole-program-vtables" ]
506 ldflags += [ "-fwhole-program-vtables" ]
507
513 # Work-around for http://openradar.appspot.com/20356002 508 # Work-around for http://openradar.appspot.com/20356002
514 if (is_mac) { 509 if (is_mac) {
Nico 2017/05/16 19:51:19 Huh, why do we have mac stuff in here? We don't us
pcc1 2017/05/16 19:57:33 I think this is from some early work I did to try
515 ldflags += [ "-Wl,-all_load" ] 510 ldflags += [ "-Wl,-all_load" ]
516 } 511 }
517 512
518 # Allows the linker to apply --gc-sections and ICF to the LTO object file. 513 # Allows the linker to apply --gc-sections and ICF to the LTO object file.
519 # Also, when targeting ARM, without this flag, LTO produces a .text section 514 # Also, when targeting ARM, without this flag, LTO produces a .text section
520 # that is larger than the maximum call displacement, preventing the linker 515 # that is larger than the maximum call displacement, preventing the linker
521 # from relocating calls (http://llvm.org/PR22999). 516 # from relocating calls (http://llvm.org/PR22999).
522 if (is_linux) { 517 if (is_linux) {
523 if (use_lld) { 518 if (use_lld) {
524 ldflags += [ 519 ldflags += [
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 1747
1753 if (is_ios || is_mac) { 1748 if (is_ios || is_mac) {
1754 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1749 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1755 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1750 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1756 config("enable_arc") { 1751 config("enable_arc") {
1757 common_flags = [ "-fobjc-arc" ] 1752 common_flags = [ "-fobjc-arc" ]
1758 cflags_objc = common_flags 1753 cflags_objc = common_flags
1759 cflags_objcc = common_flags 1754 cflags_objcc = common_flags
1760 } 1755 }
1761 } 1756 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698