From 76ba59032965f745926c788c879df225b9a25649 Mon Sep 17 00:00:00 2001 From: Kyungwoo Lee Date: Mon, 25 Apr 2016 11:11:14 -0700 Subject: [PATCH] ARM64: Fix NativeCallable Fixes https://github.com/dotnet/coreclr/issues/4422 The issue is that JIT didn't pass UMEntryThunk for the managed function entry point which is invoked from the native function. The fix is to enable NativeCallable attribute check to get the right entry point. --- src/vm/method.cpp | 14 +++++++++----- tests/arm64/Tests.lst | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/vm/method.cpp b/src/vm/method.cpp index ae98743..1b7aa5c 100644 --- a/src/vm/method.cpp +++ b/src/vm/method.cpp @@ -5393,18 +5393,22 @@ BOOL MethodDesc::HasNativeCallableAttribute() } CONTRACTL_END; -// enable only for amd64 now, other platforms are not tested. -#if defined(_TARGET_AMD64_) - #ifdef FEATURE_CORECLR HRESULT hr = GetMDImport()->GetCustomAttributeByName(GetMemberDef(), g_NativeCallableAttribute, NULL, NULL); - return (hr == S_OK); + if (hr == S_OK) + { + // enable only for amd64/arm64 now, other platforms are not tested. +#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_) + return TRUE; +#else + _ASSERTE(!"HasNativeCallableAttribute is not yet implemented."); +#endif // _TARGET_AMD64_ || _TARGET_ARM64_ + } #endif //FEATURE_CORECLR -#endif //_TARGET_AMD64_ return FALSE; } diff --git a/tests/arm64/Tests.lst b/tests/arm64/Tests.lst index fd3d449..17d714e 100644 --- a/tests/arm64/Tests.lst +++ b/tests/arm64/Tests.lst @@ -158,7 +158,7 @@ RelativePath=Interop\NativeCallable\NativeCallableTest\NativeCallableTest.cmd WorkingDir=Interop\NativeCallable\NativeCallableTest Expected=0 MaxAllowedDurationSeconds=600 -Categories=Pri0;RT;EXPECTED_FAIL;ISSUE_4422;REL_PASS;ASSERT_ONLY +Categories=Pri0;RT;EXPECTED_PASS HostStyle=0 [BoolTest.cmd_23] RelativePath=Interop\PrimitiveMarshalling\Bool\BoolTest\BoolTest.cmd -- 2.7.4