Commit 99ee00d8 authored by pcc's avatar pcc Committed by Commit bot

Port LTO-related flags to more platforms.

Specifically:

- Supply -function-sections flag to the gold plugin when targeting ARM.
  Without this flag, LTO can produce a .text section that is larger than
  the maximum call displacement, preventing the linker from relocating calls.

- Move the other gold plugin-specific flag to the same place,
  and add a Mac version.

BUG=469376,469377
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/1024203004

Cr-Commit-Position: refs/heads/master@{#321841}
parent 9990fe47
......@@ -3005,12 +3005,6 @@
['v8_use_external_startup_data==1', {
'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
}],
['use_lto==1 and (target_arch=="ia32" or target_arch=="x64")', {
# Required for third_party/zlib/crc_folding.c and various other code
# that uses SSE. TODO(pcc): Remove this once we properly support
# subtarget specific code generation in LLVM.
'ldflags': ['-Wl,-plugin-opt,mcpu=corei7-avx'],
}],
], # conditions for 'target_defaults'
'target_conditions': [
['<(use_libpci)==1', {
......@@ -5941,6 +5935,41 @@
],
},
}],
['use_lto==1 and clang==1 and (target_arch=="ia32" or target_arch=="x64")', {
'target_defaults': {
'target_conditions': [
# Required for third_party/zlib/crc_folding.c and various other code
# that uses SSE. TODO(pcc): Remove this once we properly support
# subtarget specific code generation in LLVM.
['_toolset=="target"', {
'ldflags': [
'-Wl,-plugin-opt,mcpu=corei7-avx',
],
}],
['_toolset=="target" and _type!="static_library"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-mcpu,corei7-avx',
],
},
}],
],
},
}],
['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': [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment