chromium-browser-stable-test/ROSA-allow-Gold-on-Linux.patch
Mikhail Novosyolov 9fa748bfef Extend the patch
2018-10-21 17:14:39 +03:00

57 lines
2.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. Trying to workaround 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 12:38:18.521273343 +0300
@@ -157,30 +157,6 @@
}
}
-declare_args() {
- # Set to true to use lld, the LLVM linker. This flag may be used on Windows,
- # Linux or Fuchsia.
- # 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 =
- is_clang &&
- (is_win || is_fuchsia || (use_thin_lto && target_os != "chromeos") ||
- (is_linux && current_cpu == "x64" && target_os != "chromeos") ||
- (is_android && (current_cpu != "arm" || arm_version >= 7) &&
- current_cpu != "mipsel" && current_cpu != "mips64el"))
-}
-
-declare_args() {
- # Whether to use the gold linker from binutils instead of lld or bfd.
- use_gold = !use_lld && !(is_chromecast && is_linux &&
- (current_cpu == "arm" || current_cpu == "mipsel")) &&
- ((is_linux && (current_cpu == "x64" || current_cpu == "x86" ||
- current_cpu == "arm" || current_cpu == "mipsel" ||
- current_cpu == "mips64el")) ||
- (is_android && (current_cpu == "x86" || current_cpu == "x64" ||
- current_cpu == "arm" || current_cpu == "arm64")))
-}
-
# If it wasn't manually set, set to an appropriate default.
assert(symbol_level >= -1 && symbol_level <= 2, "Invalid symbol_level")
if (symbol_level == -1) {