From 064f9092289bdce50105d881bff5394ed4734bc2 Mon Sep 17 00:00:00 2001 From: Alexander David Frick Date: Thu, 21 Jul 2022 05:57:56 -0500 Subject: [PATCH] Update BUILD.gn --- src/chrome/BUILD.gn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/chrome/BUILD.gn b/src/chrome/BUILD.gn index 04ec4788..e0116aa4 100644 --- a/src/chrome/BUILD.gn +++ b/src/chrome/BUILD.gn @@ -113,6 +113,16 @@ group("assert_no_deps") { assert_no_deps = [ "//chrome/installer/util:strings" ] } +config("disable_thinlto_cache_flags") { + if (is_linux && use_thin_lto) { + # This build target has so many inputs that LLD will run into the default + # vm.max_map_count limit of 65530 memory mappings when using the ThinLTO + # cache. + # TODO (crbug.com/1183211): Re-enable once the linker has been fixed. + ldflags = [ "-Wl,--thinlto-cache-dir=" ] + } +} + if (!is_android && !is_mac) { group("chrome") { public_deps = [ ":chrome_initial" ] @@ -135,6 +145,11 @@ if (!is_android && !is_mac) { executable("chrome_initial") { configs -= [ "//build/config/compiler:thinlto_optimize_default" ] configs += [ "//build/config/compiler:thinlto_optimize_max" ] + + # TODO (crbug.com/1345158): Re-enable once the linker has been fixed or + # the limit on the bots raised. + configs += [ ":disable_thinlto_cache_flags" ] + if (is_win) { output_name = "initialexe/thorium" } else {