Skip to content

Setup Amiga Compiler

Andrew Smalley edited this page Feb 22, 2026 · 1 revision

Setup Amiga Compiler (m68k-amigaos-gcc + vc)

This page documents a full, repeatable setup for the Amiga cross-toolchain used by this repo, including both:

  • m68k-amigaos-gcc (GNU cross compiler)
  • vc (VBCC frontend used by some legacy Amiga-side tools)

Why both compilers matter

  • Most Amiga-side code in this tree builds with m68k-amigaos-gcc.
  • Some legacy tools (for example src/platforms/amiga/pistorm-dev/pistorm_dev_amiga GUI) still expect VBCC-style flow and vc.

If vc is missing, GUI builds may fail even when GCC works.

Prerequisites (Debian/Ubuntu)

sudo apt update
sudo apt install -y make wget git gcc g++ lhasa \
  libgmp-dev libmpfr-dev libmpc-dev flex bison gettext texinfo \
  ncurses-dev autoconf rsync libreadline-dev

Prepare /opt/amiga permissions (non-root workflow)

Use this if you want regular builds as user smalley (recommended):

sudo mkdir -p /opt/amiga
sudo chown -R smalley:smalley /opt/amiga

Get toolchain sources

mkdir -p /opt/amiga/src
cd /opt/amiga/src
git clone https://github.com/bebbo/amiga-gcc m68k-amigaos-gcc
cd m68k-amigaos-gcc
make update

Build and install the full toolchain

The build installs directly into /opt/amiga (no separate make install step).

cd /opt/amiga/src/m68k-amigaos-gcc
make clean
make drop-prefix
time make all -j4

Fast path: build only missing VBCC/VLINK

If GCC already exists and only vc is missing:

cd /opt/amiga/src/m68k-amigaos-gcc
make vbcc vlink -j4

Known fix for make vbcc failure (readlink implicit declaration)

On newer host toolchains, VBCC build can fail with:

frontend/vc.c: error: implicit declaration of function 'readlink'

Use:

cd /opt/amiga/src/m68k-amigaos-gcc
make vbcc CC='gcc -D_DEFAULT_SOURCE -std=c9x' -j4
make vlink CC='gcc -D_DEFAULT_SOURCE -std=c9x' -j4

This keeps VBCC's expected C dialect while restoring the needed libc prototypes.

Add toolchain to PATH

echo 'export PATH=/opt/amiga/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Verify install

which m68k-amigaos-gcc
which vc
which vlink

m68k-amigaos-gcc --version
vc.config

Expected:

  • m68k-amigaos-gcc, vc, vlink all resolve from /opt/amiga/bin.
  • vc.config exists and prints config/help text.

Repo-specific checks

PiStorm dev tools (Amiga side)

cd /home/smalley/pistorm64/src/platforms/amiga/pistorm-dev/pistorm_dev_amiga
make

For GUI tool:

BUILD_PISTORM_GUI=1 make

Note:

  • GUI build also needs ReqTools pieces on the Amiga side (reqtools.library).
  • This repo contains libs13/reqtools.library and libs20/reqtools.library for install/use on Amiga.

Troubleshooting quick list

  • vc: command not found
    • vc is not installed; run make vbcc.
  • vc.config exists but vc does not
    • previous toolchain build was partial; rebuild VBCC (make vbcc CC='gcc -D_DEFAULT_SOURCE -std=c9x').
  • permissions problems under /opt/amiga
    • avoid mixed root/user ownership; fix with sudo chown -R smalley:smalley /opt/amiga.
  • headers/libs not found in Amiga builds
    • verify /opt/amiga/bin is in PATH, and NDK headers/libs are present under /opt/amiga/include and /opt/amiga/lib.

Clone this wiki locally