amiga-bootcamp/13_toolchain/gcc_amiga.md
Ilia Sharin 21751c0025 docs(amiga): complete AmigaOS 3.1/3.2 developer reference — 172 files across 17 sections
Comprehensive technical documentation covering:
- Hardware: OCS/ECS/AGA custom chip registers, Copper & Blitter deep dives
- Boot sequence: cold boot through startup-sequence
- Binary format: HUNK executable spec, relocation, debug info
- Linking & ABI: .fd files, LVO tables, register calling conventions
- Exec kernel: tasks, interrupts, memory, signals, semaphores
- AmigaDOS: file I/O, FFS/OFS layout, CLI/Shell scripting
- Graphics: planar bitmaps, Copper programming, HAM/EHB modes
- Intuition: screens, windows, IDCMP, BOOPSI
- Devices: trackdisk, SCSI, serial, timer, audio, keyboard
- Libraries: utility, expansion, IFFParse, locale, ARexx
- Networking: bsdsocket API, SANA-II, TCP/IP stack comparison
- Toolchain: GCC, vasm/vlink, SAS/C, NDK, debugging
- Reverse engineering: IDA/Ghidra setup, compiler fingerprints, case studies
- CPU & MMU: 68040/060 emulation libs, PMMU, cache management
- Driver development: SANA-II, Picasso96/RTG, AHI audio

All files include breadcrumb navigation. No local paths or proprietary content.
2026-04-23 12:17:35 -04:00

2.1 KiB

← Home · Toolchain

m68k-amigaos-gcc — Cross-Compiler

Overview

m68k-amigaos-gcc is the GCC-based cross-compiler for AmigaOS, typically based on GCC 2.95 (legacy) or GCC 6.5 (bebbo's fork). It produces Amiga hunk-format executables and supports all 68k variants.


Installation (bebbo's toolchain)

# Docker-based (recommended):
docker pull bebbo/amiga-gcc
docker run -v $(pwd):/work bebbo/amiga-gcc m68k-amigaos-gcc -o hello hello.c

# Native build (Linux/macOS):
# NOTE: bebbo removed his repos from GitHub. Use Codeberg or his personal git:
git clone https://codeberg.org/bebbo/amiga-gcc.git
# Mirror: https://franke.ms/git/bebbo/amiga-gcc
cd amiga-gcc
make update
make all -j$(nproc)
# Installs to /opt/amiga/

Usage

# Compile and link:
m68k-amigaos-gcc -noixemul -o hello hello.c

# Common flags:
#   -noixemul       — use libnix (no ixemul.library dependency)
#   -m68000          — target 68000 (default)
#   -m68020          — target 68020+
#   -m68040          — target 68040
#   -m68060          — target 68060
#   -m68881          — use 68881/68882 FPU
#   -Os              — optimise for size
#   -O2              — optimise for speed
#   -fomit-frame-pointer — free up A5
#   -fbaserel        — base-relative addressing (small data model)
#   -resident        — generate resident-capable code
#   -g               — include debug info (HUNK_DEBUG)
#   -s               — strip symbols

Startup Code

Startup Description
libnix Minimal C runtime, no shared library dependency
ixemul Unix-like C runtime (requires ixemul.library)
crt0.o Raw startup — no C runtime at all

Inline/Pragma System Calls

/* Use inline headers to call library functions via registers: */
#include <inline/exec.h>
#include <inline/dos.h>

/* Or use proto headers (auto-select inline vs pragma): */
#include <proto/exec.h>
#include <proto/dos.h>

References