From d8d1d788b86a0fbc83bdb645855c591d0eaf99cc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 17:55:32 +0000 Subject: [PATCH] Fix native library loading for osx-arm64 (#17495) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc-André Moreau --- .../CoreCLR/CorePsAssemblyLoadContext.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs index 43e6ad17eb42..a776fb44207d 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs @@ -232,6 +232,9 @@ internal IEnumerable GetAssembly(string namespaceQualifiedTypeName) /// | /// |--- 'osx-x64' subfolder /// | |--- native.dylib + /// | + /// |--- 'osx-arm64' subfolder + /// | |--- native.dylib /// internal static IntPtr NativeDllHandler(Assembly assembly, string libraryName) { @@ -552,7 +555,7 @@ private static string GetNativeDllSubFolderName(out string ext) } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - folderName = "osx-x64"; + folderName = "osx-" + processArch; ext = ".dylib"; }