diff --git a/eng/illink.targets b/eng/illink.targets index 2a49deae55dc44..106b7126f21c7b 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -191,7 +191,6 @@ diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 84c9e2611f6619..7147687ee04b94 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -17,7 +17,6 @@ Debug;Release;Checked x64;x86;arm;arm64 - true true $(IntermediateOutputPath)System.Private.CoreLib.xml diff --git a/src/libraries/Common/src/SkipLocalsInit.cs b/src/libraries/Common/src/SkipLocalsInit.cs new file mode 100644 index 00000000000000..3ddba38173aed1 --- /dev/null +++ b/src/libraries/Common/src/SkipLocalsInit.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Used to indicate to the compiler that the .locals init flag should not be set in method headers. +[module: System.Runtime.CompilerServices.SkipLocalsInit] diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index d528a633013825..678d87aa908a40 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -295,9 +295,6 @@ false - - - true diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 8cd6b7f02df6c4..995f353621dad2 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -239,4 +239,23 @@ + + + true + + + + + + + + true + + + + + + + + diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 6f2855c237f967..fc0b5175416b74 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -1058,6 +1058,9 @@ Common\Interop\Windows\Normaliz\Interop.Normalization.cs + + Common\SkipLocalsInit.cs + Common\System\HResults.cs diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/SkipLocalsInitAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/SkipLocalsInitAttribute.cs index 349c12ace69c43..89439cee15441f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/SkipLocalsInitAttribute.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/SkipLocalsInitAttribute.cs @@ -5,8 +5,8 @@ namespace System.Runtime.CompilerServices { /// - /// Used to indicate to the compiler that the .locals init flag should - /// not be set in nested method headers when emitting to metadata. + /// Used to indicate to the compiler that the .locals init + /// flag should not be set in method headers. /// /// /// This attribute is unsafe because it may reveal uninitialized memory to diff --git a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj index 97710f8acf8029..5e8572f771e5ca 100644 --- a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -20,7 +20,6 @@ Debug;Release;Checked x64;x86;arm;arm64;wasm - true true $(MSBuildThisFileDirectory)src\LinkerDescriptor\System.Private.CoreLib.xml