Commit 2fed0414 authored by Sebastien Marchand's avatar Sebastien Marchand Committed by Commit Bot

Few fixes for PGO on Linux

- Disable AFDO when using PGO
- Don't try to use PGO on NaCl.

Bug: 1107531
Change-Id: Ia2b161834c6467b648513c49527d881df79c9af2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2308170Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarGeorge Burgess <gbiv@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790479}
parent fa355d6f
......@@ -86,8 +86,9 @@ declare_args() {
# We currently only have default profiles for Chromium in-tree, so we disable
# this by default for all downstream projects, since these profiles are likely
# nonsensical for said projects.
clang_use_default_sample_profile = build_with_chromium && is_official_build &&
(is_android || is_desktop_linux)
clang_use_default_sample_profile =
chrome_pgo_phase == 0 && build_with_chromium && is_official_build &&
(is_android || is_desktop_linux)
# This configuration is used to select a default profile in Chrome OS based on
# the microarchitectures we are using. This is only used if
......@@ -2195,6 +2196,7 @@ config("afdo") {
}
}
if (_clang_sample_profile != "") {
assert(chrome_pgo_phase == 0, "AFDO can't be used in PGO builds")
rebased_clang_sample_profile =
rebase_path(_clang_sample_profile, root_build_dir)
cflags += [ "-fprofile-sample-use=${rebased_clang_sample_profile}" ]
......
......@@ -510,6 +510,9 @@ if (is_linux && is_clang) {
configs -= [ "//build/config/sanitizers:default_sanitizer_flags" ]
configs -= [ "//build/config/coverage:default_coverage" ]
# Do not use PGO as it also requires a few symbols.
configs -= [ "//build/config/compiler/pgo:default_pgo_flags" ]
# Disable default_init_stack_vars because it inserts memset() calls, but
# memset() is not available in this libc-free context.
configs -= [ "//build/config/compiler:default_init_stack_vars" ]
......
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