diff --git a/src/coreclr/vm/typedesc.cpp b/src/coreclr/vm/typedesc.cpp
index 657170b3bbcc9..670b41d6e7dab 100644
--- a/src/coreclr/vm/typedesc.cpp
+++ b/src/coreclr/vm/typedesc.cpp
@@ -1730,6 +1730,11 @@ BOOL TypeVarTypeDesc::SatisfiesConstraints(SigTypeContext *pTypeContextOfConstra
}
CONTRACTL_END;
+ // During EEStartup, we cannot safely validate constraints, but we can also be confident that the code doesn't violate them
+ // Just skip validation and declare that the constraints are satisfied.
+ if (g_fEEInit)
+ return TRUE;
+
IMDInternalImport* pInternalImport = GetModule()->GetMDImport();
mdGenericParamConstraint tkConstraint;
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 9f40bcdc3655f..1ea2136377743 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
@@ -17,6 +17,7 @@
$(MSBuildThisFileDirectory)ILLink\
true
true
+ false
$(DefineConstants);TARGET_32BIT
diff --git a/src/tests/JIT/Math/Generic/GenericMathTests.cs b/src/tests/JIT/Math/Generic/GenericMathTests.cs
index 77c7d174c365a..2f3da1b168d14 100644
--- a/src/tests/JIT/Math/Generic/GenericMathTests.cs
+++ b/src/tests/JIT/Math/Generic/GenericMathTests.cs
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Collections.Generic;
+
namespace System.GenericMath
{
public abstract class GenericMathTests
diff --git a/src/tests/JIT/Math/Generic/Int32Tests.cs b/src/tests/JIT/Math/Generic/Int32Tests.cs
index bbca280de5f53..5916bcaaa5e45 100644
--- a/src/tests/JIT/Math/Generic/Int32Tests.cs
+++ b/src/tests/JIT/Math/Generic/Int32Tests.cs
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Linq;
+
namespace System.GenericMath
{
public sealed class Int32Tests : GenericMathTests
@@ -15,7 +17,7 @@ public override void SumTest()
if (expected != actual)
{
- throw new InvalidOperationException($"Expected: {expected}; Actual: {Actual}");
+ throw new InvalidOperationException($"Expected: {expected}; Actual: {actual}");
}
}
}
diff --git a/src/tests/JIT/Math/Generic/Program.cs b/src/tests/JIT/Math/Generic/Program.cs
index b39408d67c587..fbd63b8795dca 100644
--- a/src/tests/JIT/Math/Generic/Program.cs
+++ b/src/tests/JIT/Math/Generic/Program.cs
@@ -22,8 +22,9 @@ private static int Test(Action action)
{
action();
}
- catch
+ catch (Exception e)
{
+ Console.WriteLine(e);
return -1;
}