Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#63467 - terhechte:support-ios-catalyst-maca…
…bi-target-triple, r=estebank Add Catalyst (iOS apps running on macOS) target This is a first attempt of adding support for the new [Apple Catalyst](https://developer.apple.com/ipad-apps-for-mac/) target (i.e. running iOS apps on macOS). Currently, `rustc` supports the iOS and iOS simulator targets for iOS: - iOS: ARM cpu, iOS SDK, linked agains the iOS ABI - Simulator: X86_64 cpu, iOS SDK, linked against the iOS ABI Apple Catalyst will add an additional target: - Macabi: X86_64 CPU, iOS SDK, linked again the macOS ABI. Note, it the actual SDK is the also the macOS 10.15 SDK, but the symbols are the iOS SDK symbols as they were added to macOS with 10.15. I've collected additional information via links in the open question sections below. This is way out of my comfort zone so please excuse whatever errors I may have made. # Open Questions: ## Clang Version It seems to me that `macabi` has not been merged into `clang` yet, I don't know whether that is a requirement rustc to compile, or if it is sufficient if the Clang that is used on a developers system is the correct one supporting macabi (that comes with current Xcode) ## Hardcoded iOS version `swift-llvm` actually used [x86_64-apple-ios13.0-macabi](apple/swift-llvm@3f1fd4f) as the target triple which hard-codes the current iOS version. A post on stackoverflow [points out that `MIN_IOS_VERSION` and `MIN_OSX_VERSION` should be used when compiling C code for clang (`-target x86_64-apple-ios${MIN_IOS_VERSION}-macabi`)](https://stackoverflow.com/questions/56487645/how-to-compile-a-3rd-party-library-to-be-used-with-uikit-for-mac-catalyst). However, I wasn't entirely sure how to do that in this PR. Pointers welcome. ## Data Layout I'm probably using the wrong data-layout. I don't know whether it should be the macOS version or the iOS version. This is probably easier to answer for somebody who understands these things much better than me. I just copied the iOS Simulator X86_64 version as it seems to be (based on what I understand) that Catalyst is just the simulator target build against a different SDK. # Current State 1. I got it to compile 2. I could successfully compile a `macabi` `libcore` via `cargo build --target x86_64-apple-ios-macabi` I'm not sure what needs to be done next. Supposedly I need to compile everything into a toolchain somehow that I can then test via `rustup` to make sure that a binary compiled against the toolchain also works with Catalyst. [I read this article, but I'm still lost](https://www.reddit.com/r/rust/comments/5ag60z/how_do_i_bootstrap_rust_to_crosscompile_for_a_new/d9gicr2/) and would love pointers what to do next here. # Additional Information - [Commit adding Catalyst support to the Swift Clang Fork](CocoaPods/CocoaPods#8877) - [Compiling C to Catalyst Discussion](CocoaPods/CocoaPods#8877) - [CocoaPods Discussion on Adding Catalyst support](CocoaPods/CocoaPods#8877)
- Loading branch information