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

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

Issue 2099003002: build tweaks for cfi Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 6 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 | build/config/sanitizers/BUILD.gn » ('j') | 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/compiler/compiler.gni") 7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/nacl/config.gni") 8 import("//build/config/nacl/config.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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 } 455 }
456 456
457 # Allows the linker to apply ICF to the LTO object file. Also, when 457 # Allows the linker to apply ICF to the LTO object file. Also, when
458 # targeting ARM, without this flag, LTO produces a .text section that is 458 # targeting ARM, without this flag, LTO produces a .text section that is
459 # larger than the maximum call displacement, preventing the linker from 459 # larger than the maximum call displacement, preventing the linker from
460 # relocating calls (http://llvm.org/PR22999). 460 # relocating calls (http://llvm.org/PR22999).
461 if (is_linux) { 461 if (is_linux) {
462 ldflags += [ "-Wl,-plugin-opt,-function-sections" ] 462 ldflags += [ "-Wl,-plugin-opt,-function-sections" ]
463 } 463 }
464 464
465 # TODO(pcc): Make these flags work correctly with CFI. 465 cflags += [ "-fwhole-program-vtables" ]
466 if (!is_cfi) { 466 ldflags += [ "-fwhole-program-vtables" ]
467 cflags += [ "-fwhole-program-vtables" ]
468 ldflags += [ "-fwhole-program-vtables" ]
469 }
470 } 467 }
471 468
472 # Pass the same C/C++ flags to the objective C/C++ compiler. 469 # Pass the same C/C++ flags to the objective C/C++ compiler.
473 cflags_objc += cflags_c 470 cflags_objc += cflags_c
474 cflags_objcc += cflags_cc 471 cflags_objcc += cflags_cc
475 472
476 # Assign any flags set for the C compiler to asmflags so that they are sent 473 # Assign any flags set for the C compiler to asmflags so that they are sent
477 # to the assembler. The Windows assembler takes different types of flags 474 # to the assembler. The Windows assembler takes different types of flags
478 # so only do so for posix platforms. 475 # so only do so for posix platforms.
479 if (is_posix) { 476 if (is_posix) {
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 1538
1542 if (is_ios || is_mac) { 1539 if (is_ios || is_mac) {
1543 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1540 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1544 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1541 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1545 config("enable_arc") { 1542 config("enable_arc") {
1546 common_flags = [ "-fobjc-arc" ] 1543 common_flags = [ "-fobjc-arc" ]
1547 cflags_objc = common_flags 1544 cflags_objc = common_flags
1548 cflags_objcc = common_flags 1545 cflags_objcc = common_flags
1549 } 1546 }
1550 } 1547 }
OLDNEW
« no previous file with comments | « no previous file | build/config/sanitizers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698