From ce11d0c7701006e9dea72527972982dde6b22944 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 6 Oct 2021 08:19:43 +0200 Subject: [PATCH 1/2] [introspection] Skip verifying the objc_msgSend[Super]_stret on all platforms. Now that macOS runs on AMR64 (and also the simulators soon), we need to have to same logic for all platforms. Fixes: Introspection.iOSApiPInvokeTest [FAIL] Could not find the field 'objc_msgSend_stret' in /usr/lib/libobjc.dylib [FAIL] Could not find the field 'objc_msgSendSuper_stret' in /usr/lib/libobjc.dylib [FAIL] SymbolExists : 2 errors found in 5300 functions validated: objc_msgSend_stret, objc_msgSendSuper_stret Expected: 0 But was: 2 at Introspection.ApiPInvokeTest.SymbolExists() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/introspection/ApiPInvokeTest.cs:line 182 --- tests/introspection/ApiPInvokeTest.cs | 7 +++++++ tests/introspection/iOS/iOSApiPInvokeTest.cs | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/introspection/ApiPInvokeTest.cs b/tests/introspection/ApiPInvokeTest.cs index 1a54008d69f1..9fba4f0654b3 100644 --- a/tests/introspection/ApiPInvokeTest.cs +++ b/tests/introspection/ApiPInvokeTest.cs @@ -124,6 +124,13 @@ protected virtual bool CheckForEnumParameter (MethodInfo mi, ParameterInfo pi) protected virtual bool Skip (string symbolName) { + switch (symbolName) { + // it's not needed for ARM64/ARM64_32 and Apple does not have stubs for them in libobjc.dylib + // also the linker normally removes them (unreachable due to other optimizations) + case "objc_msgSend_stret": + case "objc_msgSendSuper_stret": + return true; + } return false; } diff --git a/tests/introspection/iOS/iOSApiPInvokeTest.cs b/tests/introspection/iOS/iOSApiPInvokeTest.cs index 2e063019776a..1dd76864dfdd 100644 --- a/tests/introspection/iOS/iOSApiPInvokeTest.cs +++ b/tests/introspection/iOS/iOSApiPInvokeTest.cs @@ -59,10 +59,6 @@ protected override bool Skip (string symbolName) case "CVPixelBufferGetIOSurface": case "CVPixelBufferCreateWithIOSurface": return simulator && !TestRuntime.CheckXcodeVersion (11, 0); - // it's not needed for ARM64/ARM64_32 and Apple does not have stubs for them in libobjc.dylib - case "objc_msgSend_stret": - case "objc_msgSendSuper_stret": - return !simulator; default: // MLCompute not available in simulator as of Xcode 12 beta 3 From 4bd6a6c19c18f4f29fe0c1fc69c47af1db094cb4 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 7 Oct 2021 09:17:36 +0200 Subject: [PATCH 2/2] Call the base implementation in MacApiInvokeTest.Skip --- tests/introspection/Mac/MacApiPInvokeTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/introspection/Mac/MacApiPInvokeTest.cs b/tests/introspection/Mac/MacApiPInvokeTest.cs index 5aa7fe2faa8a..5762ba5fe5f3 100644 --- a/tests/introspection/Mac/MacApiPInvokeTest.cs +++ b/tests/introspection/Mac/MacApiPInvokeTest.cs @@ -63,7 +63,7 @@ protected override bool Skip (string symbolName) case "SKTerminateForInvalidReceipt": // Only there for API compat return !IsUnified; } - return false; + return base.Skip (symbolName); } protected override bool SkipAssembly (Assembly a)