blob: bad08842ac9c591ac2ab061280bec69c46069325 [file] [log] [blame]
# Copyright 2017 The Chromium Authors. All rights reserved.
# 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") &&
(!is_debug && !using_sanitizer && proprietary_codecs)) {
# Comments show static_initializers according to
# tools/linux/dump-static-initializers.py.
# TODO(https://crbug.com/1177849): Remove from tflite:
# tflite_engine.cc (initializer offset 0x34cb88c size 0x2c)
# __ThumbV7PILongThunk__ZNSt3__18ios_base4InitC1Ev
# __ThumbV7PILongThunk___cxa_atexit
expected_static_initializer_count = 1
# From v8 I think:
# token.cc (initializer offset 0x27f024c size 0x11c)
expected_static_initializer_count += 1
# This one is from //third_party/gvr-android-sdk
# base_logging.cc (initializer offset 0x9a4b0c size 0x48)
expected_static_initializer_count += 1
if (build_with_internal_optimization_guide) {
# 000081d1 t _GLOBAL__I_000101
expected_static_initializer_count += 1
}
if (use_static_angle && !is_official_build &&
(is_debug || dcheck_always_on)) {
# TODO(https://crbug.com/1172451): remove global variables from ANGLE:
#
# doc.cpp (initializer offset 0xcf9c6c size 0x138)
# SPVRemapper.cpp (initializer offset 0xcf2924 size 0x64)
expected_static_initializer_count += 2
}
if (use_clang_coverage) {
# InstrProfilingRuntime.cpp, Only in coverage builds, not production.
expected_static_initializer_count += 1
}
}