Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 8f827de89ee008c3f7d6555011f72d38d04fcde9..b7d82a4687b72622526eb37c3334042756e9c5ef 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -1159,7 +1159,10 @@ config("no_optimize") { |
if (!using_sanitizer) { |
cflags += [ "-fomit-frame-pointer" ] |
} |
- ldflags = common_optimize_on_ldflags |
+ |
+ # Don't use gc-sections since it can cause links to succeed when they |
+ # actually shouldn't. http://crbug.com/159847 |
+ ldflags = common_optimize_on_ldflags - [ "-Wl,--gc-sections" ] |
} else { |
cflags = [ "-O0" ] |
ldflags = [] |