Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: build/config/compiler/BUILD.gn

Issue 2891843002: build: Remove build system support for gold plugin, except under ChromeOS. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/config/compiler/compiler.gni » ('j') | build/config/compiler/compiler.gni » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index e28e48d4aec90171032798060c398b80f8eab23f..7995ca60607c37b32602682217240bbf12dc8b8c 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -470,6 +470,8 @@ config("compiler") {
# TODO(pcc): Make this conditional on is_official_build rather than on gn
# flags for specific features.
if (!is_debug && (allow_posix_link_time_opt || is_cfi) && !is_nacl) {
+ assert(use_lld, "POSIX LTO requires LLD")
+
if (use_thin_lto) {
cflags += [ "-flto=thin" ]
ldflags += [ "-flto=thin" ]
@@ -477,26 +479,18 @@ config("compiler") {
# Limit the parallelism to avoid too agressive competition between
# linker jobs. This is still suboptimal to a potential dynamic
# resource allocation scheme, but should be good enough.
- if (use_lld) {
- ldflags += [
- "-Wl,--thinlto-jobs=8",
- "-Wl,--thinlto-cache-dir=" +
- rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
- ]
- } else {
- ldflags += [ "-Wl,-plugin-opt,jobs=8" ]
- }
+ ldflags += [
+ "-Wl,--thinlto-jobs=8",
+ "-Wl,--thinlto-cache-dir=" +
+ rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
+ ]
} else {
cflags += [ "-flto" ]
ldflags += [ "-flto" ]
# Apply a lower LTO optimization level as the default is too slow.
if (is_linux) {
- if (use_lld) {
- ldflags += [ "-Wl,--lto-O1" ]
- } else {
- ldflags += [ "-Wl,-plugin-opt,O1" ]
- }
+ ldflags += [ "-Wl,--lto-O1" ]
} else if (is_mac) {
ldflags += [ "-Wl,-mllvm,-O1" ]
}
@@ -515,17 +509,10 @@ config("compiler") {
# that is larger than the maximum call displacement, preventing the linker
# from relocating calls (http://llvm.org/PR22999).
if (is_linux) {
- if (use_lld) {
- ldflags += [
- "-Wl,-mllvm,-function-sections",
- "-Wl,-mllvm,-data-sections",
- ]
- } else {
- ldflags += [
- "-Wl,-plugin-opt,-function-sections",
- "-Wl,-plugin-opt,-data-sections",
- ]
- }
+ ldflags += [
+ "-Wl,-mllvm,-function-sections",
+ "-Wl,-mllvm,-data-sections",
+ ]
}
}
« no previous file with comments | « no previous file | build/config/compiler/compiler.gni » ('j') | build/config/compiler/compiler.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698