diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml
index 84b0d2fcde451..a7d4b484b1e60 100644
--- a/eng/pipelines/runtime-official.yml
+++ b/eng/pipelines/runtime-official.yml
@@ -223,12 +223,14 @@ stages:
- mono_tvos_offsets
- mono_ios_offsets
- mono_maccatalyst_offsets
+ - mono_osx_offsets
monoCrossAOTTargetOS:
- Android
- Browser
- tvOS
- iOS
- MacCatalyst
+ - OSX
isOfficialBuild: ${{ variables.isOfficialBuild }}
extraStepsTemplate: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
extraStepsParameters:
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index 931a65a05e11e..c594f806ec611 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -209,6 +209,7 @@ jobs:
- tvOS_arm64
- iOS_arm64
- MacCatalyst_x64
+ - OSX_x64
jobParameters:
condition: >-
or(
@@ -643,12 +644,14 @@ jobs:
- mono_tvos_offsets
- mono_ios_offsets
- mono_maccatalyst_offsets
+ - mono_osx_offsets
monoCrossAOTTargetOS:
- Android
- Browser
- tvOS
- iOS
- MacCatalyst
+ - OSX
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj
index 05aae6167007c..d96272e8e8fd6 100644
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj
@@ -7,6 +7,7 @@
$(MonoAotTargets);tvossimulator-x64;tvossimulator-arm64;tvos-arm64
$(MonoAotTargets);iossimulator-x64;iossimulator-arm64;iossimulator-x86;ios-arm64;ios-arm
$(MonoAotTargets);maccatalyst-x64;maccatalyst-arm64
+ $(MonoAotTargets);osx-x64;osx-arm64
diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt
index 4c25d97b7a5d9..f6d36356f5a18 100644
--- a/src/mono/CMakeLists.txt
+++ b/src/mono/CMakeLists.txt
@@ -119,7 +119,11 @@ if(NOT AOT_TARGET_TRIPLE STREQUAL "")
set(MONO_OFFSETS_FILE "${AOT_OFFSETS_FILE}")
endif()
if(AOT_TARGET_TRIPLE STREQUAL "x86_64-apple-darwin10")
- set(TARGET_SYSTEM_NAME "iOS")
+ if(REAL_TARGET_OS STREQUAL "osx")
+ set(TARGET_SYSTEM_NAME "Darwin")
+ else()
+ set(TARGET_SYSTEM_NAME "iOS")
+ endif()
set(TARGET_ARCH "x86_64")
elseif(AOT_TARGET_TRIPLE STREQUAL "i386-apple-darwin10")
set(TARGET_SYSTEM_NAME "iOS")
@@ -138,6 +142,9 @@ if(NOT AOT_TARGET_TRIPLE STREQUAL "")
set(TARGET_SYSTEM_NAME "Darwin")
set(TARGET_ARCH "arm64")
set(TARGET_MACCAT 1)
+ elseif(AOT_TARGET_TRIPLE STREQUAL "aarch64-apple-darwin20")
+ set(TARGET_SYSTEM_NAME "Darwin")
+ set(TARGET_ARCH "arm64")
elseif(AOT_TARGET_TRIPLE STREQUAL "wasm32-unknown-none")
set(TARGET_SYSTEM_NAME "Emscripten")
set(TARGET_ARCH "wasm")
diff --git a/src/mono/mono.proj b/src/mono/mono.proj
index a329c0ac29940..08434656798db 100644
--- a/src/mono/mono.proj
+++ b/src/mono/mono.proj
@@ -45,6 +45,7 @@
true
true
true
+ true
true
true
$([MSBuild]::NormalizeDirectory('$(MonoObjDir)', 'cross'))
@@ -524,7 +525,7 @@
-
+
true
$(XcodeDir)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(iOSVersion).sdk
@@ -544,8 +545,16 @@
aarch64-apple-maccatalyst
x86_64-apple-maccatalyst
-
+
+ true
+ $(XcodeDir)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
+ $(MonoObjCrossDir)offsets-$(Platform)-darwin.h
+ aarch64-apple-darwin20
+ x86_64-apple-darwin10
+
+
+
diff --git a/src/mono/mono/tools/offsets-tool/offsets-tool.py b/src/mono/mono/tools/offsets-tool/offsets-tool.py
index 0c9dff64d2b79..ad5794190d637 100644
--- a/src/mono/mono/tools/offsets-tool/offsets-tool.py
+++ b/src/mono/mono/tools/offsets-tool/offsets-tool.py
@@ -164,6 +164,13 @@ def require_emscipten_path (args):
self.target = Target ("TARGET_ARM64", "TARGET_MACCAT", IOS_DEFINES)
self.target_args += ["-target", "arm64-apple-ios14.2-macabi"]
self.target_args += ["-isysroot", args.sysroot]
+
+ # MacOS
+ elif "aarch64-apple-darwin20" == args.abi:
+ require_sysroot (args)
+ self.target = Target ("TARGET_ARM64", "TARGET_OSX", IOS_DEFINES)
+ self.target_args += ["-arch", "arm64"]
+ self.target_args += ["-isysroot", args.sysroot]
# watchOS
elif "armv7k-apple-darwin" == args.abi:
@@ -222,6 +229,7 @@ def run_clang(self):
args.mono_path + "/mono",
args.mono_path + "/mono/eglib",
args.target_path,
+ args.target_path + "/mono",
args.target_path + "/mono/eglib"
]
diff --git a/src/mono/monoaotcross.proj b/src/mono/monoaotcross.proj
index cc8adc6c580f3..8a32ffe1fbd97 100644
--- a/src/mono/monoaotcross.proj
+++ b/src/mono/monoaotcross.proj
@@ -9,11 +9,13 @@
<_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+tvos+'))">$(_MonoCrossAOTTargetOS)+tvos+
<_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+ios+'))">$(_MonoCrossAOTTargetOS)+ios+
<_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+maccatalyst+'))">$(_MonoCrossAOTTargetOS)+maccatalyst+
+ <_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+osx+'))">$(_MonoCrossAOTTargetOS)+osx+
$(MonoAotTargets);Android-x64;Android-arm64;Android-x86;Android-arm
$(MonoAotTargets);Browser-wasm
$(MonoAotTargets);tvOSSimulator-x64;tvOSSimulator-arm64;tvOS-arm64
$(MonoAotTargets);iOSSimulator-x64;iOSSimulator-arm64;iOSSimulator-x86;iOS-arm64;iOS-arm
$(MonoAotTargets);MacCatalyst-x64;MacCatalyst-arm64
+ $(MonoAotTargets);osx-x64;osx-arm64