Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the iOS toolchain to be built on Linux #88072

Merged
merged 1 commit into from
Aug 22, 2021
Merged

Allow the iOS toolchain to be built on Linux #88072

merged 1 commit into from
Aug 22, 2021

Commits on Aug 16, 2021

  1. Allow the iOS toolchain to be built on Linux

    The iOS toolchain can be built on Linux with minor changes. The
    compilation will invoke `xcrun` to find the path to the iPhone SDK but
    a fake `xcrun` executable can be used.
    
    ```
    #!/bin/sh
    echo "/path/to/sdk"
    ```
    
    The iOS toolchain can then be built and linked with rustup.
    
    ```
    $ ./x.py build --stage 2 --host x86_64-unknown-linux-gnu \
      	 --target aarch64-apple-ios
    $ rustup toolchain link stage1 build/x86_64-unknown-linux-gnu/stage1
    ```
    
    It's possible to take this toolchain and compile an iOS executable
    with it. This requires the ld64 linker and an iOS SDK. The ld64 linker
    can be taken from
    [cctools](https://github.com/tpoechtrager/cctools-port). A project's
    .cargo/config can then be edited to use the linker for this target.
    
    ```
    [target.aarch64-apple-ios]
    linker = "/path/to/cctools/bin/arm-apple-darwin-ld"
    rustflags = [
        "-C",
        """
    link-args=
        -F/path/to/sdk/System/Library/Frameworks
        -L/path/to/sdk/usr/lib
        -L/path/to/sdk/usr/lib/system/
        -adhoc_codesign
        """,
    ]
    ```
    kit-981 committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    79e402e View commit details
    Browse the repository at this point in the history