5 Some background on the original decision to ban static initializers:
7 http://neugierig.org/software/chromium/notes/2011/08/static-initializers.html
9 # How Static Initializers are Checked
12 * The expected count is stored in [//infra/scripts/legacy/scripts/slave/chromium/sizes.py](https://cs.chromium.org/chromium/src/infra/scripts/legacy/scripts/slave/chromium/sizes.py)
14 * The expected count is stored in the build target [//chrome/android:monochrome_static_initializers](https://cs.chromium.org/chromium/src/chrome/android/BUILD.gn)
16 ## Removing Static Initializers
22 * Move global variable to be a static variable within a function that returns it.
24 ## Listing Static Initializers
28 tools/linux/dump-static-initializers.py out/Release/chrome
30 For Android (from easiest to hardest):
32 # Build with: is_official_build=true is_chrome_branded=true
33 # This will dump the list of SI's only when they don't match the expected
34 # number in static_initializers.gni (this is what the bots use).
35 ninja chrome/android:monochrome_static_initializers
37 tools/binary_size/diagnose_bloat.py HEAD # See README.md for flags.
39 tools/linux/dump-static-initializers.py --toolchain-prefix third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi- out/Release/libmonochrome.so
41 * For more information about `diagnose_bloat.py`, refer to its [README.md](/tools/binary_size/README.md#diagnose_bloat.py)
42 * List of existing static initializers documented in [static_initializers.gni](/chrome/android/static_initializers.gni)