[mono][aot] Pass the correct mtriple= argument to llc on android. (#53576)
authorZoltan Varga <vargaz@gmail.com>
Wed, 2 Jun 2021 13:21:20 +0000 (09:21 -0400)
committerGitHub <noreply@github.com>
Wed, 2 Jun 2021 13:21:20 +0000 (09:21 -0400)
src/mono/mono/mini/aot-compiler.c

index 6fde9c65e3f192ac92c5e06f420ab13e0068f740..a64fa4959dbf064aa6fc7f452eae71eb30284b21 100644 (file)
@@ -1114,15 +1114,17 @@ arch_init (MonoAotCompile *acfg)
        acfg->llvm_label_prefix = "";
        acfg->user_symbol_prefix = "";
 
-#if TARGET_X86 || TARGET_AMD64
-       const gboolean has_custom_args = !!acfg->aot_opts.llvm_llc || acfg->aot_opts.use_current_cpu;
-#endif
-
 #if defined(TARGET_X86)
+#ifdef TARGET_ANDROID
+       g_string_append_printf (acfg->llc_args, " -mtriple=i686-none-linux-android21");
+#else
+       const gboolean has_custom_args = !!acfg->aot_opts.llvm_llc || acfg->aot_opts.use_current_cpu;
        g_string_append_printf (acfg->llc_args, " -march=x86 %s", has_custom_args ? "" : "-mcpu=generic");
 #endif
+#endif
 
 #if defined(TARGET_AMD64)
+       const gboolean has_custom_args = !!acfg->aot_opts.llvm_llc || acfg->aot_opts.use_current_cpu;
        g_string_append_printf (acfg->llc_args, " -march=x86-64 %s", has_custom_args ? "" : "-mcpu=generic");
        /* NOP */
        acfg->align_pad_value = 0x90;