Commit 4fd930e1 authored by Chris Palmer's avatar Chris Palmer Committed by Commit Bot

Turn on stack var initialization for more platforms.

Use Clang option -ftrivial-auto-var-init=pattern in production on more
platforms. Previously it was only enabled on Linux in production; now
it's on for all Desktop platforms.

This CL may reduce time efficiency and increase object code size. We
hope the effect is within an acceptable range, however. Notably, V8
opts out.

Bug: 977230
Change-Id: I785638c3a6d0d08c999031769ed9f858086515b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410588
Commit-Queue: Chris Palmer <palmer@chromium.org>
Reviewed-by: default avatarVitaly Buka <vitalybuka@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#810029}
parent 60b5469f
......@@ -120,13 +120,16 @@ declare_args() {
# Initialize all local variables with a pattern. This flag will fill
# uninitialized floating-point types (and 32-bit pointers) with 0xFF and the
# rest with 0xAA. This makes behavior of uninitialized memory bugs consistent,
# recognizeble in debugger, and crashes memory accesses by uninitialized
# pointers.
# TODO(vitalybuka):
# 'is_android' breaks content_shell_test_apk on android-kitkat-arm-rel.
# 'use_xcode_clang' may call old clang.
init_stack_vars = !is_android && !use_xcode_clang &&
(!is_official_build || is_linux || is_chromeos)
# recognizable in the debugger, and crashes on memory accesses through
# uninitialized pointers.
#
# TODO(crbug.com/977230): Enabling this when 'is_android' is true breaks
# content_shell_test_apk on android-kitkat-arm-rel. Enabling this when
# 'use_xcode_clang' is true may call an old clang that doesn't support
# auto-init.
init_stack_vars =
!(is_android && (target_cpu == "arm" || target_cpu == "arm64")) &&
!use_xcode_clang
# This argument is to control whether enabling text section splitting in the
# final binary. When enabled, the separated text sections with prefix
......
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