diff options
author | Chih-Hung Hsieh <chh@google.com> | 2015-02-24 16:06:15 -0800 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2015-03-02 16:50:39 -0800 |
commit | 73e734bea5e84b712b4ced2bedbcf2e51c4a2fd4 (patch) | |
tree | eb9eb44337d9496f55dd01c86d5e91fbd137e6be | |
parent | 4eec22a6627927aaa11a67e3e18d36534af81856 (diff) | |
download | build-73e734bea5e84b712b4ced2bedbcf2e51c4a2fd4.zip build-73e734bea5e84b712b4ced2bedbcf2e51c4a2fd4.tar.gz build-73e734bea5e84b712b4ced2bedbcf2e51c4a2fd4.tar.bz2 |
Disable tail call optimization and use -mstackrealign to boot up on fugu.
http://llvm.org/bugs/show_bug.cgi?id=15086,
llvm tail call optimization is wrong for x86.
For Android/x86 to use SSE* instructions safely, stack should be 16-byte
aligned before JNI function call, which isn't true for all x86 device,
so -mstackrealign should be the default.
BUG: 19234330
Change-Id: I4c6676366788772dbe64fd7f0dd33b3ed5c9b80e
-rw-r--r-- | core/clang/TARGET_x86.mk | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/clang/TARGET_x86.mk b/core/clang/TARGET_x86.mk index a6b2a6f..3ba34ae 100644 --- a/core/clang/TARGET_x86.mk +++ b/core/clang/TARGET_x86.mk @@ -18,7 +18,15 @@ CLANG_CONFIG_x86_TARGET_EXTRA_CFLAGS := \ $(CLANG_CONFIG_EXTRA_CFLAGS) \ $(CLANG_CONFIG_TARGET_EXTRA_CFLAGS) \ $(CLANG_CONFIG_x86_EXTRA_CFLAGS) \ - $(CLANG_CONFIG_x86_TARGET_EXTRA_ASFLAGS) + $(CLANG_CONFIG_x86_TARGET_EXTRA_ASFLAGS) \ + -fno-optimize-sibling-calls \ + -mstackrealign + +# http://llvm.org/bugs/show_bug.cgi?id=15086, +# llvm tail call optimization is wrong for x86. +# -mstackrealign is needed to realign stack in native code +# that could be called from JNI, so that movaps instruction +# will work on assumed stack aligned local variables. CLANG_CONFIG_x86_TARGET_EXTRA_CONLYFLAGS := \ $(CLANG_CONFIG_EXTRA_CONLYFLAGS) \ |