0

[Linux] Turn off -mstackrealign for breakpad in ia32.

There's a clang bug which causes crashes of syscalls which use many
registers for argument passing in ia32 architecture.
https://llvm.org/bugs/show_bug.cgi?id=16830

BUG=556393

Review URL: https://codereview.chromium.org/1473203002

Cr-Commit-Position: refs/heads/master@{#365770}
This commit is contained in:
ljagielski
2015-12-16 23:04:29 -08:00
committed by Commit bot
parent 8430ab46ca
commit 176ff2c7a3
4 changed files with 45 additions and 0 deletions
breakpad
components
crash.gypi
crash
content

@@ -554,6 +554,13 @@ if (is_linux || is_android) {
cflags = [ "-marm" ] cflags = [ "-marm" ]
} }
if (current_cpu == "x86" && is_clang) {
# Clang's -mstackrealign doesn't work well with
# linux_syscall_support.h hand written asm syscalls.
# See https://crbug.com/556393
cflags -= [ "-mstackrealign" ]
}
if (is_android) { if (is_android) {
sources += [ "src/common/android/breakpad_getcontext.S" ] sources += [ "src/common/android/breakpad_getcontext.S" ]
} }
@@ -659,6 +666,13 @@ if (is_linux || is_android) {
libs = [ "log" ] libs = [ "log" ]
include_dirs += [ "src/common/android/include" ] include_dirs += [ "src/common/android/include" ]
} }
if (current_cpu == "x86" && is_clang) {
# Clang's -mstackrealign doesn't work well with
# linux_syscall_support.h hand written asm syscalls.
# See https://crbug.com/556393
cflags -= [ "-mstackrealign" ]
}
} }
executable("linux_dumper_unittest_helper") { executable("linux_dumper_unittest_helper") {

@@ -594,6 +594,14 @@
], ],
}, },
}], }],
['clang==1 and target_arch=="ia32"', {
'cflags!': [
# Clang's -mstackrealign doesn't work well with
# linux_syscall_support.h hand written asm syscalls.
# See https://crbug.com/556393
'-mstackrealign',
],
}],
], ],
'include_dirs': [ 'include_dirs': [
@@ -703,6 +711,14 @@
}, },
'includes': [ '../build/android/test_runner.gypi' ], 'includes': [ '../build/android/test_runner.gypi' ],
}], }],
['clang==1 and target_arch=="ia32"', {
'cflags!': [
# Clang's -mstackrealign doesn't work well with
# linux_syscall_support.h hand written asm syscalls.
# See https://crbug.com/556393
'-mstackrealign',
],
}],
], ],
}, },
{ {

@@ -158,6 +158,14 @@
'../breakpad/src', '../breakpad/src',
], ],
}], }],
['clang==1 and target_arch=="ia32"', {
'cflags!': [
# Clang's -mstackrealign doesn't work well with
# linux_syscall_support.h hand written asm syscalls.
# See https://crbug.com/556393
'-mstackrealign',
],
}],
], ],
'target_conditions': [ 'target_conditions': [
# Need 'target_conditions' to override default filename_rules to include # Need 'target_conditions' to override default filename_rules to include

@@ -114,6 +114,13 @@ source_set("app_non_mac_win") {
defines += [ "CHROME_BUILD_ID=\"$android_chrome_build_id\"" ] defines += [ "CHROME_BUILD_ID=\"$android_chrome_build_id\"" ]
} }
if (current_cpu == "x86" && is_clang) {
# Clang's -mstackrealign doesn't work well with
# linux_syscall_support.h hand written asm syscalls.
# See https://crbug.com/556393
cflags -= [ "-mstackrealign" ]
}
if (is_win) { if (is_win) {
deps += [ deps += [
"//breakpad:breakpad_handler", "//breakpad:breakpad_handler",