From e5b058a42aa0f7dd23a9c9aa9350afcba5a9ea58 Mon Sep 17 00:00:00 2001 From: brave-builds Date: Mon, 28 Mar 2022 20:35:32 +0000 Subject: [PATCH] Uplift of #12774 (squashed) to beta --- build/commands/lib/config.js | 6 ++---- build/rust/config.gni | 2 +- ios/BUILD.gn | 5 +++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/commands/lib/config.js b/build/commands/lib/config.js index 70c9b0928854..e68ff28acf22 100755 --- a/build/commands/lib/config.js +++ b/build/commands/lib/config.js @@ -470,9 +470,7 @@ Config.prototype.buildArgs = function () { args.target_environment = this.targetEnvironment } args.enable_dsyms = true - args.enable_stripping = !this.isDebug() - args.use_clang_coverage = false - args.use_lld = false + args.enable_stripping = !this.isComponentBuild() // Component builds are not supported for iOS: // https://chromium.googlesource.com/chromium/src/+/master/docs/component_build.md args.is_component_build = false @@ -481,7 +479,7 @@ Config.prototype.buildArgs = function () { // DCHECK's crash on Static builds without allowing the debugger to continue // Can be removed when approprioate DCHECK's have been fixed: // https://github.com/brave/brave-browser/issues/10334 - args.dcheck_always_on = this.isDebug() + args.dcheck_always_on = this.isComponentBuild() args.ios_enable_content_widget_extension = false args.ios_enable_search_widget_extension = false diff --git a/build/rust/config.gni b/build/rust/config.gni index 4935d0734cb1..a8a3d7b7228c 100644 --- a/build/rust/config.gni +++ b/build/rust/config.gni @@ -47,7 +47,7 @@ if (use_lto_in_rustc_linking) { rustflags += [ "-Clinker-plugin-lto" ] } -if (!is_ios && !is_debug) { +if (use_lld && !is_debug) { rustflags += [ "-Cembed-bitcode=yes" ] rustflags += [ "-Clto" ] } diff --git a/ios/BUILD.gn b/ios/BUILD.gn index 3ef7b4a242ef..3fc673e425be 100644 --- a/ios/BUILD.gn +++ b/ios/BUILD.gn @@ -13,6 +13,11 @@ import("//brave/ios/browser/api/url/headers.gni") import("//build/config/compiler/compiler.gni") import("//build/config/ios/rules.gni") +# lld is required when building arm64 with optimization in order to avoid +# runtime crashes +assert(is_debug || current_cpu != "arm64" || use_lld, + "Optimized arm64 iOS builds require lld") + config("internal_config") { visibility = [ ":*" ] ldflags =