mirror of
https://abf.rosa.ru/djam/chromium-browser-stable-test.git
synced 2025-02-24 10:02:47 +00:00
32 lines
1.7 KiB
Diff
32 lines
1.7 KiB
Diff
This patch allows us to use LLVM's gold linker on Linux.
|
|
|
|
This patch partly reverts https://chromium.googlesource.com/chromium/src.git/+/0f268cb3af337cf608bd1902148a84195837ad1b%5E%21/
|
|
Also see https://bugs.chromium.org/p/chromium/issues/detail?id=607968 around comment №100.
|
|
I did not understand why the gold linker was disallowed on Linux, it was allowed beforehand.
|
|
|
|
After commit https://chromium.googlesource.com/chromium/src/+/dd160677bc6cd8a5ab468c187f61902a8fbf4b41%5E%21
|
|
use_lld was forced to True on x86_64 even if use_gold was True. On i586 gold was used correctly. Fixing it.
|
|
|
|
Author: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
|
|
--- a/build/config/compiler/BUILD.gn 2018-10-20 12:45:09.760295019 +0300
|
|
+++ b/build/config/compiler/BUILD.gn 2018-10-20 12:51:07.536125696 +0300
|
|
@@ -588,8 +588,7 @@
|
|
# TODO(pcc): Make this conditional on is_official_build rather than on gn
|
|
# flags for specific features.
|
|
if (!is_debug && use_thin_lto && current_toolchain == default_toolchain) {
|
|
- assert(use_lld || target_os == "chromeos",
|
|
- "gold plugin only supported with ChromeOS")
|
|
+ assert(use_lld, "gold plugin cannot be used with lld linker")
|
|
|
|
cflags += [ "-flto=thin" ]
|
|
|
|
--- a/build/config/compiler/compiler.gni 2018-10-21 02:15:50.290369454 +0300
|
|
+++ b/build/config/compiler/compiler.gni 2018-10-21 02:20:51.670476348 +0300
|
|
@@ -163,6 +163,7 @@
|
|
# TODO(pcc): Enable lld on more architectures on Linux. E.g. we probably need
|
|
# to fix some of crbug.com/742655 to enable it on ARM.
|
|
use_lld =
|
|
+ !use_gold &&
|
|
is_clang &&
|
|
(is_win || is_fuchsia || (use_thin_lto && target_os != "chromeos") ||
|
|
(is_linux && current_cpu == "x64" && target_os != "chromeos") ||
|