Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 9120e66e9d9ad6023ad37cf7670d7d95fef382b2..07583ee7cad1e204afc1386daf325c7ecfe5764b 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -30,6 +30,8 @@ declare_args() { |
# 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 && current_cpu == "x64" |
+ binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
+ root_build_dir) |
# Compile in such a way as to enable profiling of the generated code. For |
# example, don't omit the frame pointer and leave in symbols. |
@@ -46,6 +48,14 @@ declare_args() { |
# address space, and it doesn't support cross-compiling). |
use_gold = is_linux && current_cpu == "x64" |
+ # When we are going to use gold we need to find it. |
+ if (use_gold) { |
+ gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
+ root_build_dir) |
+ } else { |
+ gold_path = "" |
+ } |
+ |
# use_debug_fission: whether to use split DWARF debug info |
# files. This can reduce link time significantly, but is incompatible |
# with some utilities such as icecc and ccache. Requires gold and |
@@ -456,8 +466,6 @@ config("compiler") { |
ldflags += [ "-pthread" ] |
} |
if (use_gold) { |
- gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
- root_build_dir) |
ldflags += [ |
"-B$gold_path", |
@@ -491,8 +499,6 @@ 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" ] |
} |