-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for building CoreCLR for MacCatalyst/iOS simulator (#109928)
* Make it possible to compile CoreCLR on iOS-like platforms with './build.sh clr+clr.nativeaotlibs+libs+packs -os [iossimulator/maccatalyst/ios] -arch arm64 -cross' Build the singlefilehost even if we don't currently use it Make coreclrhost.h compatible v C(not++) Fix TargetOS::IsMacOS WIP: AppleAppBuilder support for CoreCLR Make the sample app working: dotnet publish src/mono/sample/iOS/Program.csproj -c Release /p:TargetOS=iossimulator /p:TargetArchitecture=arm64 /p:AppleAppBuilderRuntime=CoreCLR /p:DeployAndRun=true /p:UseMonoRuntime=false /p:RunAOTCompilation=false /p:MonoForceInterpreter=false Cleanup Update src/tasks/AppleAppBuilder/AppleAppBuilder.csproj Co-authored-by: Adeel Mujahid <[email protected]> Use sys_icache_invalidate for all iOS-like platforms Consolidate macOS-only entrypoints in a single #if block Apply feedback Fix jitinterface cross-build Infer AppleAppBuilderRuntime from UseMonoRuntime and UseNativeAOTRuntime Minor changes to test infrastructure Add basic documentation Add nearly complete support for building runtime tests Fix building seh-unwind with older iOS SDK Use enum for TargetRuntime in AppleAppBuilder Fix LibraryBuilder build Cleanup Fix after rebase Revert accidental change Fix tvOS build Drop CoreCLR tvOS Simulator support for now * Fix rpath on MacCatalyst * Apply suggestions from code review Co-authored-by: Aaron Robinson <[email protected]> * Use CORECLR_HOSTING_API_LINKAGE for extern 'C' * Remove extra #include * Drop ICU linkage (not needed with Hybrid Globalization) * Move jit_write_protect_np initialization * Use __APPLE__ in PAL instead of TARGET_APPLE for consistency * Revert changes to native libs and exclude singlefilehost * Revert more singlefilehost changes * Remove excessive -D_XOPEN_SOURCE * Fix build with FEATURE_PERFTRACING_STANDALONE_PAL (debug libs) * Build with FEATURE_STANDALONE_GC=0 * Remove extra NativeDependencies property (bad merge) * Add back the UseNativeAOTRuntime property to unblock CI --------- Co-authored-by: Aaron Robinson <[email protected]> Co-authored-by: Milos Kotlar <[email protected]>
- Loading branch information
1 parent
0a477a8
commit 717d3b1
Showing
55 changed files
with
568 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Cross Compilation for iOS Simulator on macOS | ||
|
||
## Requirements | ||
|
||
Build requirements are the same as for building native CoreCLR on macOS. iPhone SDK has to be enabled in Xcode installation. | ||
|
||
## Cross compiling CoreCLR | ||
|
||
Build the runtime pack and tools with | ||
|
||
``` | ||
./build.sh clr+clr.runtime+libs+packs -os [iossimulator/maccatalyst] -arch [x64/arm64] -cross -c Release | ||
``` | ||
|
||
## Running the sample iOS app | ||
|
||
Build and run the sample app with | ||
|
||
``` | ||
./dotnet.sh publish src/mono/sample/iOS/Program.csproj -c Release /p:TargetOS=iossimulator /p:TargetArchitecture=arm64 /p:DeployAndRun=true /p:UseMonoRuntime=false /p:RunAOTCompilation=false /p:MonoForceInterpreter=false | ||
``` | ||
|
||
The command also produces an XCode project that can be opened with `open ./src/mono/sample/iOS/bin/iossimulator-arm64/Bundle/HelloiOS/HelloiOS.xcodeproj` and debugged in Xcode. | ||
|
||
## Running the runtime tests | ||
|
||
Build the runtime tests with | ||
|
||
``` | ||
./src/tests/build.sh -os iossimulator arm64 Release -p:UseMonoRuntime=false | ||
``` | ||
|
||
Running the tests is not implemented yet. It will likely need similar app bundle infrastructure as NativeAOT/iOS uses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.