Update BUILD.gn

This commit is contained in:
Alexander David Frick 2022-09-20 00:07:52 -05:00 committed by GitHub
parent cd151d8c95
commit 59d8080148
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -835,7 +835,7 @@ config("compiler") {
rustflags += [ "-Cembed-bitcode=no" ] rustflags += [ "-Cembed-bitcode=no" ]
} }
if (is_official_build) { if (is_official_build) {
rustflags += [ "-Ccodegen-units=1", "-Copt-level=3", "-Ctarget-feature=+sse4,+aes,+avx", ] rustflags += [ "-Ccodegen-units=1", "-Copt-level=3", "-Ctarget-feature=+aes,+avx", ]
} }
} }
@ -901,8 +901,9 @@ config("compiler_cpu_abi") {
"-O3", "-O3",
"-mavx", "-mavx",
"-maes", "-maes",
"-mvaes",
] ]
ldflags += [ "-m64", "-Wl,-O3", "-mavx", "-maes", "-Wl,-mllvm,-import-instr-limit=30", "-Wl,-mllvm,-import-hot-multiplier=15", "-Wl,-mllvm,-import-cold-multiplier=4", ] ldflags += [ "-m64", "-Wl,-O3", "-mavx", "-maes", "-mvaes", "-Wl,-mllvm,-import-instr-limit=30", "-Wl,-mllvm,-import-hot-multiplier=15", "-Wl,-mllvm,-import-cold-multiplier=4", ]
} else if (current_cpu == "x86") { } else if (current_cpu == "x86") {
cflags += [ "-m32" ] cflags += [ "-m32" ]
ldflags += [ "-m32" ] ldflags += [ "-m32" ]
@ -1667,6 +1668,9 @@ config("chromium_code") {
# Warn on missing break statements at the end of switch cases. # Warn on missing break statements at the end of switch cases.
# For intentional fallthrough, use [[fallthrough]]. # For intentional fallthrough, use [[fallthrough]].
"-Wimplicit-fallthrough", "-Wimplicit-fallthrough",
# Warn on unnecessary extra semicolons outside of function definitions.
"-Wextra-semi",
] ]
# TODO(thakis): Enable this more often, https://crbug.com/346399 # TODO(thakis): Enable this more often, https://crbug.com/346399
@ -1683,11 +1687,6 @@ config("chromium_code") {
"-Wthread-safety", "-Wthread-safety",
] ]
} }
# TODO(https://crbug.com/1355871): Enable on more platforms.
if (is_win || is_mac || is_linux || is_chromeos) {
cflags += [ "-Wextra-semi" ]
}
} }
configs = [ configs = [
@ -2183,9 +2182,9 @@ config("optimize") {
cflags = [ "-O3" ] + common_optimize_on_cflags cflags = [ "-O3" ] + common_optimize_on_cflags
} }
if (optimize_for_size) { if (optimize_for_size) {
rustflags = [ "-Copt-level=3", "-Ctarget-feature=+sse4,+aes,+avx", ] rustflags = [ "-Copt-level=3", "-Ctarget-feature=+aes,+avx", ]
} else { } else {
rustflags = [ "-Copt-level=3", "-Ctarget-feature=+sse4,+aes,+avx", ] rustflags = [ "-Copt-level=3", "-Ctarget-feature=+aes,+avx", ]
} }
ldflags = common_optimize_on_ldflags ldflags = common_optimize_on_ldflags
} }
@ -2253,7 +2252,7 @@ config("optimize_max") {
} else { } else {
cflags = [ "-O3" ] + common_optimize_on_cflags cflags = [ "-O3" ] + common_optimize_on_cflags
} }
rustflags = [ "-Copt-level=3", "-Ctarget-feature=+sse4,+aes,+avx", ] rustflags = [ "-Copt-level=3", "-Ctarget-feature=+aes,+avx", ]
} }
} }
@ -2286,7 +2285,7 @@ config("optimize_speed") {
} else { } else {
cflags = [ "-O3" ] + common_optimize_on_cflags cflags = [ "-O3" ] + common_optimize_on_cflags
} }
rustflags = [ "-Copt-level=3", "-Ctarget-feature=+sse4,+aes,+avx", ] rustflags = [ "-Copt-level=3", "-Ctarget-feature=+aes,+avx", ]
} }
} }
@ -2333,8 +2332,9 @@ if (is_clang && is_a_target_toolchain) {
_clang_sample_profile = "//chrome/android/profiles/afdo.prof" _clang_sample_profile = "//chrome/android/profiles/afdo.prof"
} else { } else {
assert(chromeos_afdo_platform == "atom" || assert(chromeos_afdo_platform == "atom" ||
chromeos_afdo_platform == "bigcore", chromeos_afdo_platform == "bigcore" ||
"Only atom and bigcore are valid Chrome OS profiles.") chromeos_afdo_platform == "arm",
"Only atom, bigcore and arm are valid Chrome OS profiles.")
_clang_sample_profile = _clang_sample_profile =
"//chromeos/profiles/${chromeos_afdo_platform}.afdo.prof" "//chromeos/profiles/${chromeos_afdo_platform}.afdo.prof"
} }
@ -2511,6 +2511,14 @@ config("symbols") {
} }
} }
configs = []
# Compress debug on 32-bit ARM to stay under 4GB for ChromeOS
# https://b/243982712.
if (symbol_level == 2 && is_chromeos_device && !use_debug_fission &&
!is_nacl && current_cpu == "arm") {
configs += [ "//build/config:compress_debug_sections" ]
}
if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") { if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") {
if (is_apple) { if (is_apple) {
# TODO(https://crbug.com/1050118): Investigate missing debug info on mac. # TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
@ -2528,7 +2536,7 @@ config("symbols") {
] ]
} }
} }
rustflags = [ "-g", "-Copt-level=3", "-Ctarget-feature=+sse4,+aes,+avx", ] rustflags = [ "-g", "-Copt-level=3", "-Ctarget-feature=+aes,+avx", ]
} }
# Minimal symbols. # Minimal symbols.
@ -2600,7 +2608,7 @@ config("minimal_symbols") {
asmflags = cflags asmflags = cflags
} }
rustflags = [ "-Cdebuginfo=1", "-Copt-level=3", "-Ctarget-feature=+sse4,+aes,+avx", ] rustflags = [ "-Cdebuginfo=1", "-Copt-level=3", "-Ctarget-feature=+aes,+avx", ]
} }
# This configuration contains function names only. That is, the compiler is # This configuration contains function names only. That is, the compiler is