From 00694c59c4699ed71d207280f92a22e0322265b4 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Sun, 14 Jul 2019 22:15:56 +0200 Subject: [PATCH] [llvm] avoid FP elimination on iOS/armv7 (mono/mono#15617) [llvm] avoid FP elimination on iOS/armv7 Instead of ``` push {r4, r5, r6, r7, r10, r11, lr} ``` LLVM will generate ``` push {r4, r5, r6, r7, lr} add r7, sp, mono/mono#12 push {r9, r10} ``` Seems like this https://github.com/mono/llvm/commit/mono/mono@a04e9e4a0af16f15ace258e81448b7eeca5ff599 assumes that `-disable-fp-elim` is passed for iOS targets. I wondered why this wouldn't break things for them, but when you run `clang` from Xcode with `-v`, you will discover that its driver passes `-mdisable-fp-elim`. Together with https://github.com/mono/llvm/pull/48 this fixes crashes with FullAOT+LLVM on iOS 32bit. Fixes https://github.com/mono/mono/issues/15058 Contributes to https://github.com/mono/mono/issues/9621 Commit migrated from https://github.com/mono/mono/commit/9a19bdb6e63590875e9ac80496720dd365611754 --- src/mono/mono/mini/aot-compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index d6d49c5..0d4b2e2 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -1125,7 +1125,7 @@ arch_init (MonoAotCompile *acfg) if (acfg->aot_opts.mtriple && strstr (acfg->aot_opts.mtriple, "ios")) { g_string_append (acfg->llc_args, " -mattr=+v7"); - g_string_append (acfg->llc_args, " -exception-model=dwarf"); + g_string_append (acfg->llc_args, " -exception-model=dwarf -disable-fp-elim"); } #if defined(ARM_FPU_VFP_HARD) -- 2.7.4