Build/Firefox For Apple Arm

From MozillaWiki
< Build
Revision as of 20:26, 10 February 2021 by Mhentges (talk | contribs) (Ports Firefox + Apple Arm instructions from this Google Doc: https://docs.google.com/document/d/1N5yfEVEISofMmjAxfj3xXONGwyQYBSilsfXqux_M6TM/edit#)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Building Firefox to run on Arm macOS machines is less straightforward than for x86-64 macOS machines.

Using these instructions, you can either build directly on an Arm macOS machine, or cross-compile from one that is x86-64.

Building on Arm macOS

  1. If you installed Rust with older instructions, start by uninstall rustup: rustup self uninstall
  2. Install Rust via https://rustup.rs.
  3. Install Rosetta 2: softwareupdate --install-rosetta
  4. ./mach bootstrap doesn't work here, so we need to do some manual steps:
    1. ./mach create-mach-environment. Ignore the error.
    2. ./mach artifact toolchain --from-build macosx64-node
    3. mv node ~/.mozbuild
  5. ./mach build. It should take about 30 minutes on a DTK, or less than 20 minutes on a M1 Mac Mini or Macbook pro. If it takes more, ensure you have nothing else than node running as Intel (check the activity monitor during the build).

Building on x86-64 macOS

  1. Install Xcode >= 12.3 or corresponding Command Line Tools.
  2. ./mach bootstrap
  3. rustup update
  4. rustup target add aarch64-apple-darwin
  5. Create a mozconfig file at the top of your repository with ac_add_options --target=aarch64 as the contents.
  6. ./mach build
  7. ./mach package to create a .dmg to copy to your Apple Silicon machine