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

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

Issue 2840723003: build: Enable function sections and data sections during LTO. (Closed)
Patch Set: Created 3 years, 8 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/config/nacl/config.gni") 9 import("//build/config/nacl/config.gni")
10 import("//build/toolchain/cc_wrapper.gni") 10 import("//build/toolchain/cc_wrapper.gni")
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } else if (is_mac) { 505 } else if (is_mac) {
506 ldflags += [ "-Wl,-mllvm,-O1" ] 506 ldflags += [ "-Wl,-mllvm,-O1" ]
507 } 507 }
508 } 508 }
509 509
510 # Work-around for http://openradar.appspot.com/20356002 510 # Work-around for http://openradar.appspot.com/20356002
511 if (is_mac) { 511 if (is_mac) {
512 ldflags += [ "-Wl,-all_load" ] 512 ldflags += [ "-Wl,-all_load" ]
513 } 513 }
514 514
515 # Allows the linker to apply ICF to the LTO object file. Also, when 515 # Allows the linker to apply --gc-sections and ICF to the LTO object file.
516 # targeting ARM, without this flag, LTO produces a .text section that is 516 # Also, when targeting ARM, without this flag, LTO produces a .text section
517 # larger than the maximum call displacement, preventing the linker from 517 # that is larger than the maximum call displacement, preventing the linker
518 # relocating calls (http://llvm.org/PR22999). 518 # from relocating calls (http://llvm.org/PR22999).
519 if (is_linux) { 519 if (is_linux) {
520 ldflags += [ "-Wl,-plugin-opt,-function-sections" ] 520 if (use_lld) {
521 ldflags += [
522 "-Wl,-mllvm,-function-sections",
523 "-Wl,-mllvm,-data-sections",
524 ]
525 } else {
526 ldflags += [
527 "-Wl,-plugin-opt,-function-sections",
528 "-Wl,-plugin-opt,-data-sections",
529 ]
530 }
521 } 531 }
522 } 532 }
523 533
524 # Pass the same C/C++ flags to the objective C/C++ compiler. 534 # Pass the same C/C++ flags to the objective C/C++ compiler.
525 cflags_objc += cflags_c 535 cflags_objc += cflags_c
526 cflags_objcc += cflags_cc 536 cflags_objcc += cflags_cc
527 537
528 # Assign any flags set for the C compiler to asmflags so that they are sent 538 # Assign any flags set for the C compiler to asmflags so that they are sent
529 # to the assembler. The Windows assembler takes different types of flags 539 # to the assembler. The Windows assembler takes different types of flags
530 # so only do so for posix platforms. 540 # so only do so for posix platforms.
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 1741
1732 if (is_ios || is_mac) { 1742 if (is_ios || is_mac) {
1733 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1743 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1734 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1744 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1735 config("enable_arc") { 1745 config("enable_arc") {
1736 common_flags = [ "-fobjc-arc" ] 1746 common_flags = [ "-fobjc-arc" ]
1737 cflags_objc = common_flags 1747 cflags_objc = common_flags
1738 cflags_objcc = common_flags 1748 cflags_objcc = common_flags
1739 } 1749 }
1740 } 1750 }
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