| # Copyright 2017 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/features.gni") |
| import("//build/config/sanitizers/sanitizers.gni") |
| import("//components/optimization_guide/features.gni") |
| import("//ui/gl/features.gni") |
| |
| # The monochrome_static_initializers target will cause release bots to fail if |
| # the count of static initializers change in either direction. Please try not to |
| # increase the numbers. If they come from third-party code, please try to update |
| # the code, or apply a local modification to remove them. |
| # |
| # Some helpful hints at //docs/static_initializers.md |
| # |
| # Define expectations only for GN args covered by trybots. |
| if (current_toolchain == default_toolchain && |
| (target_cpu == "arm" || target_cpu == "arm64") && |
| (!using_sanitizer && proprietary_codecs && |
| # Optimizations can remove static initializers (https://crbug.com/1434325) |
| !is_debug && !is_high_end_android)) { |
| # Comments show static_initializers according to |
| # tools/linux/dump-static-initializers.py. |
| _chrome_count = 0 |
| |
| if (target_cpu == "arm64") { |
| # Caused by "outline atomics". https://crbug.com/1272795 |
| # cpu_model.c: init_have_lse_atomics, init_cpu_features |
| _chrome_count += 2 |
| } |
| |
| # iostream.cpp: _GLOBAL__I_000101 |
| _chrome_count += 1 |
| |
| # v8/src/parsing/token.cc: _GLOBAL__sub_I_token.cc |
| _chrome_count += 1 |
| |
| # From //third_party/gvr-android-sdk: _GLOBAL__sub_I_base_logging.cc |
| _chrome_count += 1 |
| |
| if (use_clang_coverage) { |
| # InstrProfilingRuntime.cpp, Only in coverage builds, not production. |
| _chrome_count += 1 |
| } |
| |
| _optimization_guide_count = 0 |
| |
| if (build_with_internal_optimization_guide) { |
| if (target_cpu == "arm64") { |
| # Caused by "outline atomics". https://crbug.com/1272795 |
| # cpu_model.c: init_have_lse_atomics, init_cpu_features |
| _optimization_guide_count += 2 |
| } |
| |
| # iostream_init.h: _GLOBAL__I_000100 |
| _optimization_guide_count += 1 |
| } |
| |
| expected_static_initializer_count = _chrome_count + _optimization_guide_count |
| } |