Commit 41644052 authored by scottmg's avatar scottmg Committed by Commit bot

gn: use bundled binutils via -B

- Use bundled binutils by adding to cflags -B
- Enables dwarf-fission based on bundling (maybe correct?)
- Makes differ normalize -B paths so they can be compared between gyp/gn.

R=brettw@chromium.org
BUG=335824

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

Cr-Commit-Position: refs/heads/master@{#295185}
parent 024dba2f
......@@ -14,6 +14,12 @@ declare_args() {
# Normally, Android builds are lightly optimized, even for debug builds, to
# keep binary size down. Setting this flag to true disables such optimization
android_full_debug = false
# Whether to use the binary binutils checked into third_party/binutils.
# These are not multi-arch so cannot be used except on x86 and x86-64 (the
# only two architectures that are currently checked in). Turn this off when
# you are using a custom toolchain and need to control -B in cflags.
linux_use_bundled_binutils = is_linux && cpu_arch == "x64"
}
use_gold = is_linux && cpu_arch == "x64"
......@@ -24,11 +30,7 @@ if (!is_win) {
# with some utilities such as icecc and ccache. Requires gold and
# gcc >= 4.8 or clang.
# http://gcc.gnu.org/wiki/DebugFission
#
# TODO(GYP) enable this. Currently this gives errors from objcopy, presumably
# because some other symbol or toolchain setting isn't correct.
#use_debug_fission = use_gold
use_debug_fission = false
use_debug_fission = use_gold && linux_use_bundled_binutils
}
# default_include_dirs ---------------------------------------------------------
......@@ -267,6 +269,12 @@ config("compiler") {
]
}
if (linux_use_bundled_binutils) {
binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
root_build_dir)
cflags += [ "-B$binutils_path" ]
}
# Clang-specific compiler flags setup.
# ------------------------------------
if (is_clang) {
......
......@@ -113,6 +113,11 @@ def GetFlags(lines):
os.path.join(os.getcwd(),
os.path.normpath(
os.path.join('out/gn_flags', x.split(' ', 1)[1]))))
elif x.startswith('-B'):
others_filtered.append(
'-B' +
os.path.join(os.getcwd(),
os.path.normpath(os.path.join('out/gn_flags', x[2:]))))
else:
others_filtered.append(x)
others = others_filtered
......
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