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

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

Issue 1887303003: Build: disable icf for gcc builds with bundled gold (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixup Created 4 years, 8 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 | « build/common.gypi ('k') | no next file » | 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 3cf72220237662772be19973c54a9c9de54012fd..9c91e40c35fe5fd3bad6386003902d341ce82791 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -86,6 +86,10 @@ declare_args() {
# TODO(brettw) it's weird that Mac and desktop Linux are different. We should
# explore favoring size over speed in this case as well.
optimize_for_size = is_android || is_ios
+
+ # Gold icf level, values are "none", "safe", "all". If value isn't overridden,
+ # default initialization is below.
+ gold_icf_level = ""
}
# Apply the default logic for these values if they were not set explicitly.
@@ -103,6 +107,16 @@ if (use_debug_fission == "default") {
linux_use_bundled_binutils && cc_wrapper == ""
}
+if (gold_icf_level == "") {
+ if (use_gold && !is_clang) {
+ # Gold doesn't respect section alignment and breaks gcc builds with icf
+ # https://bugs.chromium.org/p/chromium/issues/detail?id=576197
+ gold_icf_level = "none"
+ } else {
+ gold_icf_level = "all"
+ }
+}
+
# default_include_dirs ---------------------------------------------------------
#
# This is a separate config so that third_party code (which would not use the
@@ -304,7 +318,7 @@ config("compiler") {
if (!using_sanitizer && !(is_android && use_order_profiling)) {
# TODO(brettw) common.gypi has this only for target toolset.
- ldflags += [ "-Wl,--icf=all" ]
+ ldflags += [ "-Wl,--icf=${gold_icf_level}" ]
}
# TODO(thestig): Make this flag work with GN.
« no previous file with comments | « build/common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698