GithubHelp home page GithubHelp logo

isabella232 / rust-bitcode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mobilecoinofficial/rust-bitcode

0.0 0.0 0.0 29 KB

Rust toolchain for Xcode-compatible iOS bitcode

License: Apache License 2.0

Shell 100.00%

rust-bitcode's Introduction

Rust toolchain for Xcode-compatible iOS bitcode

In standard releases of Rust, the bitcode in ARM64 iOS targets is often incompatible with Xcode because they use different versions of LLVM. This is a known issue with no clear long-term solution yet.

This repository contains scripts for building and installing a custom Rust nightly toolchain where the Rust compiler's version of LLVM matches Xcode. Software built using this toolchain can be included in bitcode-enabled apps that will install on real iOS devices.

Binary releases of the toolchain will be created periodically and attached to this repository, at least until there is a better upstream solution.

This repository is maintained by Ditto. We use it ourselves and want to share it for the benefit of the Rust iOS community! Please create an issue if you notice any problems.

These scripts work for 64-bit iOS only. watchOS and tvOS are not fully supported by Rust yet.

Pre-compiled releases

Visit the releases page and download a zip file. It will have a name of the form rust-ios-arm64-xxx.zip.

Unzip the file and open a terminal to the extracted directory. Run the installation script:

./install.sh

This will install the toolchain in ~/.rustup/toolchains/ios-arm64-xxx.

Build from source

  1. Ensure required build tools are installed. If you are using homebrew: brew install ninja cmake
  2. Clone this repository.
  3. Review config.sh to make sure the the Rust and LLVM versions are suitable.
  4. In a terminal, run ./build.sh. This will clone the Rust and LLVM repositories under build/ and compile them. The toolchain will end up at build/rust-build/build/x86_64-apple-darwin/stage2.
  5. Run ./install.sh. This will install the toolchain in ~/.rustup/toolchains/rust-ios-arm64-1.46.0, making it available in rustup.

Using the toolchain

Build your library like this:

cargo +ios-arm64-1.46.0 build --target aarch64-apple-ios --release --lib

License

The shell scripts in this repository are made available under the permissive Apache 2.0 licence. Refer to the file LICENSE.

Binary releases contain LLVM and Rust. See LICENSE-LLVM and LICENSE-RUST for their respective licenses. These licenses are included in the binary releases.

rust-bitcode's People

Contributors

danielhenrymantilla avatar hamchapman avatar nerosnm avatar pruthvikar avatar sinhpham avatar thombles avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.