Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 98a5a66ccf3e581787141fa5018f5e09ee3299b7..9968459621e744ef197a551dad9d71904dcea9e7 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -350,7 +350,13 @@ config("compiler") { |
if (is_posix && (use_gold || (use_lld && !is_nacl)) && !using_sanitizer && |
!(is_android && use_order_profiling)) { |
- ldflags += [ "-Wl,--icf=all" ] |
+ # TODO(crbug.com/576197) - gcc on x86 platforms + gold + icf=all |
+ # doesn't currently work. Once it does, use icf=all everywhere. |
+ if (is_clang || (target_cpu != "x86" && target_cpu != "x64")) { |
+ ldflags += [ "-Wl,--icf=all" ] |
+ } else { |
+ ldflags += [ "-Wl,--icf=safe" ] |
+ } |
} |
if (linux_use_bundled_binutils) { |