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

Unified Diff: build/config/compiler/BUILD.gn

Issue 568613002: gn: use bundled binutils via -B (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-various-matching
Patch Set: match condition in gyp Created 6 years, 3 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 | tools/gn/bin/gyp_flag_compare.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index d66f54c57a0c84cbe2f44c46f87d35a3d74eb599..3b50cfb49153eb1562c3bd6bb4779c9f22fa2028 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -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) {
« no previous file with comments | « no previous file | tools/gn/bin/gyp_flag_compare.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698