0

Android: Remove ignore_elf32_limitations GN arg and related assert

Building libmonochrome.so with symbol_level=2 results in a 3.6GB file,
which is under the 4GB size of concern.

I'm also not sure if there is still a 4GB limit. The assert and bug were
added when we still used gold linker.

Bug: 1122182, 648948
Change-Id: Ia88041ca4c628f0c5a4fa32c3870dc966f71f19a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3251520
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/main@{#935964}
This commit is contained in:
Andrew Grieve
2021-10-28 17:31:18 +00:00
committed by Chromium LUCI CQ
parent 134ad90061
commit a49c82be61
4 changed files with 6 additions and 30 deletions
build/config/compiler
build_overrides
components/cronet/tools

@ -2385,19 +2385,15 @@ config("minimal_symbols") {
ldflags = []
if (is_android && is_clang) {
# Android defaults to symbol_level=1 builds in production builds
# (https://crbug.com/648948), but clang, unlike gcc, doesn't emit
# DW_AT_linkage_name in -g1 builds. -fdebug-info-for-profiling enables
# that (and a bunch of other things we don't need), so that we get
# qualified names in stacks.
# Android defaults to symbol_level=1 builds, but clang, unlike gcc,
# doesn't emit DW_AT_linkage_name in -g1 builds.
# -fdebug-info-for-profiling enables that (and a bunch of other things we
# don't need), so that we get qualified names in stacks.
# TODO(thakis): Consider making clang emit DW_AT_linkage_name in -g1 mode;
# failing that consider doing this on non-Android too.
cflags += [ "-fdebug-info-for-profiling" ]
}
# Note: debug_fission is no-op with symbol_level=1 since all -g1 debug_info
# will stay in the executable.
asmflags = cflags
}
rustflags = [ "-Cdebuginfo=1" ]

@ -264,8 +264,7 @@ if (use_debug_fission == "default") {
assert(symbol_level >= -1 && symbol_level <= 2, "Invalid symbol_level")
if (symbol_level == -1) {
if (is_android && !is_component_build && !use_debug_fission) {
# Reduce symbol level when it will cause invalid elf files to be created
# (due to file size). https://crbug.com/648948.
# Prefer faster & smaller release builds.
symbol_level = 1
} else if (is_chromeos_device) {
# Use lower symbol level in Simple Chrome build for faster link time.
@ -311,15 +310,3 @@ if (forbid_non_component_debug_builds) {
is_component_build || !is_debug || is_ios || use_debug_fission,
"Can't do non-component debug builds at symbol_level=2 without use_debug_fission=true")
}
# Assert that the configuration isn't going to hit https://crbug.com/648948.
# An exception is made when target_os == "chromeos" as we only use the Android
# toolchain there to build relatively small binaries.
assert(
ignore_elf32_limitations || !is_android || target_os == "chromeos" ||
is_component_build || symbol_level < 2 || use_debug_fission ||
(android_64bit_target_cpu && skip_secondary_abi_for_cq),
"Android 32-bit non-component builds without DWARF Fission cannot " +
"have symbol_level=2 due to 4GiB file size limit, see " +
"https://crbug.com/648948. " + "If you really want to try this out, " +
"set ignore_elf32_limitations=true.")

@ -52,13 +52,6 @@ declare_args() {
# ubsan_security_ignorelist_path = "path/to/ubsan/security_ignorelist.txt"
# cfi_ignorelist_path = "path/to/cfi/ignores.txt"
declare_args() {
# Android 32-bit non-component, non-clang builds cannot have symbol_level=2
# due to 4GiB file size limit, see https://crbug.com/648948.
# Set this flag to true to skip the assertion.
ignore_elf32_limitations = false
}
if (host_os == "mac" || is_apple) {
# Needed for is_apple when targeting macOS or iOS, independent of host.
# Needed for host_os=="mac" for running host tool such as gperf in blink

@ -108,7 +108,7 @@ def get_default_gn_args(target_os, is_release):
'disable_brotli_filter=false '
'is_component_build=false '
'use_crash_key_stubs=true '
'ignore_elf32_limitations=true use_partition_alloc=false '
'use_partition_alloc=false '
'include_transport_security_state_preload_list=false ') + use_goma()
if (is_release):
gn_args += 'is_debug=false is_official_build=true '