Commit 98c5c39a authored by Tiancong Wang's avatar Tiancong Wang Committed by Commit Bot

[build] Provide a GN arg to enable call-graph-profile-sort

In Chrome OS, we need to enable call-graph-profile-sort for most
of the use cases, except when we are generating orderfiles. Thus
we have to use a flag to enable call-graph-profile-sort, when
it's needed. Hopefully this flag can also be useful when other
platforms find it useful to enable call-graph-profile-sort.

BUG=chromium:1117564
TEST=Tested locally for chromeos

Change-Id: I045cbeae058889f2b4f20fbfcd1994d45179bb9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2364753
Commit-Queue: Tiancong Wang <tcwang@google.com>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800344}
parent 8892230f
...@@ -147,6 +147,10 @@ declare_args() { ...@@ -147,6 +147,10 @@ declare_args() {
(is_win && target_cpu == "x86") || (is_win && target_cpu == "x64") || (is_win && target_cpu == "x86") || (is_win && target_cpu == "x64") ||
(is_android && target_cpu == "arm") || (is_android && target_cpu == "arm") ||
(is_android && target_cpu == "arm64")) (is_android && target_cpu == "arm64"))
# Turn off the --call-graph-profile-sort flag for lld by default. Enable
# selectively for targets where it's beneficial.
enable_call_graph_profile_sort = false
} }
declare_args() { declare_args() {
...@@ -701,7 +705,7 @@ config("compiler") { ...@@ -701,7 +705,7 @@ config("compiler") {
# present. On Android this increases binary size due to more thinks for long # present. On Android this increases binary size due to more thinks for long
# jumps. Turn it off by default and enable selectively for targets where it's # jumps. Turn it off by default and enable selectively for targets where it's
# beneficial. # beneficial.
if (use_lld) { if (use_lld && !enable_call_graph_profile_sort) {
if (is_win) { if (is_win) {
ldflags += [ "/call-graph-profile-sort:no" ] ldflags += [ "/call-graph-profile-sort:no" ]
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment