summaryrefslogtreecommitdiffstats
path: root/chromium/build/config/compiler/BUILD.gn
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-09-07 13:12:05 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-11-09 10:02:59 +0000
commit33fc33aa94d4add0878ec30dc818e34e1dd3cc2a (patch)
treef6af110909c79b2759136554f1143d8b0572af0a /chromium/build/config/compiler/BUILD.gn
parent7d2c5d177e9813077a621df8d18c0deda73099b3 (diff)
BASELINE: Update Chromium to 104.0.5112.120
Change-Id: I5d2726c2ab018d75d055739b6ba64317904f05bb Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/438935 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/build/config/compiler/BUILD.gn')
-rw-r--r--chromium/build/config/compiler/BUILD.gn89
1 files changed, 44 insertions, 45 deletions
diff --git a/chromium/build/config/compiler/BUILD.gn b/chromium/build/config/compiler/BUILD.gn
index d40843b44f9..df8610696cc 100644
--- a/chromium/build/config/compiler/BUILD.gn
+++ b/chromium/build/config/compiler/BUILD.gn
@@ -646,19 +646,20 @@ config("compiler") {
if (!is_debug && use_thin_lto && is_a_target_toolchain) {
assert(use_lld, "LTO is only supported with lld")
- cflags += [ "-flto=thin" ]
- if (!is_apple) {
- # TODO(lgrey): Enable unit splitting for Mac when supported.
- cflags += [ "-fsplit-lto-unit" ]
- }
+ cflags += [
+ "-flto=thin",
+ "-fsplit-lto-unit",
+ ]
# Limit the size of the ThinLTO cache to the lesser of 10% of
# available disk space, 40GB and 100000 files.
cache_policy = "cache_size=10%:cache_size_bytes=40g:cache_size_files=100000"
+ # An import limit of 30 has better performance (per speedometer) and lower
+ # binary size than the default setting of 100.
# TODO(gbiv): We ideally shouldn't need to specify this; ThinLTO
# should be able to better manage binary size increases on its own.
- import_instr_limit = 5
+ import_instr_limit = 30
if (is_win) {
ldflags += [
@@ -681,9 +682,11 @@ config("compiler") {
# of "all" which means number of hardware threads) is faster.
ldflags += [ "-Wl,--thinlto-jobs=all" ]
if (is_apple) {
- ldflags +=
- [ "-Wl,-cache_path_lto," +
- rebase_path("$root_out_dir/thinlto-cache", root_build_dir) ]
+ ldflags += [
+ "-Wl,-cache_path_lto," +
+ rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
+ "-Wcrl,object_path_lto",
+ ]
} else {
ldflags +=
[ "-Wl,--thinlto-cache-dir=" +
@@ -693,21 +696,23 @@ config("compiler") {
ldflags += [ "-Wl,--thinlto-cache-policy=$cache_policy" ]
if (is_chromeos) {
- # Not much performance difference was noted between the default (100)
- # and these. ARM was originally set lower than x86 to keep the size
+ # ARM was originally set lower than x86 to keep the size
# bloat of ThinLTO to <10%, but that's potentially no longer true.
# FIXME(inglorion): maybe tune these?
if (target_cpu == "arm" || target_cpu == "arm64") {
import_instr_limit = 20
- } else {
- import_instr_limit = 30
}
+ } else if (is_android) {
+ # TODO(crbug.com/1308318): Investigate if we can get the > 6% perf win
+ # of import_instr_limit 30 with a binary size hit smaller than ~2 MiB.
+ import_instr_limit = 5
}
ldflags += [ "-Wl,-mllvm,-import-instr-limit=$import_instr_limit" ]
}
- # TODO(https://crbug.com/1211155): investigate why this isn't effective on arm32.
+ # TODO(https://crbug.com/1211155): investigate why this isn't effective on
+ # arm32.
if (!is_android || current_cpu == "arm64") {
cflags += [ "-fwhole-program-vtables" ]
if (!is_win) {
@@ -1533,14 +1538,11 @@ config("default_warnings") {
if (!is_nacl) {
# TODO(https://crbug.com/1300731) Clean up and enable.
cflags += [ "-Wno-unqualified-std-cast-call" ]
-
- # TODO(https://crbug.com/1314867): Clean up and enable.
- cflags += [ "-Wno-deprecated-non-prototype" ]
}
if (!is_nacl && !(is_chromeos ||
default_toolchain == "//build/toolchain/cros:target")) {
- # TODO(https://crbug.com/1316298): Re-enable once test failure is figured out
+ # TODO(https://crbug.com/1322823): Remove flags once potential miscompile is investigated.
cflags += [
"-Xclang",
"-no-opaque-pointers",
@@ -1583,22 +1585,21 @@ config("default_warnings") {
# configs += [ "//build/config/compiler:prevent_unsafe_narrowing" ]
config("prevent_unsafe_narrowing") {
- # TODO(crbug.com/1292951): Enable this config
- # if (is_clang) {
- # cflags = [
- # "-Wshorten-64-to-32",
- # "-Wimplicit-int-conversion",
- # "-Wsign-compare",
- # "-Wsign-conversion",
- # ]
- # if (!is_nacl) {
- # cflags += [
- # # Avoid bugs of the form `if (size_t i = size; i >= 0; --i)` while
- # # fixing types to be sign-correct.
- # "-Wtautological-unsigned-zero-compare",
- # ]
- # }
- # }
+ if (is_clang) {
+ cflags = [
+ "-Wshorten-64-to-32",
+ "-Wimplicit-int-conversion",
+ "-Wsign-compare",
+ "-Wsign-conversion",
+ ]
+ if (!is_nacl) {
+ cflags += [
+ # Avoid bugs of the form `if (size_t i = size; i >= 0; --i)` while
+ # fixing types to be sign-correct.
+ "-Wtautological-unsigned-zero-compare",
+ ]
+ }
+ }
}
# chromium_code ---------------------------------------------------------------
@@ -2317,19 +2318,17 @@ config("symbols") {
# version 7 also produces debug data that is incompatible with Breakpad
# dump_syms, so this is still required (https://crbug.com/622406).
cflags += [ "-fno-standalone-debug" ]
- } else if (is_mac && !use_dwarf5) {
- # clang defaults to DWARF2 on macOS unless mac_deployment_target is
- # at least 10.11.
- # TODO(thakis): Remove this once mac_deployment_target is 10.11.
- cflags += [ "-gdwarf-4" ]
- } else if (!use_dwarf5 && !is_nacl) {
- # Recent clang versions default to DWARF5 on Linux, and Android is about
- # to switch. TODO: Adopt that in controlled way.
- cflags += [ "-gdwarf-4" ]
}
- if (use_dwarf5 && !is_nacl) {
- cflags += [ "-gdwarf-5" ]
+ if (!is_nacl) {
+ if (use_dwarf5) {
+ cflags += [ "-gdwarf-5" ]
+ } else if (!is_apple) {
+ # Recent clang versions default to DWARF5 on Linux, and Android is about
+ # to switch. TODO: Adopt that in controlled way.
+ # Apple platforms still default to 4, so the flag is not needed there.
+ cflags += [ "-gdwarf-4" ]
+ }
}
# The gcc-based nacl compilers don't support -fdebug-compilation-dir (see