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

Unified Diff: build/common.gypi

Issue 1809273002: Enable whole-program virtual function optimization in LTO mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/config/compiler/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index 03416541de98945ef60e7343a413a55ae7ee5df7..0e88c8b8694bad1e4c754f8a2784d1303c6ffb36 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -6149,6 +6149,11 @@
['_toolset=="target"', {
'ldflags': [
'-Wl,--plugin-opt,O1',
+ # Allows the linker to apply ICF to the LTO object file. Also, when
+ # targeting ARM, wWithout this flag, LTO produces a .text section
+ # that is larger than the maximum call displacement, preventing the
+ # linker from relocating calls (http://llvm.org/PR22999).
+ '-Wl,--plugin-opt,-function-sections',
],
}],
['_toolset=="target" and _type!="static_library"', {
@@ -6168,20 +6173,6 @@
},
},
}],
- ['use_lto==1 and clang==1 and target_arch=="arm"', {
- 'target_defaults': {
- 'target_conditions': [
- ['_toolset=="target"', {
- # Without this flag, LTO produces a .text section that is larger
- # than the maximum call displacement, preventing the linker from
- # relocating calls (http://llvm.org/PR22999).
- 'ldflags': [
- '-Wl,-plugin-opt,-function-sections',
- ],
- }],
- ],
- },
- }],
['(use_lto==1 or use_lto_o2==1) and clang==0', {
'target_defaults': {
'target_conditions': [
@@ -6327,6 +6318,24 @@
],
},
}],
+ # TODO(pcc): Make these flags work correctly with CFI.
+ ['use_lto!=0 and cfi_vptr==0', {
+ 'target_defaults': {
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'cflags': [
+ '-fwhole-program-vtables',
+ # TODO(pcc): Remove this flag once the upstream interface change
+ # (http://reviews.llvm.org/D18635) lands.
+ '-fwhole-program-vtables-blacklist=<(cfi_blacklist)',
+ ],
+ 'ldflags': [
+ '-fwhole-program-vtables',
+ ],
+ }],
+ ],
+ },
+ }],
],
'xcode_settings': {
# DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
« no previous file with comments | « no previous file | build/config/compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698