Skip to main content

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

1

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.
2

Clone the repository

Clone the SM64 repo from within your Linux environment:
git clone https://github.com/n64decomp/sm64.git
cd sm64
3

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.<VERSION>.z64
For example, to build the North American version:
cp /path/to/sm64.z64 baserom.us.z64
4

Build the ROM

Run make to build. The default version is us. Use -j to parallelize the build across CPU cores:
make
Build artifacts are written to the build/ directory. The final ROM is build/<VERSION>/sm64.<VERSION>.z64.

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:
VersionExpected SHA-1
jp8a20a5c83d6ceb0f0506cfc9fa20d8f438cafe51
us9bef1128717f958171a4afac3ed78ee2bb4e86ce
eu4ac5721683d0e0b6bbb561b58a71740845dceea9
sh3f319ae697533a255a1003d09202379d78d5a2e0
cn2e1db2780985a1f068077dc0444b685f39cd90ec
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.

Build docs developers (and LLMs) love