| Index: build/config/compiler/BUILD.gn
|
| diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
| index 4bbc34f4e7d0cc77a69d13856bbd843c116a0dab..e54ff69182706c4f940be7f78c8c540af43a8716 100644
|
| --- a/build/config/compiler/BUILD.gn
|
| +++ b/build/config/compiler/BUILD.gn
|
| @@ -80,6 +80,12 @@ declare_args() {
|
| # of binutils can cause linker warning.
|
| # See: https://bugs.chromium.org/p/chromium/issues/detail?id=457359
|
| fatal_linker_warnings = true
|
| +
|
| + # AFDO (Automatic Feedback Directed Optimizer) is a form of profile-guided
|
| + # optimization that GCC supports. It used by ChromeOS in their official
|
| + # builds. To use it, set auto_profile_path to the path to a file containing
|
| + # the needed gcov profiling data.
|
| + auto_profile_path = ""
|
| }
|
|
|
| if (is_clang && !is_nacl) {
|
| @@ -1479,6 +1485,18 @@ config("default_optimization") {
|
| }
|
| }
|
|
|
| +# GCC supports a form of profile-guided optimization called AFDO, which
|
| +# is used by ChromeOS in their official builds. However,
|
| +# //base/allocator:tcmalloc currently doesn't work correctly with AFDO
|
| +# so we provide separate config so that the flag can be disabled per-target.
|
| +# TODO(crbug.com/633719): Remove this config once tcmalloc works with AFDO
|
| +# or we remove tcmalloc or we stop using AFDO.
|
| +config("afdo") {
|
| + if (auto_profile_path) {
|
| + cflags = [ "-fauto-profile=${auto_profile_path}" ]
|
| + }
|
| +}
|
| +
|
| # Symbols ----------------------------------------------------------------------
|
|
|
| # The BUILDCONFIG file sets the "default_symbols" config on targets by
|
|
|