summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/clang/TARGET_x86.mk10
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) \