Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Erhardt <eric.erhardt@microsoft.com>2020-09-02 00:09:17 +0300
committerGitHub <noreply@github.com>2020-09-02 00:09:17 +0300
commit38017c3935de95d0335bac04f4901ddfc2718656 (patch)
tree2d9abf0714be237b5504f7d143ea99a55daee7ac
parent1186d1fb809aeee07c6922ef5fd3ddc4bfd82ed8 (diff)
Leftover Utf8String defines are causing ILLinker warnings (#41680)v5.0.0-rc.1.20451.14
The CreateRuntimeRootILLinkDescriptorFile task, which generates most of S.P.CoreLib's ILLink.Descriptor file for coreclr, doesn't respect #ifdefs. So even though FEATURE_UTF8STRING is disabled in the release/5.0 branch, it is still generating entries for Char8 and Utf8String. But since these managed types do not exist, the ILLinker is raising warnings. To fix this, comment the DEFINE_CLASS entries out of the header file. Fix #41654
-rw-r--r--src/coreclr/src/vm/corelib.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/coreclr/src/vm/corelib.h b/src/coreclr/src/vm/corelib.h
index 044147c8eb2..67fcfa152d7 100644
--- a/src/coreclr/src/vm/corelib.h
+++ b/src/coreclr/src/vm/corelib.h
@@ -318,9 +318,12 @@ DEFINE_CLASS(ENCODING, Text, Encoding)
DEFINE_CLASS(RUNE, Text, Rune)
-#ifdef FEATURE_UTF8STRING
-DEFINE_CLASS(CHAR8, System, Char8)
-#endif // FEATURE_UTF8STRING
+// https://github.com/dotnet/runtime/issues/41654 - having DEFINE_CLASS (even under #ifdef) causes an entry
+// in System.Private.CoreLib's ILLink.Descriptor.xml which causes warnings
+// Use /// comments because CreateRuntimeRootILLinkDescriptorFile will still match `// DEFINE_CLASS`
+/// #ifdef FEATURE_UTF8STRING
+/// DEFINE_CLASS(CHAR8, System, Char8)
+/// #endif // FEATURE_UTF8STRING
DEFINE_CLASS(ENUM, System, Enum)
@@ -849,16 +852,19 @@ DEFINE_METHOD(STRING, WCSLEN, wcslen,
DEFINE_METHOD(STRING, STRLEN, strlen, SM_PtrByte_RetInt)
DEFINE_PROPERTY(STRING, LENGTH, Length, Int)
-#ifdef FEATURE_UTF8STRING
-DEFINE_CLASS(UTF8_STRING, System, Utf8String)
-DEFINE_METHOD(UTF8_STRING, CTORF_READONLYSPANOFBYTE,Ctor, IM_ReadOnlySpanOfByte_RetUtf8Str)
-DEFINE_METHOD(UTF8_STRING, CTORF_READONLYSPANOFCHAR,Ctor, IM_ReadOnlySpanOfChar_RetUtf8Str)
-DEFINE_METHOD(UTF8_STRING, CTORF_BYTEARRAY_START_LEN,Ctor, IM_ArrByte_Int_Int_RetUtf8Str)
-DEFINE_METHOD(UTF8_STRING, CTORF_BYTEPTR, Ctor, IM_PtrByte_RetUtf8Str)
-DEFINE_METHOD(UTF8_STRING, CTORF_CHARARRAY_START_LEN,Ctor, IM_ArrChar_Int_Int_RetUtf8Str)
-DEFINE_METHOD(UTF8_STRING, CTORF_CHARPTR, Ctor, IM_PtrChar_RetUtf8Str)
-DEFINE_METHOD(UTF8_STRING, CTORF_STRING, Ctor, IM_String_RetUtf8Str)
-#endif // FEATURE_UTF8STRING
+// https://github.com/dotnet/runtime/issues/41654 - having DEFINE_CLASS (even under #ifdef) causes an entry
+// in System.Private.CoreLib's ILLink.Descriptor.xml which causes warnings.
+// Use /// comments because CreateRuntimeRootILLinkDescriptorFile will still match `// DEFINE_CLASS`
+/// #ifdef FEATURE_UTF8STRING
+/// DEFINE_CLASS(UTF8_STRING, System, Utf8String)
+/// DEFINE_METHOD(UTF8_STRING, CTORF_READONLYSPANOFBYTE,Ctor, IM_ReadOnlySpanOfByte_RetUtf8Str)
+/// DEFINE_METHOD(UTF8_STRING, CTORF_READONLYSPANOFCHAR,Ctor, IM_ReadOnlySpanOfChar_RetUtf8Str)
+/// DEFINE_METHOD(UTF8_STRING, CTORF_BYTEARRAY_START_LEN,Ctor, IM_ArrByte_Int_Int_RetUtf8Str)
+/// DEFINE_METHOD(UTF8_STRING, CTORF_BYTEPTR, Ctor, IM_PtrByte_RetUtf8Str)
+/// DEFINE_METHOD(UTF8_STRING, CTORF_CHARARRAY_START_LEN,Ctor, IM_ArrChar_Int_Int_RetUtf8Str)
+/// DEFINE_METHOD(UTF8_STRING, CTORF_CHARPTR, Ctor, IM_PtrChar_RetUtf8Str)
+/// DEFINE_METHOD(UTF8_STRING, CTORF_STRING, Ctor, IM_String_RetUtf8Str)
+/// #endif // FEATURE_UTF8STRING
DEFINE_CLASS(STRING_BUILDER, Text, StringBuilder)
DEFINE_PROPERTY(STRING_BUILDER, LENGTH, Length, Int)