Merge pull request #1763 from JetBrains/empty_appdomainsetup_configurationfile
[mono.git] / mono / mini / driver.c
index 4be4026aadeed22ca9f8c3c0efef8193364e7e67..674bb57429ef8bb7f1b00f347f40f5e79eee6e02 100644 (file)
@@ -331,9 +331,7 @@ opt_sets [] = {
        MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_EXCEPTION,
        MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_EXCEPTION | MONO_OPT_CMOV,
        MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_EXCEPTION | MONO_OPT_ABCREM,
-       MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_EXCEPTION | MONO_OPT_ABCREM | MONO_OPT_SSAPRE,
        MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_ABCREM,
-       MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_SSAPRE,
        MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_ABCREM | MONO_OPT_SHARED,
        DEFAULT_OPTIMIZATIONS, 
 };
@@ -1779,16 +1777,8 @@ mono_main (int argc, char* argv[])
                } else if (strcmp (argv [i], "--inside-mdb") == 0) {
                        action = DO_DEBUGGER;
                } else if (strncmp (argv [i], "--wapi=", 7) == 0) {
-                       if (strcmp (argv [i] + 7, "hps") == 0) {
-                               return mini_wapi_hps (argc - i, argv + i);
-                       } else if (strcmp (argv [i] + 7, "semdel") == 0) {
-                               return mini_wapi_semdel (argc - i, argv + i);
-                       } else if (strcmp (argv [i] + 7, "seminfo") == 0) {
-                               return mini_wapi_seminfo (argc - i, argv + i);
-                       } else {
-                               fprintf (stderr, "Invalid --wapi suboption: '%s'\n", argv [i]);
-                               return 1;
-                       }
+                       fprintf (stderr, "--wapi= option no longer supported\n.");
+                       return 1;
                } else if (strcmp (argv [i], "--no-x86-stack-align") == 0) {
                        mono_do_x86_stack_align = FALSE;
 #ifdef MONO_JIT_INFO_TABLE_TEST
@@ -1860,8 +1850,11 @@ mono_main (int argc, char* argv[])
                   fprintf (stderr, "This mono runtime is compiled for cross-compiling. Only the --aot option is supported.\n");
                   exit (1);
        }
-#if SIZEOF_VOID_P == 8 && defined(TARGET_ARM)
-       fprintf (stderr, "Can't cross-compile on 64 bit platforms to arm.\n");
+#if SIZEOF_VOID_P == 8 && (defined(TARGET_ARM) || defined(TARGET_X86))
+       fprintf (stderr, "Can't cross-compile on 64-bit platforms to 32-bit architecture.\n");
+       exit (1);
+#elif SIZEOF_VOID_P == 4 && (defined(TARGET_ARM64) || defined(TARGET_AMD64))
+       fprintf (stderr, "Can't cross-compile on 32-bit platforms to 64-bit architecture.\n");
        exit (1);
 #endif
 #endif
@@ -1872,6 +1865,9 @@ mono_main (int argc, char* argv[])
 
        mono_counters_init ();
 
+       /* Set rootdir before loading config */
+       mono_set_rootdir ();
+
        if (enable_profile)
                mono_profiler_load (profile_options);
 
@@ -1906,9 +1902,6 @@ mono_main (int argc, char* argv[])
                mono_load_coree (argv [i]);
 #endif
 
-       /* Set rootdir before loading config */
-       mono_set_rootdir ();
-
        /* Parse gac loading options before loading assemblies. */
        if (mono_compile_aot || action == DO_EXEC || action == DO_DEBUGGER) {
                mono_config_parse (config_file);