diff options
author | Bernhard Urban-Forster <lewurm@gmail.com> | 2019-11-27 19:36:03 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-11-27 19:36:03 +0300 |
commit | 4c595069e72e6dc39e13c1e322087a502ea000c9 (patch) | |
tree | b06c473e6f2c9449c697bb4236d92c4c6fe261cf | |
parent | 9dfeb545d5080192c2b1a7bcf1f87fd05e9c5375 (diff) |
[arm] if mtriple is provided, do not set -march (#17937)
[arm] if mtriple is provided, do not set -march
E.g. when passing `-march=arm -mtriple=armv7s-ios`, `-march` will win and thus ignore `armv7s`.
Fixes https://github.com/mono/mono/issues/17931
* Caused by 5e318afd2e1d5f9ef0fd692abbceadcf615389a5
* Related with 4cd506823079bc15c9ee72da4f94a653f237a5e5
* Almost fixed by e431093f73360b5726e5256fd0de3108ec21b38a
Hopefully we are done with it.
-rw-r--r-- | mono/mini/aot-compiler.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index e051b84c6bb..eb665b4cd95 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -1136,12 +1136,15 @@ arch_init (MonoAotCompile *acfg) if (acfg->aot_opts.mtriple && strstr (acfg->aot_opts.mtriple, "darwin")) { g_string_append (acfg->llc_args, "-mattr=+v6"); } else { - if (!(acfg->aot_opts.mtriple && strstr (acfg->aot_opts.mtriple, "thumb"))) + if (!acfg->aot_opts.mtriple) { g_string_append (acfg->llc_args, " -march=arm"); + } else { + /* arch will be defined via mtriple, e.g. armv7s-ios or thumb. */ - 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 -disable-fp-elim"); + if (strstr (acfg->aot_opts.mtriple, "ios")) { + g_string_append (acfg->llc_args, " -mattr=+v7"); + g_string_append (acfg->llc_args, " -exception-model=dwarf -disable-fp-elim"); + } } #if defined(ARM_FPU_VFP_HARD) |