Documentation Index Fetch the complete documentation index at: https://mintlify.com/n64decomp/sm64/llms.txt
Use this file to discover all available pages before exploring further.
Linux is the primary supported platform for building the SM64 decompilation. The build system requires a MIPS cross-compiler toolchain, Python 3.6 or later, and standard build tools. Most major distributions package everything you need.
Prerequisites
The build system requires:
A MIPS binutils cross-compiler toolchain
pkgconf (or pkg-config)
Python 3.6 or later
Standard C build tools (gcc, make, etc.)
Ensure the full path to your cloned repository does not exceed 255 characters. Paths longer than this limit will cause build errors.
Install dependencies
Debian / Ubuntu
Arch Linux
Fedora / RHEL / Other
Install build dependencies
Run the following command to install all required packages in one step: sudo apt install -y binutils-mips-linux-gnu build-essential git pkgconf python3
This installs the mips-linux-gnu- prefixed toolchain, which the Makefile detects automatically.
Clone the repository
Clone the SM64 repo from within your Linux environment: git clone https://github.com/n64decomp/sm64.git
cd sm64
Place the baserom
Copy your original SM64 ROM into the project directory. The filename must match the version you intend to build: # Replace <VERSION> with jp, us, eu, sh, or cn
cp /path/to/your/rom.z64 baserom. < VERSIO N > .z64
For example, to build the North American version: cp /path/to/sm64.z64 baserom.us.z64
Build the ROM
Run make to build. The default version is us. Use -j to parallelize the build across CPU cores: Default (US version)
Japanese version, 4 jobs
EU version, skip hash check
Build artifacts are written to the build/ directory. The final ROM is build/<VERSION>/sm64.<VERSION>.z64.
Install base build tools
Install the base development group and Python from the official repositories: sudo pacman -S base-devel python
Install MIPS binutils from the AUR
Install the mips64-elf-binutils package from the AUR. Using an AUR helper such as yay: yay -S mips64-elf-binutils
Or build it manually: git clone https://aur.archlinux.org/mips64-elf-binutils.git
cd mips64-elf-binutils
makepkg -si
This installs the mips64-elf- prefixed toolchain, which the Makefile detects automatically.
Clone the repository
git clone https://github.com/n64decomp/sm64.git
cd sm64
Place the baserom
Copy your original SM64 ROM into the project directory with the correct version suffix: cp /path/to/your/rom.z64 baserom.us.z64
Build the ROM
Default (US version)
Japanese version, 4 jobs
Build artifacts are written to the build/ directory.
Identify your MIPS toolchain
Different distributions ship binutils under different cross-compiler prefixes. The Makefile probes for them in this order: Prefix Typical distro mips-linux-gnu-Ubuntu, Debian, and derivatives mips64-linux-gnu-Fedora, RHEL, CentOS mips64-elf-Arch Linux (AUR)
Install whichever package provides one of these prefixes on your distribution. On Fedora/RHEL: sudo dnf install gcc make python3 pkgconf binutils-mips64-linux-gnu
If your distribution does not ship any of these toolchain variants, use the Docker-based build instead.
Clone the repository
git clone https://github.com/n64decomp/sm64.git
cd sm64
Place the baserom
Copy your original SM64 ROM into the project directory: cp /path/to/your/rom.z64 baserom.us.z64
Build the ROM
If the Makefile cannot auto-detect your toolchain prefix, supply it explicitly with the CROSS variable: Auto-detected toolchain
Explicit toolchain prefix
Build artifacts are written to the build/ directory.
Verifying the build
After a successful build the ROM is written to build/<VERSION>/sm64.<VERSION>.z64. By default (COMPARE=1) the Makefile checks the SHA-1 hash of the output against the known-good hash for each version:
Version Expected SHA-1 jp8a20a5c83d6ceb0f0506cfc9fa20d8f438cafe51us9bef1128717f958171a4afac3ed78ee2bb4e86ceeu4ac5721683d0e0b6bbb561b58a71740845dceea9sh3f319ae697533a255a1003d09202379d78d5a2e0cn2e1db2780985a1f068077dc0444b685f39cd90ec
A hash mismatch is expected when you make code changes and is not an error. Set COMPARE=0 to silence the check while modifying the codebase.