Commit b41471b2 authored by Nico Weber's avatar Nico Weber

chromeos: Require lld for thinlto builds.

As far as I know, chrome-for-chromeos no longer links with gold,
so we can clean up the code a bit here.

No intended behavior change.

Bug: none
Change-Id: Idc0ee540b2ec8031cf33e483e161c118bebb4035
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429442
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarGeorge Burgess <gbiv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810580}
parent b786bf5b
...@@ -602,8 +602,7 @@ config("compiler") { ...@@ -602,8 +602,7 @@ config("compiler") {
# TODO(pcc): Make this conditional on is_official_build rather than on gn # TODO(pcc): Make this conditional on is_official_build rather than on gn
# flags for specific features. # flags for specific features.
if (!is_debug && use_thin_lto && is_a_target_toolchain) { if (!is_debug && use_thin_lto && is_a_target_toolchain) {
assert(use_lld || target_os == "chromeos", assert(use_lld, "LTO is only supported with lld")
"gold plugin only supported with ChromeOS")
cflags += [ cflags += [
"-flto=thin", "-flto=thin",
...@@ -638,7 +637,6 @@ config("compiler") { ...@@ -638,7 +637,6 @@ config("compiler") {
# Limit the parallelism to avoid too aggressive competition between # Limit the parallelism to avoid too aggressive competition between
# linker jobs. This is still suboptimal to a potential dynamic # linker jobs. This is still suboptimal to a potential dynamic
# resource allocation scheme, but should be good enough. # resource allocation scheme, but should be good enough.
if (use_lld) {
ldflags += [ "-Wl,--thinlto-jobs=" + max_jobs_per_link ] ldflags += [ "-Wl,--thinlto-jobs=" + max_jobs_per_link ]
# Limit the size of the ThinLTO cache to the lesser of 10% of # Limit the size of the ThinLTO cache to the lesser of 10% of
...@@ -650,11 +648,7 @@ config("compiler") { ...@@ -650,11 +648,7 @@ config("compiler") {
rebase_path("$root_out_dir/thinlto-cache", root_build_dir), rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
"-Wl,--thinlto-cache-policy,$cache_policy", "-Wl,--thinlto-cache-policy,$cache_policy",
] ]
} else {
ldflags += [ "-Wl,-plugin-opt,jobs=" + max_jobs_per_link ]
}
if (use_lld) {
ldflags += [ "-Wl,--lto-O" + lto_opt_level ] ldflags += [ "-Wl,--lto-O" + lto_opt_level ]
if (thin_lto_enable_optimizations) { if (thin_lto_enable_optimizations) {
if (is_android) { if (is_android) {
...@@ -663,9 +657,6 @@ config("compiler") { ...@@ -663,9 +657,6 @@ config("compiler") {
ldflags += [ "-Wl,-mllvm,-import-instr-limit=5" ] ldflags += [ "-Wl,-mllvm,-import-instr-limit=5" ]
} }
} }
} else {
not_needed([ "lto_opt_level" ])
}
} }
# TODO(pcc): Re-enable this flag on Android. This will require libc++ to be # TODO(pcc): Re-enable this flag on Android. This will require libc++ to be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment