Skip to content

Commit b470aac

Browse files
committed
[mono] Remove mono_corlib_version, it has not been maintained for some time.
Fixes #47767.
1 parent efd818b commit b470aac

File tree

5 files changed

+0
-109
lines changed

5 files changed

+0
-109
lines changed

src/mono/CMakeLists.txt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,29 +62,6 @@ if(ENABLE_MINIMAL)
6262
process_enable_minimal()
6363
endif()
6464

65-
#
66-
# This is the version of the corlib-runtime interface. When
67-
# making changes to this interface (by changing the layout
68-
# of classes the runtime knows about, changing icall signature or
69-
# semantics etc), change this variable.
70-
#
71-
# This must be unique relative to corlib interface and semantics.
72-
#
73-
# If you change corlib such that a runtime change is required, or
74-
# vice versa, change this string. Examples include removing icalls,
75-
# adding icalls, changing icall signatures, and changing type layouts
76-
# that both sides know.
77-
#
78-
# It is an arbitrary string and should be parsed as such.
79-
# A guid works and is encouraged.
80-
#
81-
# There is no ordering of corlib versions, no old or new,
82-
# an exact match is required between corlib and runtime.
83-
#
84-
# This line is parsed by other tools, it should remain in the format they expect.
85-
#
86-
set(MONO_CORLIB_VERSION 1A5E0066-58DC-428A-B21C-0AD6CDAE2789)
87-
8865
set(DISABLE_MDB 1)
8966
set(DISABLE_COM 1)
9067
set(DISABLE_PERFCOUNTERS 1)

src/mono/System.Private.CoreLib/GenerateMonoCoreLibVersionFile.targets

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<!-- Generate Mono corelib version file -->
3-
<Import Project="GenerateMonoCoreLibVersionFile.targets" />
4-
52
<PropertyGroup>
63
<EnableDefaultItems>false</EnableDefaultItems>
74
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>

src/mono/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@
129129
</type>
130130

131131
<type fullname="System.Environment">
132-
<!-- appdomain.c: mono_get_corlib_version -->
133-
<field name="mono_corlib_version" />
134132
<method name="get_StackTrace" />
135133
</type>
136134

src/mono/mono/metadata/appdomain.c

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -309,37 +309,6 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT
309309
HANDLE_FUNCTION_RETURN ();
310310
}
311311

312-
static char*
313-
mono_get_corlib_version (void)
314-
{
315-
ERROR_DECL (error);
316-
317-
MonoClass *klass;
318-
MonoClassField *field;
319-
320-
klass = mono_class_load_from_name (mono_defaults.corlib, "System", "Environment");
321-
mono_class_init_internal (klass);
322-
field = mono_class_get_field_from_name_full (klass, "mono_corlib_version", NULL);
323-
if (!field)
324-
return NULL;
325-
326-
if (! (field->type->attrs & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_LITERAL)))
327-
return NULL;
328-
329-
char *value;
330-
MonoTypeEnum field_type;
331-
const char *data = mono_class_get_field_default_value (field, &field_type);
332-
if (field_type != MONO_TYPE_STRING)
333-
return NULL;
334-
mono_metadata_read_constant_value (data, field_type, &value, error);
335-
mono_error_assert_ok (error);
336-
337-
char *res = mono_string_from_blob (value, error);
338-
mono_error_assert_ok (error);
339-
340-
return res;
341-
}
342-
343312
/**
344313
* mono_check_corlib_version:
345314
* Checks that the corlib that is loaded matches the version of this runtime.
@@ -364,18 +333,6 @@ mono_check_corlib_version_internal (void)
364333
return NULL;
365334
#else
366335
char *result = NULL;
367-
char *version = mono_get_corlib_version ();
368-
if (!version) {
369-
result = g_strdup_printf ("expected corlib string (%s) but not found or not string", MONO_CORLIB_VERSION);
370-
goto exit;
371-
}
372-
if (strcmp (version, MONO_CORLIB_VERSION) != 0) {
373-
result = g_strdup_printf ("The runtime did not find the mscorlib.dll it expected. "
374-
"Expected interface version %s but found %s. Check that "
375-
"your runtime and class libraries are matching.",
376-
MONO_CORLIB_VERSION, version);
377-
goto exit;
378-
}
379336

380337
/* Check that the managed and unmanaged layout of MonoInternalThread matches */
381338
guint32 native_offset;
@@ -384,8 +341,6 @@ mono_check_corlib_version_internal (void)
384341
managed_offset = mono_field_get_offset (mono_class_get_field_from_name_full (mono_defaults.internal_thread_class, "last", NULL));
385342
if (native_offset != managed_offset)
386343
result = g_strdup_printf ("expected InternalThread.last field offset %u, found %u. See InternalThread.last comment", native_offset, managed_offset);
387-
exit:
388-
g_free (version);
389344
return result;
390345
#endif
391346
}

0 commit comments

Comments
 (0)