fuchsia: Switch to lld and raise default stack size

The default stack size is 80k, which is too small for the ample girth of
Chrome. Switch to lld on Fuchsia to gain support for -z stack-size, and
then set the default stack size to 8M.

(lld was also recommended by the Fuchsia team, there's no particular
reason that I used gold originally.)

This fixes JSONReaderTest.Reading. In the stack overflow guard test, 200
deep is allowed, but the default stack size is too small to allow that
to succeed.

Bug: 706592
Change-Id: I83b9675cb795b13c028bcda31dbe81d574723210
Reviewed-on: https://chromium-review.googlesource.com/535875
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#479552}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 79a2810929d1e113f711a933fe4886c84fd34244
This commit is contained in:
Scott Graham 2017-06-14 13:47:42 -07:00 коммит произвёл Commit Bot
Родитель 6888c3a12f
Коммит 6275c853aa
3 изменённых файлов: 14 добавлений и 8 удалений

Просмотреть файл

@ -122,13 +122,12 @@ declare_args() {
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")) ||
(is_android && (current_cpu == "x86" || current_cpu == "x64" ||
current_cpu == "arm" || current_cpu == "arm64")) ||
is_fuchsia)
(!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"))) ||
(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.

Просмотреть файл

@ -32,6 +32,13 @@ config("compiler") {
rebase_path(fuchsia_sdk, root_build_dir) + "/toolchain_libs/clang/5.0.0",
]
ldflags += [
# The stack defaults to 80k on Fuchsia, but on other platforms it's much
# higher, so a variety of code assumes more will be available. Raise to 8M
# which matches e.g. macOS.
"-Wl,-z,stack-size=0x800000",
]
libs = [
"mxio",
"magenta",

Просмотреть файл

@ -63,7 +63,7 @@ declare_args() {
# Set to true to use lld, the LLVM linker. This flag may be used on Windows
# or Linux.
use_lld = (is_win && host_os != "win") ||
use_lld = (is_win && host_os != "win") || is_fuchsia ||
(allow_posix_link_time_opt && target_os == "linux" &&
!is_chromeos && target_cpu == "x64")
}