Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 08e9a9ef988737dcc6eaedee39e7b0021f20df0b..5cc1ca1842565bf76f642588c689f47f8125ea1b 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -1658,7 +1658,8 @@ config("symbols") { |
# "third_party/binutils/Linux_x64/Release/bin/ld.gold: warning: |
# /tmp/lto-llvm-0b5201.o: corrupt debug info in .debug_info" |
if (!is_mac && !is_ios && !is_nacl && target_cpu != "x86" && |
- !allow_posix_link_time_opt && !is_official_build) { |
+ (use_gold || use_lld) && !allow_posix_link_time_opt && |
+ !is_official_build) { |
ldflags += [ "-Wl,--gdb-index" ] |
} |
} |