From 8c035c21449e2abdae8b4ae5e94cba61e32307bb Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Wed, 7 Aug 2019 14:16:22 -0500 Subject: [PATCH 01/57] Pull in the unbroken msbuild --- packaging/MacSDK/msbuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/MacSDK/msbuild.py b/packaging/MacSDK/msbuild.py index 1ddb60eb06ec..fd005687fff6 100644 --- a/packaging/MacSDK/msbuild.py +++ b/packaging/MacSDK/msbuild.py @@ -3,7 +3,7 @@ class MSBuild (GitHubPackage): def __init__ (self): GitHubPackage.__init__ (self, 'mono', 'msbuild', '15', # note: fix scripts/ci/run-test-mac-sdk.sh when bumping the version number - revision = 'cd5b32d36ad51cb5c21621bb5cfe6a7452214eaa') + revision = '095258fa3977e056c15bcc9a2d6920eb4793eafa') def build (self): self.sh ('./eng/cibuild_bootstrapped_msbuild.sh --host_type mono --configuration Release --skip_tests') From 5d9caa237340433e48e958f44fa89626c1fb9957 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 8 Aug 2019 14:07:00 -0400 Subject: [PATCH 02/57] [msbuild] Bump to track mono-2019-06 and update roslyn (#16095) Prompted by mono/msbuild#123 : This includes: Update to upstream vs16.3 branch SDK update to track dotnet release/3.0.100-preview8 Roslyn updated to 3.3.0-beta2-19381-14 * Work around remoting1.exe test issue with new Roslyn --- configure.ac | 4 ++-- external/roslyn-binaries | 2 +- mcs/packages/Makefile | 1 + mono/tests/remoting1.cs | 3 ++- packaging/MacSDK/msbuild.py | 10 ++++++---- scripts/ci/run-test-mac-sdk.sh | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 14b2845b6737..81b51649c4b7 100644 --- a/configure.ac +++ b/configure.ac @@ -5867,8 +5867,8 @@ fi AC_SUBST(mono_runtime) AC_SUBST(mono_runtime_wrapper) -CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.1.0-release/csc.exe -VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.1.0-release/VBCSCompiler.exe +CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.0/csc.exe +VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.0/VBCSCompiler.exe if test $csc_compiler = mcs; then CSC=$mcs_topdir/class/lib/build/mcs.exe diff --git a/external/roslyn-binaries b/external/roslyn-binaries index 38979ff88718..17479f963650 160000 --- a/external/roslyn-binaries +++ b/external/roslyn-binaries @@ -1 +1 @@ -Subproject commit 38979ff887183033f12c9becfb42e5da820bc7fd +Subproject commit 17479f9636503a9e294ab952e7b1f437f925dec9 diff --git a/mcs/packages/Makefile b/mcs/packages/Makefile index 342cdc62df83..c1e6d3670907 100644 --- a/mcs/packages/Makefile +++ b/mcs/packages/Makefile @@ -30,6 +30,7 @@ ROSLYN_FILES_TO_COPY_FOR_MSBUILD = \ $(ROSLYN_CSC_DIR)/Microsoft.Build.Tasks.CodeAnalysis.dll \ $(ROSLYN_CSC_DIR)/Microsoft.CSharp.Core.targets \ $(ROSLYN_CSC_DIR)/Microsoft.Managed.Core.targets \ + $(ROSLYN_CSC_DIR)/Microsoft.Managed.EditorConfig.targets \ $(ROSLYN_CSC_DIR)/Microsoft.VisualBasic.Core.targets DISTFILES = $(ROSLYN_FILES_FOR_MONO) $(ROSLYN_FILES_TO_COPY_FOR_MSBUILD) csi-test.csx diff --git a/mono/tests/remoting1.cs b/mono/tests/remoting1.cs index ce9589469e1d..b562d6191912 100644 --- a/mono/tests/remoting1.cs +++ b/mono/tests/remoting1.cs @@ -170,7 +170,8 @@ static int Main () { o.test_field = 2; - Console.WriteLine ("test_field: " + o.test_field); + Console.WriteLine ("test_field: "); + Console.WriteLine (o.test_field); if (o.test_field != 2) return 9; diff --git a/packaging/MacSDK/msbuild.py b/packaging/MacSDK/msbuild.py index fd005687fff6..323102724707 100644 --- a/packaging/MacSDK/msbuild.py +++ b/packaging/MacSDK/msbuild.py @@ -3,14 +3,16 @@ class MSBuild (GitHubPackage): def __init__ (self): GitHubPackage.__init__ (self, 'mono', 'msbuild', '15', # note: fix scripts/ci/run-test-mac-sdk.sh when bumping the version number - revision = '095258fa3977e056c15bcc9a2d6920eb4793eafa') + revision = '4d92cbc5100f4d956cc31583f48fa149ea46c7d1') def build (self): - self.sh ('./eng/cibuild_bootstrapped_msbuild.sh --host_type mono --configuration Release --skip_tests') - self.sh ('find artifacts -wholename \'*/log/*\' -type f -exec zip msbuild-bin-logs.zip {} \+') + try: + self.sh ('./eng/cibuild_bootstrapped_msbuild.sh --host_type mono --configuration Release --skip_tests') + finally: + self.sh ('find artifacts stage1 -wholename \'*/log/*\' -type f -exec zip msbuild-bin-logs.zip {} \+') def install (self): # use the bootstrap msbuild as the system might not have one available! - self.sh ('./artifacts/mono-msbuild/msbuild mono/build/install.proj /p:MonoInstallPrefix=%s /p:Configuration=Release-MONO /p:IgnoreDiffFailure=true' % self.staged_prefix) + self.sh ('./stage1/mono-msbuild/msbuild mono/build/install.proj /p:MonoInstallPrefix=%s /p:Configuration=Release-MONO /p:IgnoreDiffFailure=true' % self.staged_prefix) MSBuild () diff --git a/scripts/ci/run-test-mac-sdk.sh b/scripts/ci/run-test-mac-sdk.sh index 11832420caa5..bf2e7159e749 100755 --- a/scripts/ci/run-test-mac-sdk.sh +++ b/scripts/ci/run-test-mac-sdk.sh @@ -8,7 +8,7 @@ export PATH=${MONO_REPO_ROOT}/external/bockbuild/stage/bin:$PATH # Bundled MSBuild cd ${MONO_REPO_ROOT}/external/bockbuild/builds/msbuild-15/ ${TESTCMD} --label="msbuild-tests" --timeout=180m ./eng/cibuild_bootstrapped_msbuild.sh --host_type mono --configuration Release -zip ${MONO_REPO_ROOT}/msbuild-test-results.zip artifacts/2/TestResults/Release-MONO/* artifacts/2/log/Release-MONO/*.log +zip ${MONO_REPO_ROOT}/msbuild-test-results.zip artifacts/TestResults/Release-MONO/* artifacts/log/Release-MONO/*.log # Bundled LLVM cd ${MONO_REPO_ROOT}/external/bockbuild/builds/mono From 893099f23fdf3881d502f000c3a7942f7f04a802 Mon Sep 17 00:00:00 2001 From: Alexis Christoforides Date: Fri, 9 Aug 2019 01:38:29 +0300 Subject: [PATCH 03/57] =?UTF-8?q?[2019-06]=20[System]=20Guard=20against=20?= =?UTF-8?q?attempting=20to=20creating=20out-of-range=20spans=20in=20m?= =?UTF-8?q?=E2=80=A6=20(#16123)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [System] Guard against attempting to creating out-of-range spans in macOS FileSystemWatcher Backport of #16049 --- external/corefx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/corefx b/external/corefx index e4f7102bf749..82278441c834 160000 --- a/external/corefx +++ b/external/corefx @@ -1 +1 @@ -Subproject commit e4f7102bf749ab5f2566e7b3e5d1de5f6331cede +Subproject commit 82278441c83490a0f0e8f2734b575d30586acf07 From 63d98369c6ccd62d473b0530e3249baca0e26151 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 9 Aug 2019 05:56:56 -0400 Subject: [PATCH 04/57] [2019-06] Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements. (#16108) * Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements. https://github.com/mono/mono/issues/16010 The current behavior for GetConstructorCandidates when the name is null, "", or "*" is to return the set of constructors for the type. For "", .NET Core and .NET Framework return 0 elements. This PR adds a check for "" to match that behavior. * Removed unncessary changes * Unnecessary spaces * Made the if check a bit more readable --- mcs/class/referencesource/mscorlib/system/rttype.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mcs/class/referencesource/mscorlib/system/rttype.cs b/mcs/class/referencesource/mscorlib/system/rttype.cs index a7122e56661c..2a97f57ec17d 100644 --- a/mcs/class/referencesource/mscorlib/system/rttype.cs +++ b/mcs/class/referencesource/mscorlib/system/rttype.cs @@ -2858,17 +2858,24 @@ private ListBuilder GetMethodCandidates( return candidates; } + // Note the following assumptions on name: + // 1. Callers assume that null == "*" + // 2. FilterHelper chops off "*" + // private ListBuilder GetConstructorCandidates( string name, BindingFlags bindingAttr, CallingConventions callConv, Type[] types, bool allowPrefixLookup) { bool prefixLookup, ignoreCase; MemberListType listType; + RuntimeType.FilterHelper(bindingAttr, ref name, allowPrefixLookup, out prefixLookup, out ignoreCase, out listType); -#if MONO - if (!string.IsNullOrEmpty (name) && name != ConstructorInfo.ConstructorName && name != ConstructorInfo.TypeConstructorName) +#if MONO + if ((!prefixLookup && name?.Length == 0) || + (!string.IsNullOrEmpty (name) && name != ConstructorInfo.ConstructorName && name != ConstructorInfo.TypeConstructorName)) { return new ListBuilder (0); + } RuntimeConstructorInfo[] cache = GetConstructors_internal (bindingAttr, this); #else RuntimeConstructorInfo[] cache = Cache.GetConstructorList(listType, name); From 3c1ee41b121af9953801294d4b8425fb3eb27dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Ko=CC=88plinger?= Date: Fri, 9 Aug 2019 16:17:39 +0200 Subject: [PATCH 05/57] Bump corefx to get https://github.com/mono/corefx/pull/323 --- external/corefx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/corefx b/external/corefx index 82278441c834..8ae70a942f60 160000 --- a/external/corefx +++ b/external/corefx @@ -1 +1 @@ -Subproject commit 82278441c83490a0f0e8f2734b575d30586acf07 +Subproject commit 8ae70a942f606b73d0313a80cde1751f4541c2ae From 9e02c677aa49a0fce1fc8aa374a67634061e28c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Sat, 10 Aug 2019 16:20:04 +0200 Subject: [PATCH 06/57] Bump corefx to get https://github.com/mono/corefx/pull/327 --- external/corefx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/corefx b/external/corefx index 8ae70a942f60..7414448fa093 160000 --- a/external/corefx +++ b/external/corefx @@ -1 +1 @@ -Subproject commit 8ae70a942f606b73d0313a80cde1751f4541c2ae +Subproject commit 7414448fa093c50b73c66806f695230f7a142b71 From a7919897e8bc1268547d60ca2283e619a3b3cc45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Sat, 10 Aug 2019 23:47:19 +0200 Subject: [PATCH 07/57] Bump corefx to fix build break --- external/corefx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/corefx b/external/corefx index 7414448fa093..a01bab017064 160000 --- a/external/corefx +++ b/external/corefx @@ -1 +1 @@ -Subproject commit 7414448fa093c50b73c66806f695230f7a142b71 +Subproject commit a01bab017064f9983c3c93cffef0c8143267193e From 4365dce8b7dfdb42837bfd11bb61284b3477a45e Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 9 Aug 2019 14:08:25 -0400 Subject: [PATCH 08/57] [2019-06][sdk] Enable the SRE runtime code inside iOS builds This will allow the interpreter to use System.Reflection.Emit. Note: There is a small size increase (about 50kb) for an application built in release mode with the LLVM backend (even if the interpreter is now used). Backport of https://github.com/mono/mono/pull/16151 --- sdks/builds/ios.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/builds/ios.mk b/sdks/builds/ios.mk index 4f0f225d7328..7c9a66c25b1c 100644 --- a/sdks/builds/ios.mk +++ b/sdks/builds/ios.mk @@ -99,7 +99,7 @@ _ios-$(1)_CONFIGURE_FLAGS = \ --enable-dtrace=no \ --enable-icall-export \ --enable-maintainer-mode \ - --enable-minimal=ssa,com,interpreter,jit,reflection_emit_save,reflection_emit,portability,assembly_remapping,attach,verifier,full_messages,appdomains,security,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,remoting,shared_perfcounters \ + --enable-minimal=ssa,com,interpreter,jit,portability,assembly_remapping,attach,verifier,full_messages,appdomains,security,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,remoting,shared_perfcounters \ --enable-monotouch \ --with-lazy-gc-thread-creation=yes \ --with-tls=pthread \ From 4988ad56ad09f01baf903ff87fef8e3cb7d12494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 13 Aug 2019 12:12:22 +0200 Subject: [PATCH 09/57] [pkg] Bump libgdiplus to 6.0.2 (cherry picked from commit b60aaea7912839e5d343ad2bd3fde0a5c35704c1) --- packaging/MacSDK/libgdiplus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/MacSDK/libgdiplus.py b/packaging/MacSDK/libgdiplus.py index 86c3298c6f8d..40ef4fcb6aa9 100644 --- a/packaging/MacSDK/libgdiplus.py +++ b/packaging/MacSDK/libgdiplus.py @@ -1,8 +1,8 @@ GitHubTarballPackage( 'mono', 'libgdiplus', - '6.0.1', - '5bc2f73373cb879e1c78c91fe4bf63f3893f8714', + '6.0.2', + '35ae5341c2326c44e26058ca90b12303bb9b1da0', configure='CFLAGS="%{gcc_flags} %{local_gcc_flags} -I/opt/X11/include" ./autogen.sh --prefix="%{package_prefix}"', override_properties={ 'make': 'C_INCLUDE_PATH="" make'}) From 6c97670c2325eca19e18f3979817c13730bfd9a8 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 14 Aug 2019 06:32:00 -0400 Subject: [PATCH 10/57] [sre] Outline typebuilder_setup_fields loop body (#16203) The loop body uses coop handles, so wrap it in HANDLE_FUNCTION_ENTER/HANDLE_FUNCTION_RETURN Addresses part of #16179 Backport of #16184. --- mono/metadata/sre.c | 116 +++++++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/mono/metadata/sre.c b/mono/metadata/sre.c index 19a34cd850df..b64456e3a628 100644 --- a/mono/metadata/sre.c +++ b/mono/metadata/sre.c @@ -3585,18 +3585,77 @@ modulebuilder_get_next_table_index (MonoReflectionModuleBuilder *mb, gint32 tabl return index; } +static void +typebuilder_setup_one_field (MonoDynamicImage *dynamic_image, MonoClass *klass, int32_t first_idx, MonoArray *tb_fields, int i, MonoFieldDefaultValue *def_value_out, MonoError *error) +{ + HANDLE_FUNCTION_ENTER (); + { + MonoImage *image = klass->image; + MonoReflectionFieldBuilder *fb; + MonoClassField *field; + MonoArray *rva_data; + + fb = (MonoReflectionFieldBuilder *)mono_array_get_internal (tb_fields, gpointer, i); + field = &klass->fields [i]; + field->parent = klass; + field->name = string_to_utf8_image_raw (image, fb->name, error); /* FIXME use handles */ + goto_if_nok (error, leave); + if (fb->attrs) { + MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)fb->type, error); + goto_if_nok (error, leave); + field->type = mono_metadata_type_dup (klass->image, type); + field->type->attrs = fb->attrs; + } else { + field->type = mono_reflection_type_get_handle ((MonoReflectionType*)fb->type, error); + goto_if_nok (error, leave); + } + + if (!klass->enumtype && !mono_type_get_underlying_type (field->type)) { + mono_class_set_type_load_failure (klass, "Field '%s' is an enum type with a bad underlying type", field->name); + goto leave; + } + + if ((fb->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA) && (rva_data = fb->rva_data)) { + char *base = mono_array_addr_internal (rva_data, char, 0); + size_t size = mono_array_length_internal (rva_data); + char *data = (char *)mono_image_alloc (klass->image, size); + memcpy (data, base, size); + def_value_out->data = data; + } + if (fb->offset != -1) + field->offset = fb->offset; + fb->handle = field; + mono_save_custom_attrs (klass->image, field, fb->cattrs); + + if (fb->def_value) { + guint32 len, idx; + const char *p, *p2; + MonoDynamicImage *assembly = (MonoDynamicImage*)klass->image; + field->type->attrs |= FIELD_ATTRIBUTE_HAS_DEFAULT; + idx = mono_dynimage_encode_constant (assembly, fb->def_value, &def_value_out->def_type); + /* Copy the data from the blob since it might get realloc-ed */ + p = assembly->blob.data + idx; + len = mono_metadata_decode_blob_size (p, &p2); + len += p2 - p; + def_value_out->data = (const char *)mono_image_alloc (image, len); + memcpy ((gpointer)def_value_out->data, p, len); + } + + MonoObjectHandle field_builder_handle = MONO_HANDLE_CAST (MonoObject, MONO_HANDLE_NEW (MonoReflectionFieldBuilder, fb)); + mono_dynamic_image_register_token (dynamic_image, mono_metadata_make_token (MONO_TABLE_FIELD, first_idx + i), field_builder_handle, MONO_DYN_IMAGE_TOK_NEW); + } +leave: + HANDLE_FUNCTION_RETURN (); +} + /* This initializes the same data as mono_class_setup_fields () */ static void typebuilder_setup_fields (MonoClass *klass, MonoError *error) { MonoReflectionTypeBuilder *tb = mono_class_get_ref_info_raw (klass); /* FIXME use handles */ - MonoReflectionFieldBuilder *fb; - MonoClassField *field; MonoFieldDefaultValue *def_values; MonoImage *image = klass->image; - const char *p, *p2; int i, instance_size, packing_size = 0; - guint32 len, idx; error_init (error); @@ -3636,54 +3695,9 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error) klass->size_inited = 1; for (i = 0; i < fcount; ++i) { - MonoArray *rva_data; - fb = (MonoReflectionFieldBuilder *)mono_array_get_internal (tb->fields, gpointer, i); - field = &klass->fields [i]; - field->parent = klass; - field->name = string_to_utf8_image_raw (image, fb->name, error); /* FIXME use handles */ - if (!mono_error_ok (error)) + typebuilder_setup_one_field (tb->module->dynamic_image, klass, first_idx, tb->fields, i, &def_values[i], error); + if (!is_ok (error)) return; - if (fb->attrs) { - MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)fb->type, error); - return_if_nok (error); - field->type = mono_metadata_type_dup (klass->image, type); - field->type->attrs = fb->attrs; - } else { - field->type = mono_reflection_type_get_handle ((MonoReflectionType*)fb->type, error); - return_if_nok (error); - } - - if (!klass->enumtype && !mono_type_get_underlying_type (field->type)) { - mono_class_set_type_load_failure (klass, "Field '%s' is an enum type with a bad underlying type", field->name); - continue; - } - - if ((fb->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA) && (rva_data = fb->rva_data)) { - char *base = mono_array_addr_internal (rva_data, char, 0); - size_t size = mono_array_length_internal (rva_data); - char *data = (char *)mono_image_alloc (klass->image, size); - memcpy (data, base, size); - def_values [i].data = data; - } - if (fb->offset != -1) - field->offset = fb->offset; - fb->handle = field; - mono_save_custom_attrs (klass->image, field, fb->cattrs); - - if (fb->def_value) { - MonoDynamicImage *assembly = (MonoDynamicImage*)klass->image; - field->type->attrs |= FIELD_ATTRIBUTE_HAS_DEFAULT; - idx = mono_dynimage_encode_constant (assembly, fb->def_value, &def_values [i].def_type); - /* Copy the data from the blob since it might get realloc-ed */ - p = assembly->blob.data + idx; - len = mono_metadata_decode_blob_size (p, &p2); - len += p2 - p; - def_values [i].data = (const char *)mono_image_alloc (image, len); - memcpy ((gpointer)def_values [i].data, p, len); - } - - MonoObjectHandle field_builder_handle = MONO_HANDLE_CAST (MonoObject, MONO_HANDLE_NEW (MonoReflectionFieldBuilder, fb)); - mono_dynamic_image_register_token (tb->module->dynamic_image, mono_metadata_make_token (MONO_TABLE_FIELD, first_idx + i), field_builder_handle, MONO_DYN_IMAGE_TOK_NEW); } if (!mono_class_has_failure (klass)) From 4a85530472534be07b46f1cdfc8886e72ad47dd8 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 14 Aug 2019 13:24:21 -0400 Subject: [PATCH 11/57] (mono.1) Update the MONO_THREADS_SUSPEND description (#16238) --- man/mono.1 | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/man/mono.1 b/man/mono.1 index 37f786073c5f..25825b3c86e4 100644 --- a/man/mono.1 +++ b/man/mono.1 @@ -1179,23 +1179,26 @@ If set, tells mono to attempt using native asynchronous I/O services. If not set, a default select/poll implementation is used. Currently epoll and kqueue are supported. .TP -\fBMONO_THREADS_SUSPEND\fR -Selects a mechanism that Mono will use to suspend threads. May be set to -"preemptive", "coop", or "hybrid". Threads may need to be suspended by the -debugger, or using some .NET threading APIs, and most commonly when the SGen -garbage collector needs to stop all threads during a critical phase of garbage -collection. Preemptive mode is the mode that Mono has used historically, going -back to the Boehm days, where the garbage collector would run at any point and -suspend execution of all threads as required to perform a garbage collection. -The cooperative mode on the other hand requires the cooperation of all threads -to stop at a safe point. This makes for an easier to debug garbage collector. -As of Mono 4.3.0 it is a work in progress, and while it works, it has not been -used extensively. This option enables the feature and allows us to find spots -that need to be tuned for this mode of operation. Hybrid mode is a combination -of the two that retains better compatability with scenarios where Mono is -embedded in another application: threads that are running managed code or code -that comprises the Mono runtime will be cooperatively suspended, while threads -running embedder code will be preemptively suspended. +\fBMONO_THREADS_SUSPEND\fR Selects a mechanism that Mono will use to suspend +threads. May be set to "preemptive", "coop", or "hybrid". Threads may need to +be suspended by the debugger, or using some .NET threading APIs, and most +commonly when the SGen garbage collector needs to stop all threads during a +critical phase of garbage collection. Preemptive mode is the mode that Mono +has used historically, going back to the Boehm days, where the garbage +collector would run at any point and suspend execution of all threads as +required to perform a garbage collection. The cooperative mode on the other +hand requires the cooperation of all threads to stop at a safe point. This +makes for an easier to debug garbage collector and it improves the stability of +the runtime because threads are not suspended when accessing critical +resources. In scenarios where Mono is embedded in another application, +cooperative suspend requires the embedder code to follow coding guidelines in +order to cooperate with the garbage collector. Cooperative suspend in embedded +Mono is currently experimental. Hybrid mode is a combination of the two that +retains better compatability with scenarios where Mono is embedded in another +application: threads that are running managed code or code that comprises the +Mono runtime will be cooperatively suspended, while threads running embedder +code will be preemptively suspended. Hybrid suspend is the default on some +desktop platforms. Alternatively, coop and hybrid mode can be enabled at compile time by using the --enable-cooperative-suspend or --enable-hybrid-suspend flags, respectively, From e6d44f7ce45cc37293b19c9ee6da48a639cc44c8 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 16 Aug 2019 10:23:09 -0400 Subject: [PATCH 12/57] [2019-06] [corlib] Fix sharing mode validation rules (#16280) Fixes https://github.com/mono/mono/issues/16032 When we switched to corefx File.Copy on unix, the behavior changed where it opened a source and destination stream in order to pass the safe handles to Interop.Sys.CopyFile. This exposed a flaw in our sharing validation rules in MonoIO.Open, which threw an exception in this scenario: new FileStream("source.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite, 2048, FileOptions.DeleteOnClose); new FileStream("source.txt", FileMode.Open, FileAccess.Read, FileShare.Read, 2048, FileOptions.None); Simplified the FileShare check down to: 1. If the caller specifies FileShare.None, then it's an exclusive lock and no sharing is allowed. 2. If the caller specifies some other FileShare option, then FileShare.None cannot be specified. --- .../corlib/Test/System.IO/FileStreamTest.cs | 23 +++++++++++++++++++ mono/metadata/w32file-unix.c | 15 +----------- mono/metadata/w32file.h | 1 + 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/mcs/class/corlib/Test/System.IO/FileStreamTest.cs b/mcs/class/corlib/Test/System.IO/FileStreamTest.cs index be65417fb7db..3fa4a87e58fc 100644 --- a/mcs/class/corlib/Test/System.IO/FileStreamTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileStreamTest.cs @@ -1650,6 +1650,29 @@ public void DeleteOnClose () } + // See https://github.com/mono/mono/issues/16032 + [Test] + public void DeleteOnCloseWithFileCopy () + { + string source = TempFolder + DSC + "source.txt"; + string target = TempFolder + DSC + "target.txt"; + + File.WriteAllText (source, "text"); + FileStream fs = new FileStream (source, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite, 2048, + FileOptions.DeleteOnClose); + + Assert.AreEqual (true, File.Exists (source), "DCFC#1"); + + try { + File.Copy (fs.Name, target, true); + } finally { + fs.Dispose(); + } + + Assert.AreEqual (false, File.Exists (source), "DCFC#2"); + Assert.AreEqual (true, File.Exists (target), "DCFC#3"); + } + [Test] public void OpenCharDeviceRepeatedly () { diff --git a/mono/metadata/w32file-unix.c b/mono/metadata/w32file-unix.c index 184165554a9e..8cbb86307813 100644 --- a/mono/metadata/w32file-unix.c +++ b/mono/metadata/w32file-unix.c @@ -1851,7 +1851,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode, * when we looked it up, so be careful to put it back * if we conclude we can't use this file. */ - if (file_existing_share == 0) { + if ((file_existing_share == FILE_SHARE_NONE) || (sharemode == FILE_SHARE_NONE)) { /* Quick and easy, no possibility to share */ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: Share mode prevents open: requested access: 0x%" PRIx32 ", file has sharing = NONE", __func__, fileaccess); @@ -1873,19 +1873,6 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode, return(FALSE); } - - if (((file_existing_access & GENERIC_READ) && - !(sharemode & FILE_SHARE_READ)) || - ((file_existing_access & GENERIC_WRITE) && - !(sharemode & FILE_SHARE_WRITE))) { - /* New share mode doesn't match up */ - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: Access mode prevents open: requested share: 0x%" PRIx32 ", file has access: 0x%" PRIx32, __func__, sharemode, file_existing_access); - - file_share_release (*share_info); - *share_info = NULL; - - return(FALSE); - } } else { mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: New file!", __func__); } diff --git a/mono/metadata/w32file.h b/mono/metadata/w32file.h index ac6857135579..e85a6a9cd153 100644 --- a/mono/metadata/w32file.h +++ b/mono/metadata/w32file.h @@ -262,6 +262,7 @@ mono_filesize_from_fd (int fd); #define GENERIC_EXECUTE 0x20000000 #define GENERIC_ALL 0x10000000 +#define FILE_SHARE_NONE 0x00000000 #define FILE_SHARE_READ 0x00000001 #define FILE_SHARE_WRITE 0x00000002 #define FILE_SHARE_DELETE 0x00000004 From 45c7df08f4813a6c3c0ba8367bdfaae4ddf9ace6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 20 Aug 2019 11:51:03 +0200 Subject: [PATCH 13/57] [pkg] Bump bockbuild to get gtksharp bump (#16346) --- external/bockbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/bockbuild b/external/bockbuild index 5fa563103831..657e3b49fa45 160000 --- a/external/bockbuild +++ b/external/bockbuild @@ -1 +1 @@ -Subproject commit 5fa56310383191c4566aeb89abcbcab59528e18e +Subproject commit 657e3b49fa45facc3e750fc6725a8d6dc0e5e4b3 From ff5e4b074f22630f465ff6d6278776b25a3e5a80 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 20 Aug 2019 13:45:59 -0400 Subject: [PATCH 14/57] [2019-06] Add missing `Dispose()` call on error in `MonoTlsStream.CreateStream()`. (#16327) * Add missing `Dispose()` call on error in `MonoTlsStream.CreateStream()`. * Remove the `finally` block to make it more easy to read. Backport of #16233. --- .../System/Mono.Net.Security/MonoTlsStream.cs | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs b/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs index ef9ebead1d12..66e857644da5 100644 --- a/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs +++ b/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs @@ -120,25 +120,21 @@ await sslStream.AuthenticateAsClientAsync ( ServicePointManager.CheckCertificateRevocationList).ConfigureAwait (false); status = WebExceptionStatus.Success; + + request.ServicePoint.UpdateClientCertificate (sslStream.InternalLocalCertificate); } catch (Exception ex) { WebConnection.Debug ($"MONO TLS STREAM ERROR: {socket.ID} {socket.CleanedUp} {ex.Message}"); if (socket.CleanedUp) status = WebExceptionStatus.RequestCanceled; + else if (CertificateValidationFailed) + status = WebExceptionStatus.TrustFailure; else status = WebExceptionStatus.SecureChannelFailure; - throw; - } finally { - WebConnection.Debug ($"MONO TLS STREAM CREATE STREAM DONE: {socket.ID} {socket.CleanedUp}"); - if (CertificateValidationFailed) - status = WebExceptionStatus.TrustFailure; - if (status == WebExceptionStatus.Success) - request.ServicePoint.UpdateClientCertificate (sslStream.InternalLocalCertificate); - else { - request.ServicePoint.UpdateClientCertificate (null); - sslStream.Dispose (); - sslStream = null; - } + request.ServicePoint.UpdateClientCertificate (null); + sslStream.Dispose (); + sslStream = null; + throw; } try { @@ -146,6 +142,7 @@ await sslStream.AuthenticateAsClientAsync ( await sslStream.WriteAsync (tunnel.Data, 0, tunnel.Data.Length, cancellationToken).ConfigureAwait (false); } catch { status = WebExceptionStatus.SendFailure; + sslStream.Dispose (); sslStream = null; throw; } From cc0632e4f3252554b274ab49a6d67b1d14fa4e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 20 Aug 2019 20:52:51 +0200 Subject: [PATCH 15/57] Bump corefx to get https://github.com/mono/corefx/pull/332 --- external/corefx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/corefx b/external/corefx index a01bab017064..ee1f26c4202a 160000 --- a/external/corefx +++ b/external/corefx @@ -1 +1 @@ -Subproject commit a01bab017064f9983c3c93cffef0c8143267193e +Subproject commit ee1f26c4202a266ba9906d389de430ce52167e9f From 6434153d8b7d20b96e510e43031c5968d4042dda Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 22 Aug 2019 13:36:13 -0400 Subject: [PATCH 16/57] [android] mono_dl_open_file: use g_file_test only on absolute paths (#16392) The intention of calling `g_file_test (file, G_FILE_TEST_EXISTS)` where file is the name of a shared library we want to open is to speed up probing for non-existent libraries. See https://github.com/mono/mono/pull/12074 The problem is that if file is just a simple "libdl.so" then `dlopen (file)` doesn't just look for it in the current working directory, it will probe some other paths too. (For example on desktop linux you'd also look in all the directories in LD_LIBRARY_PATH). So the g_file_test() call is not a robust way to avoid calling dlopen if the filename is relative. But it actually broke more things: https://github.com/xamarin/xamarin-android/issues/3388 When probing for "libdl.so" on Android mono_lookup_pinvoke_call will first try prepending some paths that it knows about and we end up calling `dlopen ("/system/lib/libdl.so")` which will fail because Bionic has security restrictions on what code can dlopen something from /system/lib with an absolute path. Eventually mono_lookup_pinvoke_call will go back to trying the bare "libdl.so" which hits `g_file_test` and returns NULL. The new code only does the file test if we pass it an absolute path, which gives Bionic's dlopen a chance to deal with relative paths however it needs to. --- mono/utils/mono-dl-posix.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mono/utils/mono-dl-posix.c b/mono/utils/mono-dl-posix.c index 08c8dbb0072f..852e492f314d 100644 --- a/mono/utils/mono-dl-posix.c +++ b/mono/utils/mono-dl-posix.c @@ -69,7 +69,16 @@ mono_dl_open_file (const char *file, int flags) /* Bionic doesn't support NULL filenames */ if (!file) return NULL; - if (!g_file_test (file, G_FILE_TEST_EXISTS)) + /* The intention of calling `g_file_test (file, G_FILE_TEST_EXISTS)` is + * to speed up probing for non-existent libraries. The problem is that + * if file is just a simple "libdl.so" then `dlopen (file)` doesn't just + * look for it in the current working directory, it will probe some + * other paths too. (For example on desktop linux you'd also look in + * all the directories in LD_LIBRARY_PATH). So the g_file_test() call + * is not a robust way to avoid calling dlopen if the filename is + * relative. + */ + if (g_path_is_absolute (file) && !g_file_test (file, G_FILE_TEST_EXISTS)) return NULL; #endif #if defined(_AIX) From fb26dfd84f863ecb34ed0be3721b51b65cbbe20e Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Fri, 23 Aug 2019 06:08:30 -0400 Subject: [PATCH 17/57] [2019-06] Add Compiler Server Workaround for 32-bit Linux (#16422) Currently, if the process is 32-bit, roslyn tries to determine how much memory is available. To do that, it tries to pinvoke into GlobalMemoryStatusEx, which is not supported on mono. Without it, the compiler server bombs on https://github.com/dotnet/roslyn/blob/0e63260c5afb3fb5b74c357dd250e500172bcd63/src/Compilers/Server/VBCSCompiler/NamedPipeClientConnection.cs#L55-L5 Backport of https://github.com/mono/mono/pull/16405 --- mono/mini/intrinsics.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mono/mini/intrinsics.c b/mono/mini/intrinsics.c index 18b9d28f3d51..768f839723a5 100644 --- a/mono/mini/intrinsics.c +++ b/mono/mini/intrinsics.c @@ -1684,6 +1684,15 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } } + /* Workaround for the compiler server IsMemoryAvailable. */ + if (!strcmp ("Microsoft.CodeAnalysis.CompilerServer", cmethod_klass_name_space) && !strcmp ("MemoryHelper", cmethod_klass_name)) { + if (!strcmp (cmethod->name, "IsMemoryAvailable")) { + EMIT_NEW_ICONST (cfg, ins, 1); + ins->type = STACK_I4; + return ins; + } + } + ins = mono_emit_native_types_intrinsics (cfg, cmethod, fsig, args); if (ins) return ins; From 3e76198aa44d7b0dc861b605ff33cf933714b751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 23 Aug 2019 14:44:43 +0200 Subject: [PATCH 18/57] Bump corefx to get https://github.com/mono/corefx/pull/336 --- external/corefx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/corefx b/external/corefx index ee1f26c4202a..b705dbdeb3dd 160000 --- a/external/corefx +++ b/external/corefx @@ -1 +1 @@ -Subproject commit ee1f26c4202a266ba9906d389de430ce52167e9f +Subproject commit b705dbdeb3dd50074206d6d777f12b6e7fd1f5d8 From 66d623d118cd7e841cb77033f1fdfe80120efa08 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 23 Aug 2019 09:34:57 -0400 Subject: [PATCH 19/57] Fix issue in `SafeHandle.DangerousReleaseInternal()` that caused #16034. (#16424) Using the CoreCLR version of this line fixed the problem and my investigations also revealed why. The `SafePipeHandle` contains a reference to both the Socket as well as the `SafeSocketHandle`, taking ownership of them. If there are no additional references to either of them, so that both are collected in the same GC pass, their finalizer may be invoked in any order. If the Socket gets finalized first, it's `SafeSocketHandle` will have a `_mstate` of 8 (two references) at the beginning of `DangerousReleaseInternal()` - which will set it to 6 (one reference plus disposed flag). Then when the `SafePipeHandle` gets collected, it will call `DangerousRelease ()` on it's `SafeSocketHandle`. As mentioned above, it's `_mstate` will be 6. Now we own the handle, so we'll decrease it's reference count by one and set the `Closed` flag - the new `_mstate` should thus be 3. However, using new_state = (old_state & RefCount_Mask) - RefCount_One; would set it to 1 - thus effectively clearing the `Disposed' flag. And since it's reference count is now also zero, the next finalize pass will then throw. The CoreCLR version of this class uses new_state = old_state - RefCount_One; which fixes this. Backport of #16244. --- .../System.Runtime.InteropServices/SafeHandle.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mcs/class/corlib/System.Runtime.InteropServices/SafeHandle.cs b/mcs/class/corlib/System.Runtime.InteropServices/SafeHandle.cs index a01d526ff258..9bcb34f82598 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/SafeHandle.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/SafeHandle.cs @@ -211,12 +211,12 @@ void DangerousReleaseInternal (bool dispose) else perform_release = true; - /* Attempt the update to the new state, fail and retry if the initial - * state has been modified in the meantime. Decrement the ref count by - * substracting SH_RefCountOne from the state then OR in the bits for - * Dispose (if that's the reason for the Release) and closed (if the - * initial ref count was 1). */ - new_state = (old_state & RefCount_Mask) - RefCount_One; + // Not closed, let's propose an update (to the ref count, just add + // StateBits.RefCountOne to the state to effectively add 1 to the ref count). + // Continue doing this until the update succeeds (because nobody + // modifies the state field between the read and write operations) or + // the state moves to closed. + new_state = old_state - RefCount_One; if ((old_state & RefCount_Mask) == RefCount_One) new_state |= (int) State.Closed; if (dispose) From 049d9ecb3c48432881070198adc15f21e2de5f79 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 23 Aug 2019 16:15:13 -0400 Subject: [PATCH 20/57] [msbuild] Bump to track mono-2019-06 (#16428) * Bump msbuild to track mono-2019-06 .. to get changes from https://github.com/mono/msbuild/pull/130 which tracks dotnet `release/3.0.100-preview9`. Also, bump Roslyn to 3.3.1-beta3-19421-04 . * Bump the roslyn reference --- configure.ac | 4 ++-- external/roslyn-binaries | 2 +- packaging/MacSDK/msbuild.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 81b51649c4b7..58206c5caff6 100644 --- a/configure.ac +++ b/configure.ac @@ -5867,8 +5867,8 @@ fi AC_SUBST(mono_runtime) AC_SUBST(mono_runtime_wrapper) -CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.0/csc.exe -VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.0/VBCSCompiler.exe +CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.1/csc.exe +VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.1/VBCSCompiler.exe if test $csc_compiler = mcs; then CSC=$mcs_topdir/class/lib/build/mcs.exe diff --git a/external/roslyn-binaries b/external/roslyn-binaries index 17479f963650..ce9e74a4710e 160000 --- a/external/roslyn-binaries +++ b/external/roslyn-binaries @@ -1 +1 @@ -Subproject commit 17479f9636503a9e294ab952e7b1f437f925dec9 +Subproject commit ce9e74a4710e539c446c2767d7a5d30337d1de10 diff --git a/packaging/MacSDK/msbuild.py b/packaging/MacSDK/msbuild.py index 323102724707..ae2a03f7a224 100644 --- a/packaging/MacSDK/msbuild.py +++ b/packaging/MacSDK/msbuild.py @@ -3,7 +3,7 @@ class MSBuild (GitHubPackage): def __init__ (self): GitHubPackage.__init__ (self, 'mono', 'msbuild', '15', # note: fix scripts/ci/run-test-mac-sdk.sh when bumping the version number - revision = '4d92cbc5100f4d956cc31583f48fa149ea46c7d1') + revision = 'cc640bcd68419f9c7f0c49d832a2dda08edf6342') def build (self): try: From 3608a49541322b62081395e18549015f5359e012 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Sat, 24 Aug 2019 02:51:03 -0500 Subject: [PATCH 21/57] [2019-06][msbuild] bump msbuild to pick up latest p9 versions and enable shared compilation again (#16445) * [2019-06] bump msbuild to stop disabling shared compilation * Pull in nuget update for preview 9 --- packaging/MacSDK/msbuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/MacSDK/msbuild.py b/packaging/MacSDK/msbuild.py index ae2a03f7a224..a1dda047069a 100644 --- a/packaging/MacSDK/msbuild.py +++ b/packaging/MacSDK/msbuild.py @@ -3,7 +3,7 @@ class MSBuild (GitHubPackage): def __init__ (self): GitHubPackage.__init__ (self, 'mono', 'msbuild', '15', # note: fix scripts/ci/run-test-mac-sdk.sh when bumping the version number - revision = 'cc640bcd68419f9c7f0c49d832a2dda08edf6342') + revision = '15d279837fcc88a54208093e4d60135749c5e11d') def build (self): try: From 8966e775a54107e2b97f98d5cff405b3db948932 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 26 Aug 2019 17:07:37 -0400 Subject: [PATCH 22/57] [utils] Don't use MAP_32BIT on Apple platforms, fixes crash with XCode 11 beta6 (#16481) As of XCode 11 beta6 the MacOSX SDK defines the MAP_32BIT symbol. This causes the `mono_valloc()` function to try to use the `MAP_32BIT` flag for `mmap()`. However as mentioned in the comment for the symbol in mman.h it seems to require a special entitlement which isn't available/documented anywhere yet. This in turn causes the mmap call to fail presumably because we're missing that entitlement. Instead we now skip setting this flag on Apple platforms to make `mmap()` behave like it did before. Backport of https://github.com/mono/mono/pull/16441 --- mono/utils/mono-mmap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mono/utils/mono-mmap.c b/mono/utils/mono-mmap.c index 0b4765fc1076..7dbccec1dde7 100644 --- a/mono/utils/mono-mmap.c +++ b/mono/utils/mono-mmap.c @@ -51,9 +51,11 @@ #define MAP_ANONYMOUS MAP_ANON #endif +#if !defined(__APPLE__) // returning virtual addresses <4G requires entitlement on Apple platforms, do not use it #ifndef MAP_32BIT #define MAP_32BIT 0 #endif +#endif typedef struct { int size; @@ -277,8 +279,10 @@ mono_valloc (void *addr, size_t length, int flags, MonoMemAccountType type) /* translate the flags */ if (flags & MONO_MMAP_FIXED) mflags |= MAP_FIXED; +#if !defined(__APPLE__) // returning virtual addresses <4G requires entitlement on Apple platforms, do not use it if (flags & MONO_MMAP_32BIT) mflags |= MAP_32BIT; +#endif #ifdef HOST_WASM if (length == 0) @@ -374,8 +378,10 @@ mono_file_map (size_t length, int flags, int fd, guint64 offset, void **ret_hand mflags |= MAP_SHARED; if (flags & MONO_MMAP_FIXED) mflags |= MAP_FIXED; +#if !defined(__APPLE__) // returning virtual addresses <4G requires entitlement on Apple platforms, do not use it if (flags & MONO_MMAP_32BIT) mflags |= MAP_32BIT; +#endif #ifdef HOST_WASM if (length == 0) From 5ecff82230b4e8d31d91b928894ef31ba720d988 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Mon, 26 Aug 2019 19:31:53 -0400 Subject: [PATCH 23/57] [2019-06] [w32socket] Translate some errno codes to WSA_ errors imprecisely. (#16489) * [w32socket] Translate some errno codes to WSA_ errors imprecisely. These aren't a perfect match, but better than falling into the `default` case where Mono asserts and crashes. Addresses part of https://github.com/mono/mono/issues/16024 * [w32error] Add WSA_INVALID_PARAMETER and WSA_INVALID_HANDLE Backport of #16331. --- mono/metadata/w32error.h | 2 ++ mono/metadata/w32socket-unix.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mono/metadata/w32error.h b/mono/metadata/w32error.h index 83f061aee844..2ca20c8a9ed7 100644 --- a/mono/metadata/w32error.h +++ b/mono/metadata/w32error.h @@ -45,6 +45,8 @@ #define ERROR_IO_PENDING 997 #define ERROR_CANT_RESOLVE_FILENAME 1921 #define ERROR_ENCRYPTION_FAILED 6000 +#define WSA_INVALID_PARAMETER ERROR_INVALID_PARAMETER +#define WSA_INVALID_HANDLE ERROR_INVALID_HANDLE #define WSAEINTR 10004 #define WSAEBADF 10009 #define WSAEACCES 10013 diff --git a/mono/metadata/w32socket-unix.c b/mono/metadata/w32socket-unix.c index 2081aabb9e24..394cfdbaae09 100644 --- a/mono/metadata/w32socket-unix.c +++ b/mono/metadata/w32socket-unix.c @@ -1463,6 +1463,7 @@ mono_w32socket_convert_error (gint error) #ifdef ECONNRESET case ECONNRESET: return WSAECONNRESET; #endif + case EDOM: return WSAEINVAL; /* not a precise match, best wecan do. */ case EFAULT: return WSAEFAULT; #ifdef EHOSTUNREACH case EHOSTUNREACH: return WSAEHOSTUNREACH; @@ -1472,11 +1473,12 @@ mono_w32socket_convert_error (gint error) #endif case EINTR: return WSAEINTR; case EINVAL: return WSAEINVAL; - /*FIXME: case EIO: return WSAE????; */ + case EIO: return WSA_INVALID_HANDLE; /* not a precise match, best we can do. */ #ifdef EISCONN case EISCONN: return WSAEISCONN; #endif case ELOOP: return WSAELOOP; + case ENFILE: return WSAEMFILE; /* not a precise match, best we can do. */ case EMFILE: return WSAEMFILE; #ifdef EMSGSIZE case EMSGSIZE: return WSAEMSGSIZE; @@ -1488,7 +1490,6 @@ mono_w32socket_convert_error (gint error) #ifdef ENOBUFS case ENOBUFS: return WSAENOBUFS; /* not documented */ #endif - /* case ENOENT: return WSAE????; */ case ENOMEM: return WSAENOBUFS; #ifdef ENOPROTOOPT case ENOPROTOOPT: return WSAENOPROTOOPT; @@ -1499,7 +1500,7 @@ mono_w32socket_convert_error (gint error) #ifdef ENOTCONN case ENOTCONN: return WSAENOTCONN; #endif - /*FIXME: case ENOTDIR: return WSAE????; */ + case ENOTDIR: return WSA_INVALID_PARAMETER; /* not a precise match, best we can do. */ #ifdef ENOTSOCK case ENOTSOCK: return WSAENOTSOCK; #endif From 16c2464e24d2e5774dd62cf2e676e1dcc801f64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 27 Aug 2019 19:48:08 +0200 Subject: [PATCH 24/57] [acceptance-tests] Bump roslyn test repo to remove a problematic nuget feed (cherry picked from commit 8d422436f528e12d49f5f6f3fa4012a14143d905) --- acceptance-tests/SUBMODULES.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance-tests/SUBMODULES.json b/acceptance-tests/SUBMODULES.json index a9215de06f0f..9a87da6692b8 100644 --- a/acceptance-tests/SUBMODULES.json +++ b/acceptance-tests/SUBMODULES.json @@ -2,7 +2,7 @@ { "name": "roslyn", "url": "git://github.com/mono/roslyn.git", - "rev": "7a840bd5697ef6ea41f554a09d837636fba9d88d", + "rev": "13a40eedacc799a78710aba5c8e4b2dcc80a7e61", "remote-branch": "origin/mono-testing", "branch": "mono-testing", "directory": "roslyn" From 99c1602fcd45da7eaba177dbaba78cccfb1f77f7 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 27 Aug 2019 13:54:52 -0400 Subject: [PATCH 25/57] Allow file:// based Uri's to be used in HttpClient when the BaseAddress is set Fixes https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/967582 Bumps the HttpClient part in mono/corefx at: https://github.com/mono/corefx/commit/ee3acec16b37bec5016da129e1e3840097ca629b The test that would have caught this failure was disabled previously via: https://github.com/mono/mono/commit/2f411750acfd2132f9b4970ef8cf11d9a0f62df9 (cherry picked from commit 580defd967aa3c0bbdc985ca001bad28c6fdec80) --- external/corefx | 2 +- mcs/class/System.Net.Http/HttpRequestMessage.Mono.cs | 4 ++++ .../System.Net.Http/Test/System.Net.Http/HttpClientTest.cs | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/external/corefx b/external/corefx index b705dbdeb3dd..4806207f6fcf 160000 --- a/external/corefx +++ b/external/corefx @@ -1 +1 @@ -Subproject commit b705dbdeb3dd50074206d6d777f12b6e7fd1f5d8 +Subproject commit 4806207f6fcf66a4c7f901f8479b82e488201f0c diff --git a/mcs/class/System.Net.Http/HttpRequestMessage.Mono.cs b/mcs/class/System.Net.Http/HttpRequestMessage.Mono.cs index 87adab770f66..91f381915f1e 100644 --- a/mcs/class/System.Net.Http/HttpRequestMessage.Mono.cs +++ b/mcs/class/System.Net.Http/HttpRequestMessage.Mono.cs @@ -12,6 +12,10 @@ static bool IsAllowedAbsoluteUri (Uri uri) return true; #endif + // Mono URI handling which does not distinguish between file and url absolute paths without scheme + if (uri.Scheme == Uri.UriSchemeFile && uri.OriginalString.StartsWith ("/", StringComparison.Ordinal)) + return true; + return HttpUtilities.IsHttpUri (uri); } } diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index 2134a5ea9397..510c0a2d6d23 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -374,8 +374,7 @@ public void Send () Assert.AreEqual (response, client.SendAsync (request).Result, "#1"); } - [Test] - [Category ("NotWorking")] + [Test] public void Send_BaseAddress () { var mh = new HttpMessageHandlerMock (); From fd75f0f487999d88052ba356203b897ce532f659 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 29 Aug 2019 08:33:44 -0400 Subject: [PATCH 26/57] [2019-06] Implement Read and WriteAsyncMemory in Mono DeflateStream Resolves https://github.com/mono/mono/issues/16122 Since we put in the corefx version of GZipStream, it is expected that our version of DeflateStream actually implements Write+ReadAsyncMemory. This change does that by just calling the plain WriteAsync & ReadAsync methods until we decide (or not) to pull in the corefx DeflateStream. Backport of https://github.com/mono/mono/pull/16523. --- mcs/class/System/System.IO.Compression/DeflateStream.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcs/class/System/System.IO.Compression/DeflateStream.cs b/mcs/class/System/System.IO.Compression/DeflateStream.cs index 4c326b0ed921..c5127fe888a2 100644 --- a/mcs/class/System/System.IO.Compression/DeflateStream.cs +++ b/mcs/class/System/System.IO.Compression/DeflateStream.cs @@ -140,7 +140,7 @@ unsafe int ReadInternal (byte[] array, int offset, int count) internal ValueTask ReadAsyncMemory (Memory destination, CancellationToken cancellationToken) { - throw new NotImplementedException (); + return base.ReadAsync(destination, cancellationToken); } internal int ReadCore (Span destination) @@ -180,7 +180,7 @@ unsafe void WriteInternal (byte[] array, int offset, int count) internal ValueTask WriteAsyncMemory (ReadOnlyMemory source, CancellationToken cancellationToken) { - throw new NotImplementedException (); + return base.WriteAsync(source, cancellationToken); } internal void WriteCore (ReadOnlySpan source) From 1604b9df9d349ca3b7703d48af7d8d6856929e74 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 29 Aug 2019 08:35:35 -0400 Subject: [PATCH 27/57] [2019-06] Use the right FileSystemWatcher sources (#16555) * Use the right FileSystemWatcher sources The corefx code for FileSystemEventArgs has some changes to support constructing one with a null filename. Fixes #16486 * Remove the mono sources for the newly replaced files * [csproj] Update project files --- .../System/System.IO/FileSystemEventArgs.cs | 75 ------------------- .../System.IO/FileSystemEventHandler.cs | 33 -------- mcs/class/System/System.csproj | 4 +- mcs/class/System/common.sources | 6 +- 4 files changed, 5 insertions(+), 113 deletions(-) delete mode 100644 mcs/class/System/System.IO/FileSystemEventArgs.cs delete mode 100644 mcs/class/System/System.IO/FileSystemEventHandler.cs diff --git a/mcs/class/System/System.IO/FileSystemEventArgs.cs b/mcs/class/System/System.IO/FileSystemEventArgs.cs deleted file mode 100644 index ef7e7ed0d7ea..000000000000 --- a/mcs/class/System/System.IO/FileSystemEventArgs.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// System.IO.FileSystemEventArgs.cs -// -// Author: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2002 -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.IO { - public class FileSystemEventArgs : EventArgs { - - #region Fields - - WatcherChangeTypes changeType; - string directory; - string name; - - #endregion // Fields - - #region Constructors - - public FileSystemEventArgs (WatcherChangeTypes changeType, string directory, string name) - { - this.changeType = changeType; - this.directory = directory; - this.name = name; - } - - internal void SetName (string name) - { - this.name = name; - } - #endregion // Constructors - - #region Properties - - public WatcherChangeTypes ChangeType { - get { return changeType; } - } - - public string FullPath { - get { return Path.Combine (directory, name); } - } - - public string Name { - get { return name; } - } - - #endregion // Properties - } -} diff --git a/mcs/class/System/System.IO/FileSystemEventHandler.cs b/mcs/class/System/System.IO/FileSystemEventHandler.cs deleted file mode 100644 index 16b0ad0cb0c6..000000000000 --- a/mcs/class/System/System.IO/FileSystemEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.IO.FileSystemEventHandler.cs -// -// Author: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2002 -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.IO { - - public delegate void FileSystemEventHandler (object sender, FileSystemEventArgs e); -} diff --git a/mcs/class/System/System.csproj b/mcs/class/System/System.csproj index 1fcf28a8f07a..3c9f169b53e0 100644 --- a/mcs/class/System/System.csproj +++ b/mcs/class/System/System.csproj @@ -409,6 +409,8 @@ + + @@ -864,8 +866,6 @@ - - diff --git a/mcs/class/System/common.sources b/mcs/class/System/common.sources index e4d69c0da235..667f0e0fb364 100644 --- a/mcs/class/System/common.sources +++ b/mcs/class/System/common.sources @@ -29,8 +29,6 @@ System.IO.Compression/DeflateStream.cs System.IO/ErrorEventArgs.cs System.IO/ErrorEventHandler.cs -System.IO/FileSystemEventArgs.cs -System.IO/FileSystemEventHandler.cs System.IO/InternalBufferOverflowException.cs System.IO/InvalidDataException.cs System.IO/IODescriptionAttribute.cs @@ -873,13 +871,15 @@ ReferenceSources/Win32Exception.cs ../../../external/corefx/src/System.Private.Uri/src/System/UriBuilder.cs ../../../external/corefx/src/System.Runtime.Extensions/src/System/CodeDom/Compiler/IndentedTextWriter.cs +../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs +../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventHandler.cs +../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs ../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/WaitForChangedResult.cs ../../../external/corefx/src/System.Runtime.InteropServices/src/System/Security/SecureStringMarshal.cs ../../../external/corefx/src/System.Runtime.Extensions/src/System/StringNormalizationExtensions.cs ../../../external/corefx/src/System.Diagnostics.StackTrace/src/System/Diagnostics/StackFrameExtensions.cs -../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs # Everything except compiled ../../../external/corefx/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Capture.cs From 7ef99c046cb5b23fc09c0c3fbb5951c0898cfae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 29 Aug 2019 20:24:14 +0200 Subject: [PATCH 28/57] Build pkg-config as 64bit only, libtiff as universal and remove gtk-quartz-engine.py (#16548) See https://github.com/mono/bockbuild/pull/116 (cherry picked from commit 309cf1bcee1a605830f1cc73a90ca6dc44a89c7f) # Conflicts: # external/bockbuild --- external/bockbuild | 2 +- packaging/MacSDK/profile.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/external/bockbuild b/external/bockbuild index 657e3b49fa45..1a30586c6fd4 160000 --- a/external/bockbuild +++ b/external/bockbuild @@ -1 +1 @@ -Subproject commit 657e3b49fa45facc3e750fc6725a8d6dc0e5e4b3 +Subproject commit 1a30586c6fd40842d7c56915556139df5ec01c05 diff --git a/packaging/MacSDK/profile.py b/packaging/MacSDK/profile.py index 11a365726456..6fc5ac9c2dee 100755 --- a/packaging/MacSDK/profile.py +++ b/packaging/MacSDK/profile.py @@ -47,7 +47,6 @@ class MonoReleaseProfile(DarwinProfile): 'gtk-engines', 'murrine', 'xamarin-gtk-theme', - 'gtk-quartz-engine', # Mono 'mono', From 3216a3c1e3e04ab86fd71939d0ea93e59a722e05 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Fri, 30 Aug 2019 06:30:03 -0400 Subject: [PATCH 29/57] [2019-06] Bump ikvm to pick up caa8e7f54279a47422626005d228447f5d3670d5. (#16575) * Bump ikvm to pick up caa8e7f54279a47422626005d228447f5d3670d5. * [monodis] Add a missing cattr parent case. Backport of #16567. --- external/ikvm | 2 +- mono/dis/dump.c | 3 +++ mono/metadata/row-indexes.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/external/ikvm b/external/ikvm index 847e05fced5c..caa8e7f54279 160000 --- a/external/ikvm +++ b/external/ikvm @@ -1 +1 @@ -Subproject commit 847e05fced5c9a41ff0f24f1f9d40d5a8a5772c1 +Subproject commit caa8e7f54279a47422626005d228447f5d3670d5 diff --git a/mono/dis/dump.c b/mono/dis/dump.c index 5bfc80614c60..b3336346df1d 100755 --- a/mono/dis/dump.c +++ b/mono/dis/dump.c @@ -794,6 +794,9 @@ has_cattr_get_table (MonoImage *m, guint32 val) case MONO_CUSTOM_ATTR_GENERICPAR: table = "GenericParam"; break; + case MONO_CUSTOM_ATTR_GENERICPARAMCONSTRAINT: + table = "GenericParamConstraint"; + break; default: table = "Unknown"; break; diff --git a/mono/metadata/row-indexes.h b/mono/metadata/row-indexes.h index 992dbdeea99f..d7837d01ba09 100644 --- a/mono/metadata/row-indexes.h +++ b/mono/metadata/row-indexes.h @@ -392,6 +392,7 @@ enum { MONO_CUSTOM_ATTR_EXP_TYPE, MONO_CUSTOM_ATTR_MANIFEST, MONO_CUSTOM_ATTR_GENERICPAR, + MONO_CUSTOM_ATTR_GENERICPARAMCONSTRAINT, MONO_CUSTOM_ATTR_BITS = 5, MONO_CUSTOM_ATTR_MASK = 0x1F }; From 2c3aeaf3780de7392a0d3cbe4dcf86846eb4dffa Mon Sep 17 00:00:00 2001 From: monojenkins Date: Tue, 3 Sep 2019 14:09:37 -0400 Subject: [PATCH 30/57] [2019-06] [corlib] Add hack for Hebrew calendar data (#16642) --- .../corlib/ReferenceSources/CalendarData.cs | 42 ++++++++++++++++++- mcs/class/corlib/corlib.csproj | 2 +- mcs/class/corlib/corlib.dll.sources | 2 +- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/mcs/class/corlib/ReferenceSources/CalendarData.cs b/mcs/class/corlib/ReferenceSources/CalendarData.cs index 37ded82917ed..5947c04cb562 100644 --- a/mcs/class/corlib/ReferenceSources/CalendarData.cs +++ b/mcs/class/corlib/ReferenceSources/CalendarData.cs @@ -34,6 +34,36 @@ namespace System.Globalization [StructLayout (LayoutKind.Sequential)] partial class CalendarData { + private static string[] HEBREW_MONTH_NAMES = new[] { + "\u05EA\u05E9\u05E8\u05D9", + "\u05D7\u05E9\u05D5\u05DF", + "\u05DB\u05E1\u05DC\u05D5", + "\u05D8\u05D1\u05EA", + "\u05E9\u05D1\u05D8", + "\u05D0\u05D3\u05E8", + "\u05D0\u05D3\u05E8\u0020\u05D1", + "\u05E0\u05D9\u05E1\u05DF", + "\u05D0\u05D9\u05D9\u05E8", + "\u05E1\u05D9\u05D5\u05DF", + "\u05EA\u05DE\u05D5\u05D6", + "\u05D0\u05D1", + "\u05D0\u05DC\u05D5\u05DC" }; + + private static string[] HEBREW_LEAP_MONTH_NAMES = new[] { + "\u05EA\u05E9\u05E8\u05D9", + "\u05D7\u05E9\u05D5\u05DF", + "\u05DB\u05E1\u05DC\u05D5", + "\u05D8\u05D1\u05EA", + "\u05E9\u05D1\u05D8", + "\u05D0\u05D3\u05E8\u0020\u05D0", + "\u05D0\u05D3\u05E8\u0020\u05D1", + "\u05E0\u05D9\u05E1\u05DF", + "\u05D0\u05D9\u05D9\u05E8", + "\u05E1\u05D9\u05D5\u05DF", + "\u05EA\u05DE\u05D5\u05D6", + "\u05D0\u05D1", + "\u05D0\u05DC\u05D5\u05DC" }; + public static int nativeGetTwoDigitYearMax (int calID) { // -1 mean OS does not override default BCL max year @@ -43,7 +73,17 @@ public static int nativeGetTwoDigitYearMax (int calID) static bool nativeGetCalendarData (CalendarData data, string localeName, int calendarId) { // TODO: Convert calendar-id to mono runtime calendar-id when it's used - return data.fill_calendar_data (localeName.ToLowerInvariant (), calendarId); + if (data.fill_calendar_data (localeName.ToLowerInvariant (), calendarId)) { + if ((CalendarId)calendarId == CalendarId.HEBREW) { + // HACK: Generate leap month names because the native code does not do it + // and tests would fail to round-trip dates on leap years. + // https://github.com/mono/mono/issues/16623 + data.saMonthNames = HEBREW_MONTH_NAMES; + data.saLeapYearMonthNames = HEBREW_LEAP_MONTH_NAMES; + } + return true; + } + return false; } [MethodImplAttribute (MethodImplOptions.InternalCall)] diff --git a/mcs/class/corlib/corlib.csproj b/mcs/class/corlib/corlib.csproj index ffcc46fbe594..153e454055e4 100644 --- a/mcs/class/corlib/corlib.csproj +++ b/mcs/class/corlib/corlib.csproj @@ -331,6 +331,7 @@ + @@ -1067,7 +1068,6 @@ - diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index 3abc8e8f55c5..1bfb37576d4b 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -1105,7 +1105,7 @@ ReferenceSources/AppContextDefaultValues.cs ../referencesource/mscorlib/system/globalization/gregoriancalendarhelper.cs ../referencesource/mscorlib/system/globalization/gregoriancalendartypes.cs ../referencesource/mscorlib/system/globalization/hebrewcalendar.cs -../referencesource/mscorlib/system/globalization/hebrewnumber.cs +../../../external/corefx/src/Common/src/CoreLib/System/Globalization/HebrewNumber.cs ../referencesource/mscorlib/system/globalization/hijricalendar.cs ../referencesource/mscorlib/system/globalization/japanesecalendar.cs ../referencesource/mscorlib/system/globalization/japaneselunisolarcalendar.cs From 7af64d1ebe9e9ee305cdae8ec5995c9521cbcf19 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Wed, 4 Sep 2019 16:31:19 -0400 Subject: [PATCH 31/57] [2019-06] [android] remove text relocations in AOT/arm32 (#16660) * Revert "[aot] partial revert of #14043 (#14135)" This reverts commit 223e0bd78d0531eb7b58edb1286e1c545c65f57a. * Revert "[aot] change method table generation so that it works for larger assemblies on ARM (#14043)" This reverts commit 9ff3b0d65ee401616ac08fe43530d7a27bbe5902. --- mono/mini/aot-compiler.c | 19 ++----------------- mono/mini/aot-runtime.c | 7 ------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index 49df06410360..84a4a0842bd9 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -1595,21 +1595,6 @@ arch_emit_direct_call (MonoAotCompile *acfg, const char *target, gboolean extern g_assert_not_reached (); #endif } - -static void -arch_emit_label_address (MonoAotCompile *acfg, const char *target, gboolean external_call, gboolean thumb, MonoJumpInfo *ji, int *call_size) -{ -#if defined(TARGET_ARM) && defined(TARGET_ANDROID) - /* binutils ld does not support branch islands on arm32 */ - if (!thumb) { - emit_unset_mode (acfg); - fprintf (acfg->fp, "ldr pc,=%s\n", target); - fprintf (acfg->fp, ".ltorg\n"); - *call_size = 8; - } else -#endif - arch_emit_direct_call (acfg, target, external_call, thumb, ji, call_size); -} #endif /* @@ -9958,9 +9943,9 @@ emit_code (MonoAotCompile *acfg) int call_size; if (!ignore_cfg (acfg->cfgs [i])) { - arch_emit_label_address (acfg, acfg->cfgs [i]->asm_symbol, FALSE, acfg->thumb_mixed && acfg->cfgs [i]->compile_llvm, NULL, &call_size); + arch_emit_direct_call (acfg, acfg->cfgs [i]->asm_symbol, FALSE, acfg->thumb_mixed && acfg->cfgs [i]->compile_llvm, NULL, &call_size); } else { - arch_emit_label_address (acfg, symbol, FALSE, FALSE, NULL, &call_size); + arch_emit_direct_call (acfg, symbol, FALSE, FALSE, NULL, &call_size); } #endif } diff --git a/mono/mini/aot-runtime.c b/mono/mini/aot-runtime.c index 38fedfdf2fd7..386754d1ff6f 100644 --- a/mono/mini/aot-runtime.c +++ b/mono/mini/aot-runtime.c @@ -1939,11 +1939,6 @@ get_call_table_entry (void *table, int index) guint32 ins; gint32 offset; - ins_addr = (guint32 *)table + (index * 2); - if ((guint32) *ins_addr == (guint32 ) 0xe51ff004) { // ldr pc, =