Update LTO flags for Mac.
Specifically: - Use -all_load to work around http://openradar.appspot.com/20356002 - Disable the verify_order postbuild step when using LTO, as this step currently fails. Also update the documentation for the use_lto and use_lto_o2 build flags. Requires https://codereview.chromium.org/1003273007 Requires https://codereview.chromium.org/1047853005 to build Chrome. We can build simple targets even without this change. BUG=471146 R=thakis@chromium.org Review URL: https://codereview.chromium.org/1045113004 Cr-Original-Commit-Position: refs/heads/master@{#323134} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 059ec677a02907ceac79dd68741b6ed820cd7ff0
This commit is contained in:
Родитель
c4a461206d
Коммит
32da278a65
34
common.gypi
34
common.gypi
|
@ -625,14 +625,23 @@
|
|||
# compiler. Always do this by default.
|
||||
'host_clang%': 1,
|
||||
|
||||
# Variables to control Link-Time Optimizations (LTO).
|
||||
# Note: the variables must *not* be enabled at the same time.
|
||||
# In this case LTO would 'merge' the optimization flags
|
||||
# at link-time which would lead to all code be optimized with -O2.
|
||||
# Enable LTO on the code compiled with -Os.
|
||||
# See crbug.com/407544
|
||||
# Variables to control Link-Time Optimization (LTO).
|
||||
# On Android, the variable use_lto enables LTO on code compiled with -Os,
|
||||
# and use_lto_o2 enables LTO on code compiled with -O2. On other
|
||||
# platforms, use_lto enables LTO in all translation units, and use_lto_o2
|
||||
# has no effect.
|
||||
#
|
||||
# On Linux and Android, when using LLVM LTO, the script
|
||||
# build/download_gold_plugin.py must be run to download a linker plugin.
|
||||
# On Mac, LLVM needs to be built from scratch using
|
||||
# tools/clang/scripts/update.py and the absolute path to
|
||||
# third_party/llvm-build/Release+Asserts/lib must be added to
|
||||
# $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
|
||||
#
|
||||
# On Android, the variables must *not* be enabled at the same time.
|
||||
# In this case LTO would 'merge' the optimization flags at link-time
|
||||
# which would lead to all code be optimized with -O2. See crbug.com/407544
|
||||
'use_lto%': 0,
|
||||
# Enable LTO on code compiled with -O2.
|
||||
'use_lto_o2%': 0,
|
||||
|
||||
# Allowed level of identical code folding in the gold linker.
|
||||
|
@ -5810,6 +5819,17 @@
|
|||
'cflags': [
|
||||
'-flto',
|
||||
],
|
||||
'xcode_settings': {
|
||||
'LLVM_LTO': 'YES',
|
||||
},
|
||||
}],
|
||||
# Work-around for http://openradar.appspot.com/20356002
|
||||
['_toolset=="target" and _type!="static_library"', {
|
||||
'xcode_settings': {
|
||||
'OTHER_LDFLAGS': [
|
||||
'-Wl,-all_load',
|
||||
],
|
||||
},
|
||||
}],
|
||||
],
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче