Skip to content

Commit

Permalink
[NativeAOT] Enable CI for macOS x64/arm64 (#75421)
Browse files Browse the repository at this point in the history
* [NativeAOT] Enable CI for macOS x64/arm64

* Update CppCompilerAndLinker condition

* Enable NativeAOT osx-arm64 build in regular runtime pipeline

* Enable cross-compilation on macOS

* Fix HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP when cross-compiling

* Update OSVersion_ValidVersion_OSX test on NativeAOT

The test tries to validate Environment.OSVersion.Version which works correctly. RuntimeInformation.RuntimeIdentifier, however, doesn't use versioned RIDs when NativeAOT is used.

* Add hack to stop linker from corrupting DWARF CFI, bump darwin version in triple to get compact unwinding tables generated

* Bump ObjWriter packages

* Disable MessageSendTests on NativeAOT

Co-authored-by: Adeel <3840695+am11@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
3 people authored Sep 30, 2022
1 parent 85ddef1 commit c8f9f29
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 58 deletions.
64 changes: 32 additions & 32 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,69 @@
<Uri>https://github.com/dotnet/wcf</Uri>
<Sha>7f504aabb1988e9a093c1e74d8040bd52feb2f01</Sha>
</Dependency>
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22458.3">
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>8688ea2538ef1287c6619d35a26b5750d355cc18</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22458.3">
<Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>8688ea2538ef1287c6619d35a26b5750d355cc18</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22458.3">
<Dependency Name="runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>8688ea2538ef1287c6619d35a26b5750d355cc18</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22458.3">
<Dependency Name="runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>8688ea2538ef1287c6619d35a26b5750d355cc18</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22458.3">
<Dependency Name="runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>8688ea2538ef1287c6619d35a26b5750d355cc18</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22458.3">
<Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>8688ea2538ef1287c6619d35a26b5750d355cc18</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22458.3">
<Dependency Name="runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>8688ea2538ef1287c6619d35a26b5750d355cc18</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22458.3">
<Dependency Name="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.ObjWriter" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>8688ea2538ef1287c6619d35a26b5750d355cc18</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22431.4">
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>c1304304028d603e34f6803b0740c34441f80d2e</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22431.4">
<Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>c1304304028d603e34f6803b0740c34441f80d2e</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22431.4">
<Dependency Name="runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>c1304304028d603e34f6803b0740c34441f80d2e</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22431.4">
<Dependency Name="runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>754d13817d834b716d339183e21aac7d2489c496</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22431.4">
<Dependency Name="runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>c1304304028d603e34f6803b0740c34441f80d2e</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22431.4">
<Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>c1304304028d603e34f6803b0740c34441f80d2e</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22431.4">
<Dependency Name="runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>c1304304028d603e34f6803b0740c34441f80d2e</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22431.4">
<Dependency Name="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.JIT.Tools" Version="1.0.0-alpha.1.22478.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>c1304304028d603e34f6803b0740c34441f80d2e</Sha>
<Sha>2e1187ef495010c65842a001f34c46006d5a01bc</Sha>
</Dependency>
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.22355.1">
<Uri>https://github.com/dotnet/command-line-api</Uri>
Expand Down
32 changes: 16 additions & 16 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@
<MicrosoftExtensionsDependencyModelVersion>6.0.0</MicrosoftExtensionsDependencyModelVersion>
<!-- CoreClr dependencies -->
<MicrosoftNETCoreILAsmVersion>8.0.0-alpha.1.22475.4</MicrosoftNETCoreILAsmVersion>
<runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22458.3</runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxx64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22458.3</runtimelinuxx64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxmuslarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22458.3</runtimelinuxmuslarm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxmuslx64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22458.3</runtimelinuxmuslx64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimewinarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22458.3</runtimewinarm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22458.3</runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22458.3</runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22458.3</runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22478.1</runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxx64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22478.1</runtimelinuxx64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxmuslarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22478.1</runtimelinuxmuslarm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxmuslx64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22478.1</runtimelinuxmuslx64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimewinarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22478.1</runtimewinarm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22478.1</runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22478.1</runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22478.1</runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion>
<!-- Libraries dependencies -->
<MicrosoftBclAsyncInterfacesVersion>6.0.0</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftBclHashCodeVersion>1.1.1</MicrosoftBclHashCodeVersion>
Expand Down Expand Up @@ -206,13 +206,13 @@
<WixPackageVersion>1.0.0-v3.14.0.5722</WixPackageVersion>
<MonoWorkloadManifestVersion>6.0.0-preview.5.21275.7</MonoWorkloadManifestVersion>
<!-- JIT Tools -->
<runtimelinuxarm64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22431.4</runtimelinuxarm64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimelinuxx64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22431.4</runtimelinuxx64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimelinuxmuslarm64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22431.4</runtimelinuxmuslarm64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimelinuxmuslx64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22431.4</runtimelinuxmuslx64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimewinarm64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22431.4</runtimewinarm64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimewinx64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22431.4</runtimewinx64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimeosx110arm64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22431.4</runtimeosx110arm64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimeosx1012x64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22431.4</runtimeosx1012x64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimelinuxarm64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22478.1</runtimelinuxarm64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimelinuxx64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22478.1</runtimelinuxx64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimelinuxmuslarm64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22478.1</runtimelinuxmuslarm64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimelinuxmuslx64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22478.1</runtimelinuxmuslx64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimewinarm64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22478.1</runtimewinarm64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimewinx64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22478.1</runtimewinx64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimeosx110arm64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22478.1</runtimeosx110arm64MicrosoftNETCoreRuntimeJITToolsVersion>
<runtimeosx1012x64MicrosoftNETCoreRuntimeJITToolsVersion>1.0.0-alpha.1.22478.1</runtimeosx1012x64MicrosoftNETCoreRuntimeJITToolsVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion eng/native/tryrun.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if(DARWIN)
set_cache_value(SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE 1)
set_cache_value(SSCANF_SUPPORT_ll_EXITCODE 0)
set_cache_value(UNGETC_NOT_RETURN_EOF_EXITCODE 1)
set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP_EXITCODE 0)
set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP_EXITCODE 1)
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!")
endif()
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/runtime-extra-platforms-other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ jobs:
platforms:
- windows_x64
- windows_arm64
- OSX_x64
- OSX_arm64
- Linux_x64
- Linux_arm64
- Linux_musl_x64
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ jobs:
platforms:
- windows_arm64
- Linux_arm64
- OSX_arm64
jobParameters:
testGroup: innerloop
isSingleFile: true
Expand Down
4 changes: 2 additions & 2 deletions eng/testing/tests.singlefile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<PropertyGroup Condition="'$(TestNativeAot)' == 'true'">
<IlcToolsPath>$(CoreCLRILCompilerDir)</IlcToolsPath>
<IlcToolsPath Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)'">$(CoreCLRCrossILCompilerDir)</IlcToolsPath>
<CppCompilerAndLinker Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' != 'windows' and '$(RuntimeIdentifier)' == 'linux-musl-arm64'">clang-15</CppCompilerAndLinker>
<CppCompilerAndLinker Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' != 'windows' and '$(RuntimeIdentifier)' != 'linux-musl-arm64'">clang-9</CppCompilerAndLinker>
<CppCompilerAndLinker Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' == 'linux' and '$(RuntimeIdentifier)' == 'linux-musl-arm64'">clang-15</CppCompilerAndLinker>
<CppCompilerAndLinker Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' == 'linux' and '$(RuntimeIdentifier)' != 'linux-musl-arm64'">clang-9</CppCompilerAndLinker>
<SysRoot Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>
<IlcBuildTasksPath>$(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll</IlcBuildTasksPath>
<IlcSdkPath>$(CoreCLRAotSdkDir)</IlcSdkPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<OSHostArch Condition="$([MSBuild]::IsOSPlatform('Windows')) and
$([System.Environment]::GetEnvironmentVariable('PROCESSOR_ARCHITECTURE', EnvironmentVariableTarget.Machine)) == 'ARM64'">arm64</OSHostArch>

<OSHostArch Condition="$([MSBuild]::IsOSPlatform('osx')) and '$(CrossBuild)' == 'true'">x64</OSHostArch>

<IlcHostArch Condition="'$(IlcHostArch)' == ''">$(OSHostArch)</IlcHostArch>
<IlcHostPackageName>runtime.$(OSIdentifier)-$(IlcHostArch).Microsoft.DotNet.ILCompiler</IlcHostPackageName>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ The .NET Foundation licenses this file to you under the MIT license.
<FullRuntimeName Condition="'$(ServerGarbageCollection)' == 'true'">libRuntime.ServerGC</FullRuntimeName>

<CrossCompileRid />
<CrossCompileRid Condition="'$(TargetOS)' != 'OSX' and !$(RuntimeIdentifier.EndsWith('-$(OSHostArch)'))">$(RuntimeIdentifier)</CrossCompileRid>
<CrossCompileRid Condition="!$(RuntimeIdentifier.EndsWith('-$(OSHostArch)'))">$(RuntimeIdentifier)</CrossCompileRid>

<CrossCompileArch />
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-x64'))">x86_64</CrossCompileArch>
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-arm64'))">aarch64</CrossCompileArch>
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-arm64')) and '$(TargetOS)' != 'OSX'">aarch64</CrossCompileArch>
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-arm64')) and '$(TargetOS)' == 'OSX'">arm64</CrossCompileArch>

<TargetTriple />
<TargetTriple Condition="'$(CrossCompileArch)' != ''">$(CrossCompileArch)-linux-gnu</TargetTriple>
Expand Down Expand Up @@ -85,7 +86,8 @@ The .NET Foundation licenses this file to you under the MIT license.
<ItemGroup>
<LinkerArg Include="@(NativeLibrary)" />
<LinkerArg Include="--sysroot=$(SysRoot)" Condition="'$(SysRoot)' != ''" />
<LinkerArg Include="--target=$(TargetTriple)" Condition="'$(TargetTriple)' != ''" />
<LinkerArg Include="--target=$(TargetTriple)" Condition="'$(TargetOS)' != 'OSX' and '$(TargetTriple)' != ''" />
<LinkerArg Include="-arch $(CrossCompileArch)" Condition="'$(TargetOS)' == 'OSX' and '$(CrossCompileArch)' != ''" />
<LinkerArg Include="-g" Condition="$(NativeDebugSymbols) == 'true'" />
<LinkerArg Include="-Wl,--strip-debug" Condition="$(NativeDebugSymbols) != 'true' and '$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-Wl,-rpath,'$(IlcRPath)'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,18 @@ public void EmitCFICodes(int offset)
// Internal compiler error
Debug.Assert(false);
}

if (_targetPlatform.OperatingSystem == TargetOS.OSX)
{
// Emit a symbol for beginning of the frame. This is workaround for ld64
// linker bug which would produce DWARF with incorrect pcStart offsets for
// exception handling blocks if there is no symbol present for them.
//
// To make things simple we just reuse blobSymbolName and change `_lsda`
// prefix to `_fram`.
"_fram"u8.CopyTo(blobSymbolName);
EmitSymbolDef(blobSymbolName);
}
}

// Emit individual cfi blob for the given offset
Expand Down Expand Up @@ -1272,7 +1284,7 @@ private static string GetLLVMTripleFromTarget(TargetDetails target)
break;
case TargetOS.OSX:
vendor = "apple";
sys = "darwin";
sys = "darwin16";
abi = "macho";
break;
case TargetOS.WebAssembly:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,13 @@ public void OSVersion_ValidVersion_OSX()
{
Version version = Environment.OSVersion.Version;

// verify that the Environment.OSVersion.Version matches the current RID
// As of 12.0, only major version numbers are included in the RID
Assert.Contains(version.ToString(1), RuntimeInformation.RuntimeIdentifier);
// NativeAOT hard-codes the runtime identifier at build time
if (!PlatformDetection.IsNativeAot)
{
// verify that the Environment.OSVersion.Version matches the current RID
// As of 12.0, only major version numbers are included in the RID
Assert.Contains(version.ToString(1), RuntimeInformation.RuntimeIdentifier);
}

Assert.True(version.Minor >= 0, "OSVersion Minor should be non-negative");
Assert.True(version.Build >= 0, "OSVersion Build should be non-negative");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace System.Runtime.InteropServices.Tests
{
[PlatformSpecific(TestPlatforms.OSX)]
[SkipOnMono("Not currently implemented on Mono")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))] // https://github.com/dotnet/runtimelab/issues/155
public unsafe class MessageSendTests
{
private static int s_count = 1;
Expand Down

0 comments on commit c8f9f29

Please sign in to comment.