From 19fa221a338ba68c54729ea5062552a5ea3d9106 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 11 Mar 2020 14:43:19 -0400 Subject: [PATCH] Avoid passing /features:peverify-compat to csc, it generates very inefficient code in some cases. (#19144) See https://github.com/mono/mono/issues/18572#issuecomment-595924767. Fixes https://github.com/mono/mono/issues/18572. Disable the IL verifier for now, it can't handle code compiled without /features:peverify-compat. --- mcs/build/config-default.make | 3 +-- mono/metadata/verify.c | 4 ++++ runtime/Makefile.am | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mcs/build/config-default.make b/mcs/build/config-default.make index 11b1b354564..da3ede120a9 100644 --- a/mcs/build/config-default.make +++ b/mcs/build/config-default.make @@ -19,8 +19,7 @@ endif TEST_HARNESS = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/$(PARENT_PROFILE)nunit-lite-console.exe PLATFORM_DEBUG_FLAGS = /debug:portable -# Workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=59967 -MCS_FLAGS = /features:peverify-compat /langversion:latest +MCS_FLAGS = /langversion:latest LIBRARY_FLAGS = ifndef CFLAGS CFLAGS = -g -O2 diff --git a/mono/metadata/verify.c b/mono/metadata/verify.c index ca70680463d..0214e6f458a 100644 --- a/mono/metadata/verify.c +++ b/mono/metadata/verify.c @@ -4925,6 +4925,10 @@ mono_method_verify (MonoMethod *method, int level) return NULL; } + // Disable for now + if (TRUE) + return NULL; + memset (&ctx, 0, sizeof (VerifyContext)); //FIXME use mono_method_get_signature_full diff --git a/runtime/Makefile.am b/runtime/Makefile.am index d88454a1faf..9e29cb58e33 100644 --- a/runtime/Makefile.am +++ b/runtime/Makefile.am @@ -195,7 +195,7 @@ PLATFORM_PATH_SEPARATOR = : endif # assemblies which are excluded from testing in mcs-compileall below -VERIFY_TESTS_FILTER = System.Runtime.CompilerServices.Unsafe.dll +VERIFY_TESTS_FILTER = System.Runtime.CompilerServices.Unsafe.dll nunitlite.dll if HOST_WIN32 # Mono.WebBrowser.dll fails to verify on Windows -- 2.11.4.GIT