When reverse engineering commercial console binaries built from C/C++, the first question is often which toolchain produced the code as it can make your job reverse engineering a game so much easier.
On 1990s–2000s consoles you will encounter both GCC-derived compilers and a wide variety of proprietary compilers such as:
- MIPSpro
- CodeWarrior
- Hitachi SHC
- ARM SDT/ADS
- Microsoft VC++ (including WinCE for dreamcast)
What is a Compiler Toolchain?
Compiler toolchain here means the C/C++ compiler front end plus the assembler, linker, C runtime, and some low-level runtime libraries shipped in an official SDK.
Each platform had an official prefferred compiler toolchain but this does not mean that the game you are reversing was compiled by it! Some of the main compiler toolchains for each console platform are listed in the table below:
| Platform | Primary official compilers (high-level) | Notes |
|---|---|---|
| PlayStation (PS1) | GCC-based flow in PSY-Q feeding SN Systems assembler/linker | Later PS1 builds also saw 2.8.x-based drops. 1 |
| Sega Saturn | Hitachi SHC and a bundled GNU SH-2 (GNUSH) in PSY-Q |
Teams used either; both target the same ABI. |
| Nintendo 64 | SGI IDO 5.3/7.1, KMC exeGCC, SN64 GCC and CodeWarrior | See the dedicated N64 compiler reference for versions, assembler pairings and game evidence. |
| Sega Dreamcast | Hitachi SHC via Katana; Microsoft VC++ for the WinCE path | Sega also licensed CodeWarrior late-gen; all official, non-GCC. |
| 3DO | ARM SDT / ARM C++ (proprietary) | ARM toolchains predate GBA/DS era use. |
| PlayStation 2 | ee-gcc 2.95.2, iop-gcc 2.95.x (Sony/SN builds) | GCC-based official cross tools for EE/IOP. |
| GameCube | Metrowerks CodeWarrior | Official Nintendo SDK path. |
| PSP | SNC (SN Systems) | Official compiler; GCC commonly seen only in homebrew. |
| PlayStation 3 | SNC and SCE GCC (PPU/SPU) | Two official compilers shipped side-by-side. |
Homebrew toolchains (devkitX family, etc.) are intentionally excluded from the table above.
Why is knowing the Compiler useful when reverse engineering?
Knowing the likely toolchain helps you interpret calling conventions, codegen idioms, and debug-stub artifacts.
How can I detect which compiler was used?
Specific toolchains leave stable fingerprints: stack frame layout, prologue/epilogue shapes, switch lowering, delay-slot policy, PIC setup, section naming, and archive formats. These let you move faster when mapping unknown functions.
GNU Compiler Collection (GCC)
GCC Releases by Year
The following table will list the first major version released on the specific year, this can be useful to see what versions would have been in use in a certain date period 2.
| Year | Version | Notes (GCC forks / console SDKs) |
|---|---|---|
| 1987 | 1.0 | Initial GNU C release. |
| 1988 | 1.21 | |
| 1989 | 1.35 | |
| 1990 | 1.37.1 | |
| 1991 | 1.39 | |
| 1992 | 1.41 | |
| 1993 | 2.4.x | |
| 1994 | 2.5.8 | Saturn: Sega/SN shipped a GNU C (SH-2) compiler with Psy-Q; Hitachi SH assembler also included. Jaguar: GCC was used in the Atari Jaguar SDK, specifically version 2.5.x |
| 1995 | 2.7.0 | PS1: PSY-Q used a GNU C/C++–derived backend plus SN assemblers/linker (mid-90s). |
| 1996 | 2.7.2 | Saturn: Cygnus GCC 2.7 build (Sep 1996) in circulation. |
| 1997 | 2.7.2.2 | N64 KMC exeGCC and SN64 are separate GCC-based toolchains; see the N64 compiler reference. Net Yaroze: DJGPP-based GCC 2.7.2 toolchain (released mid-90s, kits shipped 1996–97). |
| 1998 | 2.8.0 | PS1: SN Systems also distributed experimental GCC 2.8.0/2.8.1 builds. |
| 1999 | 2.95 | PS2: IOP toolchain (iop-gcc) based on GCC 2.95.x. |
| 2000 | 2.95.2 | PS2: EE toolchain (ee-gcc 2.95.2) in official SDKs. |
| 2001 | 3.0 | |
| 2002 | 3.1 | Homebrew GBA toolchains (devkitadv) used GCC; official GBA dev favoured ARM tools. |
| 2003 | 3.3 | Early DS homebrew starts settling on GCC; official tools still CodeWarrior. |
| 2004 | 3.4 | DS/Nitro: some SDK packages also exposed GCC via Cygwin. |
| 2005 | 4.0 | PSP: official SNC compiler (non-GCC); homebrew psptoolchain used GCC 4.x. |
| 2006 | 4.1 | PS3: official SDKs shipped SNC and SCE GCC (ppu-gcc/spu-gcc). IBM Cell SDK on Linux used GCC too. |
| 2007 | 4.2 | |
| 2008 | 4.3 | Wii homebrew (devkitPPC) widely GCC-based |
| 2009 | 4.4 |
PS1 PSY-Q - GCC 2.7/2.8
PSY-Q shipped with a customized GCC front end that emitted the original 32-bit MIPS I assembly consumed by SN Systems’ assembler/linker to produce a PS-X EXE PlayStation 1 executable. 1
MIPS I o32 Application Binary Interface (ABI)
The o32 ABI is the convention used by classic MIPS I CPUs like the PlayStation 1’s R3000A, defining things like argument passing, stack layout, and binary object file format. It ensures that the assembly and binaries produced by the compiler/toolchain match what the hardware and system expect.
Here are some of the rules in the o32 ABI that the compiler needs to follow:
- Args in
a0..a3, return inv0(andv1if needed) - Callee-saved:
s0..s7,sp,ra - Typical 16-byte outgoing arg area reserved in frames
Nintendo 64 GCC Toolchains
KMC exeGCC and SN Systems SN64 are separate GNU-based N64 toolchains. PARTNER-N64 is KMC’s development environment; the SN executables listed below belong to the SN64 toolchain. Package and driver version numbers should not be confused with the GCC backend version.
The dedicated reference compares these with SGI IDO, Paper Mario GCC and iQue EGCS, with sources for each family:
A leaked version of the SDK was released, distributed as GNUN6432.zip (GNU N64 for 32bit Windows) which contained the toolchain, they were compiled on 19th February 1997 based based on version 2.7.2 of GCC (2.7.2.SN32.3.7 Build 0001).
These are the files it contains:
- CC1N64.exe (1.4MB) - The GNU C Compiler based on version 2.7.2for Nintendo 64
- CC1PLN64.exe (1.8MB) - The GNU C++ Compiler based on version 2.7.2 for Nintendo 64
- CPPN64.exe (115KB) - The The C Preprocessor (GNU CPP) based on version 2.7.2 for Nintendo 64
Preserved SN64 GCC 2.7.2 builds 0001, 0004 and 0006, SN64 GCC 2.8.1, and a separate 970404 reconstruction are discussed in the N64 compiler reference.
For more information check out our post on this SDK:
Cygnus Experimental compiler (1998) - PS1 and N64
The Cygnus Experimental compiler, often associated with the EGCS (Experimental/Enhanced GNU Compiler System) project, was a fork of the GNU Compiler Collection (GCC) initiated and maintained by Cygnus Solutions in the mid-1990s.
As part of their PSY-Q SDK SN Systems released versions 2.8.0 and 2.8.1 for the Sony Playstation 1 sometime in 1998: 1
Version 2.8.1 of the compiler is now available for download, offering improved compile times over 2.8.0. PSX and N64 versions of the Cygnus Experimental compiler are also available.
We don’t know the precise date since the page was first archived on 23rd May 1998, but not sure if any other versions of GNU GCC were released for the PS1.
Cygnus 2.7 Sega SATURN Compiler Toolchain (1996)
Version 2.7 of the GNU Compiler Collection was built in September 1996 specifically for the Sega Saturn.
Recognising Toolchain-Generated Code
The archived decomp.wtf guides suggest useful patterns to investigate when reconstructing game code. Check each pattern against the target toolchain: an instruction sequence may come from an assembler expansion or runtime library rather than a function the game’s programmer wrote explicitly.
PS1 Assembler Expansions
On PlayStation, identifying the GCC version is only part of reproducing a PSY-Q build.
maspsx adapts compiler-generated assembly for GNU as to reproduce ASPSX behaviour, including version-dependent pseudo-instruction expansion 3.
A source-level division can produce checks as well as the divide itself.
Do not immediately reconstruct those checks as explicit game error handling.
Compare ASPSX versions and division-expansion settings first: maspsx documents differences involving break versus tge, instruction gaps, immediate loads and global-pointer addressing 3.
For a controlled comparison, compile a small function containing / with the project’s compiler and inspect both its assembly output and the assembled instructions.
Keep the source fixed while testing the assembler configuration.
The PSY-Q setup guide explains what to record alongside the build.
Runtime Helpers Reveal Source Operations
A compiler can implement an operation by calling a support routine. Recognising that routine helps recover the caller’s expression before spending time decompiling the library implementation.
GCC documents these default runtime names and operations 45:
| Helper | Operation to investigate in the caller |
|---|---|
__divsi3, __udivsi3 |
Signed or unsigned word-sized integer division |
__modsi3, __umodsi3 |
Signed or unsigned integer remainder |
__addsf3, __adddf3 |
Single- or double-precision addition |
__mulsf3, __muldf3 |
Single- or double-precision multiplication |
__extendsfdf2 |
Conversion from float to double |
__fixsfsi, __fixdfsi |
Floating-point to signed integer conversion, rounding toward zero |
The GCC integer-runtime documentation and floating-point-runtime documentation define the operations; targets can override helper names. Confirm the target ABI (application binary interface), arguments and return value before applying a signature 45.
For example, a call to __adddf3 suggests double-precision addition, but does not prove the original variable was declared double.
Inspect conversions feeding the call and the surrounding expression.
An unexpected helper is a reason to check operand types and floating-point build settings.
Older MSVC code can use __ftol for floating-point conversion; the decomp.wtf x86 guide highlights it as a recognition clue 6.
Do not assign it GCC’s helper signature: inspect the x87 stack and the return registers for the compiler version in use.
C++ Symbols and Calling Conventions
Compiler families also differ in symbol encoding, hidden arguments and object layout. The Ghidra C++ guide compares these clues before reconstructing a class. For 32-bit Microsoft code, the Windows guide explains how call sites help distinguish argument passing and stack cleanup.