From a38a003b7be858d09376c09c00cf04f942c2d4df Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 19 Jun 2020 01:46:57 -0700 Subject: [PATCH 1/6] Make native args disabled for Windows ARM --- .../src/System.Private.CoreLib/src/System/ArgIterator.cs | 2 +- src/coreclr/src/jit/target.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs b/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs index 8c7039e557b457..f59fdb44591a71 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs @@ -25,7 +25,7 @@ public ref struct ArgIterator private IntPtr ArgPtr; // Pointer to remaining args. private int RemainingArgs; // # of remaining args. -#if TARGET_WINDOWS // Native Varargs are not supported on Unix +#if (TARGET_WINDOWS && !TARGET_ARM) // Native Varargs are not supported on Unix / Windows ARM [MethodImpl(MethodImplOptions.InternalCall)] private extern ArgIterator(IntPtr arglist); diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h index 78384435c5490a..bba56e0c86e4eb 100644 --- a/src/coreclr/src/jit/target.h +++ b/src/coreclr/src/jit/target.h @@ -6,7 +6,7 @@ #ifndef TARGET_H_ #define TARGET_H_ -#if defined(TARGET_UNIX) +#if defined(TARGET_UNIX) || defined(TARGET_ARM) #define FEATURE_VARARG 0 #else #define FEATURE_VARARG 1 From a72da219bb3bad8abece7407c08d55aafcbd31d5 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 19 Jun 2020 01:49:47 -0700 Subject: [PATCH 2/6] Re-enable the ARgIteratorTests for Windows ARM --- .../System.Runtime/tests/System/ArgIteratorTests.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs b/src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs index 5508c1330ccc51..1ad30e5c861750 100644 --- a/src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs +++ b/src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Microsoft.DotNet.XUnitExtensions; using System.Globalization; using System.Reflection; using Xunit; @@ -91,12 +90,6 @@ private static void VerifyTypes(Type[] types, __arglist) [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsArgIteratorNotSupported))] public static unsafe void ArgIterator_Throws_PlatformNotSupportedException() { - if (PlatformDetection.IsWindows && PlatformDetection.IsArmProcess) - { - // Active Issue: https://github.com/dotnet/runtime/issues/35754 - throw new SkipTestException("ArgIterator doesn't throw not supported in ArmProcess"); - } - Assert.Throws(() => new ArgIterator(new RuntimeArgumentHandle())); Assert.Throws(() => { fixed (void* p = "test") From 0ed477037438ad23d0fd930d6e71485c4923801c Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 19 Jun 2020 01:53:03 -0700 Subject: [PATCH 3/6] Update the comment to be more specific --- .../src/System.Private.CoreLib/src/System/ArgIterator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs b/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs index f59fdb44591a71..d391aeed81a18c 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs @@ -25,7 +25,7 @@ public ref struct ArgIterator private IntPtr ArgPtr; // Pointer to remaining args. private int RemainingArgs; // # of remaining args. -#if (TARGET_WINDOWS && !TARGET_ARM) // Native Varargs are not supported on Unix / Windows ARM +#if (TARGET_WINDOWS && !TARGET_ARM) // Native Varargs are not supported on Unix (all architectures) and Windows ARM [MethodImpl(MethodImplOptions.InternalCall)] private extern ArgIterator(IntPtr arglist); From 79f644e0c24c15f8f8f172dd10797bd5e92cddf5 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 19 Jun 2020 11:28:19 -0700 Subject: [PATCH 4/6] flip the #ifdef condition --- src/coreclr/src/jit/target.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h index bba56e0c86e4eb..0f7b6920207c4d 100644 --- a/src/coreclr/src/jit/target.h +++ b/src/coreclr/src/jit/target.h @@ -6,10 +6,11 @@ #ifndef TARGET_H_ #define TARGET_H_ -#if defined(TARGET_UNIX) || defined(TARGET_ARM) -#define FEATURE_VARARG 0 -#else + // Native Varargs are not supported on Unix (all architectures) and Windows ARM +#if (TARGET_WINDOWS && !TARGET_ARM) #define FEATURE_VARARG 1 +#else +#define FEATURE_VARARG 0 #endif /*****************************************************************************/ From 99aeb9c54a12ae3de009d0a5119de2a35c7ed4b3 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 19 Jun 2020 11:36:36 -0700 Subject: [PATCH 5/6] make #ifdef consistent --- src/coreclr/src/jit/target.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h index 0f7b6920207c4d..296106c03f6462 100644 --- a/src/coreclr/src/jit/target.h +++ b/src/coreclr/src/jit/target.h @@ -7,7 +7,7 @@ #define TARGET_H_ // Native Varargs are not supported on Unix (all architectures) and Windows ARM -#if (TARGET_WINDOWS && !TARGET_ARM) +#if defined(TARGET_WINDOWS) && !defined(TARGET_ARM) #define FEATURE_VARARG 1 #else #define FEATURE_VARARG 0 From 4519e3ca07e410ff89382ee5f7789b64960a0031 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 19 Jun 2020 12:32:39 -0700 Subject: [PATCH 6/6] formatting --- src/coreclr/src/jit/target.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h index 296106c03f6462..07bb845790acee 100644 --- a/src/coreclr/src/jit/target.h +++ b/src/coreclr/src/jit/target.h @@ -6,7 +6,7 @@ #ifndef TARGET_H_ #define TARGET_H_ - // Native Varargs are not supported on Unix (all architectures) and Windows ARM +// Native Varargs are not supported on Unix (all architectures) and Windows ARM #if defined(TARGET_WINDOWS) && !defined(TARGET_ARM) #define FEATURE_VARARG 1 #else