Skip to content

Commit

Permalink
Merge pull request #12786 from brave/pr12774_ios-runtime-crash-lld_1.…
Browse files Browse the repository at this point in the history
…38.x

[iOS] Use lld when compiling iOS, fixing a crash on release builds (uplift to 1.38.x)
  • Loading branch information
kjozwiak authored Mar 29, 2022
2 parents 0ba6010 + e5b058a commit a18d95f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 2 additions & 4 deletions build/commands/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/rust/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
Expand Down
5 changes: 5 additions & 0 deletions ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit a18d95f

Please sign in to comment.