Commit a00eb683 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[build] Clean up lto, gold plugin and cfi from gyp files

Bug: v8:6524
Change-Id: I8e440417eea59376c2fab659a86ad6570c7e018a
Reviewed-on: https://chromium-review.googlesource.com/549300Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46265}
parent 49f71433
......@@ -136,8 +136,6 @@
'clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts',
'make_clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts',
'use_lto%': 0,
# Control Flow Integrity for virtual calls and casts.
# See http://clang.llvm.org/docs/ControlFlowIntegrity.html
'cfi_vptr%': 0,
......@@ -202,7 +200,6 @@
'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
'use_custom_libcxx%': '<(use_custom_libcxx)',
'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
'use_lto%': '<(use_lto)',
'cfi_vptr%': '<(cfi_vptr)',
'cfi_diag%': '<(cfi_diag)',
'cfi_blacklist%': '<(cfi_blacklist)',
......@@ -293,9 +290,6 @@
# the C++ standard library is used.
'use_custom_libcxx%': 1,
}],
['cfi_vptr==1', {
'use_lto%': 1,
}],
['OS=="android"', {
# Location of Android NDK.
'variables': {
......@@ -679,15 +673,11 @@
}],
],
}],
['linux_use_bundled_gold==1 and not (clang==0 and use_lto==1)', {
['linux_use_bundled_gold==1', {
# Put our binutils, which contains gold in the search path. We pass
# the path to gold to the compiler. gyp leaves unspecified what the
# cwd is when running the compiler, so the normal gyp path-munging
# fails us. This hack gets the right path.
#
# Disabled when using GCC LTO because GCC also uses the -B search
# path at link time to find "as", and our bundled "as" can only
# target x86.
'ldflags': [
# Note, Chromium allows ia32 host arch as well, we limit this to
# x64 in v8.
......@@ -1410,109 +1400,5 @@
}],
],
}],
['use_lto==1', {
'target_defaults': {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-flto',
],
}],
],
},
}],
['use_lto==1 and clang==0', {
'target_defaults': {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-ffat-lto-objects',
],
}],
],
},
}],
['use_lto==1 and clang==1', {
'target_defaults': {
'target_conditions': [
['_toolset=="target"', {
'arflags': [
'--plugin', '<(clang_dir)/lib/LLVMgold.so',
],
# Apply a lower optimization level with lto. Chromium does this
# for non-official builds only - a differentiation that doesn't
# exist in v8.
'ldflags': [
'-Wl,--plugin-opt,O1',
],
}],
],
},
}],
['use_lto==1 and clang==0', {
'target_defaults': {
'target_conditions': [
['_toolset=="target"', {
'ldflags': [
'-flto=32',
],
}],
],
},
}],
['use_lto==1 and clang==1', {
'target_defaults': {
'target_conditions': [
['_toolset=="target"', {
'ldflags': [
'-flto',
],
}],
],
},
}],
['cfi_diag==1', {
'target_defaults': {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fno-sanitize-trap=cfi',
'-fno-sanitize-recover=cfi',
],
'cflags_cc!': [
'-fno-rtti',
],
'cflags!': [
'-fno-rtti',
],
'ldflags': [
'-fno-sanitize-trap=cfi',
'-fno-sanitize-recover=cfi',
],
}],
],
},
}],
['cfi_vptr==1', {
'target_defaults': {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=cfi-vcall',
'-fsanitize=cfi-derived-cast',
'-fsanitize=cfi-unrelated-cast',
'-fsanitize-blacklist=<(cfi_blacklist)',
'-fwhole-program-vtables',
],
'ldflags': [
'-fsanitize=cfi-vcall',
'-fsanitize=cfi-derived-cast',
'-fsanitize=cfi-unrelated-cast',
'-fwhole-program-vtables',
],
}],
],
},
}],
],
}
......@@ -128,9 +128,6 @@
}],
],
# Link-Time Optimizations
'use_lto%': 0,
# Indicates if gcmole tools are downloaded by a hook.
'gcmole%': 0,
},
......@@ -280,17 +277,6 @@
}],
],
}],
# Disable GCC LTO for v8
# v8 is optimized for speed. Because GCC LTO merges flags at link
# time, we disable LTO to prevent any -O2 flags from taking
# precedence over v8's -Os flag. However, LLVM LTO does not work
# this way so we keep LTO enabled under LLVM.
['clang==0 and use_lto==1', {
'cflags!': [
'-flto',
'-ffat-lto-objects',
],
}],
],
}], # _toolset=="target"
],
......@@ -1284,9 +1270,7 @@
}],
],
}],
# TODO(pcc): Re-enable in LTO builds once we've fixed the intermittent
# link failures (crbug.com/513074).
['linux_use_gold_flags==1 and use_lto==0', {
['linux_use_gold_flags==1', {
'target_conditions': [
['_toolset=="target"', {
'ldflags': [
......
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