Containerfile for AmigaOS Cross-Compiler Toolchain (MIRROR) https://amiga.technology/
  • Shell 96.8%
  • Dockerfile 3.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Stefan Reinauer b7cf3f8509 ppc-amigaos: Build the vbcc target from AmigaPorts/vbcc's source
AmigaPorts/vbcc now carries the sources of the ppc-amigaos target
(startup code, vclib and the other libraries, headers) and a config for
Unix hosts that names each tool and file by its path.  Build vbccppc
and then the target from the vbcc checkout, with the vasm, vlink,
binutils and SDK installed before, instead of downloading the target
archive and rewriting its AmigaOS config.  The target's install puts
its headers and libraries into ppc-amigaos/vbcc/{include,lib}, as
m68k-amigaos has them, and the config beside vc as aosppc and
vc.config.  As vc reads its config from beside itself, install vc
itself in bin and drop the wrapper that set VBCC and PATH, as d305e66
did for m68k-amigaos.
2026-11-15 16:57:13 -08:00
.github/workflows Add an example zprofile 2026-10-30 09:02:09 -07:00
.dockerignore Drop the Dockerfile symlink 2026-10-12 10:09:11 +02:00
.gitignore Add Linux Amiga GCC build script 2026-05-19 20:58:29 -07:00
build.sh build: use the toolchain's vbcc as it installs it 2026-11-10 21:03:19 -08:00
Containerfile ppc-amigaos: Write the verification programs inline, really 2026-10-29 21:53:01 -07:00
copy_to_dockerhub.sh copy_to_dockerhub.sh: Copy the release images too 2026-10-29 21:14:25 -07:00
install_flexcat.sh flexcat: fetch host sources from AmigaPorts 2026-08-27 21:17:01 -07:00
install_release.sh install_release.sh: Check the staging directory as root 2026-10-29 20:12:36 -07:00
ppc-amigaos.sh ppc-amigaos: Build the vbcc target from AmigaPorts/vbcc's source 2026-11-15 16:57:13 -08:00
README.md build: use the toolchain's vbcc as it installs it 2026-11-10 21:03:19 -08:00
registry.conf copy_to_dockerhub.sh: Keep amigappc-gcc:latest on the ppc-amigaos image 2026-10-27 10:59:12 -07:00
update_docker.sh Release tags: reject what would silently build something else 2026-10-28 23:43:49 -07:00
zprofile Add an example zprofile 2026-10-30 09:02:09 -07:00

amiga-gcc toolchains for Linux and macOS

Build scripts, container images and prebuilt archives for the AmigaPorts m68k-amigaos-gcc cross toolchain (the continuation of Stefan "Bebbo" Franke's amiga-gcc), and for the AmigaPorts ppc-amigaos (AmigaOS 4) cross toolchain.

One script, build.sh, builds the toolchain on Linux and macOS. The container image and the release archives are both produced with it, so all three ways of getting the toolchain give you the same installation.

Supported GCC versions:

Version amiga-gcc branch
6.5.0b amiga6
13.4 amiga13.4
16.2 amiga16.2

ppc-amigaos GCC 16.2 is built from the same AmigaPorts gcc branch, amiga16.2, and binutils 2.46 from the AmigaPorts binutils-gdb branch amiga-2.46.

What is included

Each m68k-amigaos installation is a self-contained prefix with:

  • GCC (C and C++) and binutils for m68k-amigaos, with HUNK LTO support
  • GDB, vasm (for 68k, and vasmppc_std for PowerPC), vlink and vbcc
  • libnix, ixemul, clib2, libpthread, libdebug and the AmigaOS NDK (3.2 by default)
  • zlib, libpng and FreeType built for every multilib
  • amitools (reinauer/amitools, Drop_AccessStruct), including the Vamos AmigaOS emulator, xdftool, romtool and hunktool
  • FlexCat, fd2sfd, fd2pragma, sfdc, ira and gencrc

Each ppc-amigaos installation has:

  • GCC (C and C++) and binutils for ppc-amigaos
  • the AmigaOS 4 SDK (54.16 by default), downloaded from Hyperion, with its newlib runtime
  • clib2 from AmigaPorts and clib4, built with the new compiler
  • vbcc for ppc-amigaos (vc), with vasmppc_std and vlink
  • lha

Getting the toolchain

Container image

Images are published on Docker Hub, with the same tags mirrored to the GitHub Container Registry (ghcr.io/reinauer/container-amiga-gcc). Docker Hub is the canonical location.

Tag Contents
gcc-v6.5.0b GCC 6.5.0b
gcc-v13.4 GCC 13.4
gcc-v16.2, latest GCC 16.2
gcc-v16.2-ppc GCC 16.2 for ppc-amigaos
gcc-vVERSION-YYYYMMDD A specific dated build
16.2-rcN, 16.2 GCC 16.2 from that release of AmigaPorts/m68k-amigaos-gcc

The toolchain is installed in /opt/amiga (/opt/amiga-ppc for ppc-amigaos) and is on PATH:

podman run --rm -v "$PWD:/src" -w /src stefanreinauer/amiga-gcc:gcc-v13.4 \
  m68k-amigaos-gcc hello.c -o hello -noixemul
podman run --rm -v "$PWD:/src" -w /src stefanreinauer/amiga-gcc:gcc-v16.2-ppc \
  ppc-amigaos-gcc hello.c -o hello

docker works the same way.

Prebuilt archives

The Build native toolchain archives workflow builds .tar.xz archives for Linux x86_64 and macOS ARM64 for every supported version. Releases are published on the Releases page; builds from every push to main are also kept as artifacts of their workflow run.

A release is cut by running the workflow by hand; it tags the commit it ran from with the build date, such as v2026-10-28, and another run on the same day replaces that release. Given a release tag of AmigaPorts/m68k-amigaos-gcc, GCC 16.2 is built from that release instead of the branches, for m68k-amigaos and ppc-amigaos alike, and the release notes say so. The run also starts the image build of that release (see Publishing images). A new upstream release needs no change here, just another run:

gh workflow run toolchain-archives.yml -f release_tag=v16.2-rc22

An archive contains a dated installation and a stable symlink to it:

opt/amiga-16.2-20260825/
opt/amiga-16.2 -> amiga-16.2-20260825

ppc-amigaos archives are named amiga-ppc-gcc-… and install opt/amiga-ppc-16.2-… and opt/amiga-ppc-16.2.

install_release.sh installs the latest release for the host it runs on: it downloads the Linux or macOS archives, unpacks their dated installations into /opt, points the /opt/amiga-16.2 and other symlinks at them and, on macOS, clears the quarantine flag. It runs sudo itself when it needs to. Installations that already exist are not downloaded again:

./install_release.sh                    # every toolchain of the latest release
./install_release.sh -o amiga-16.2      # only m68k-amigaos GCC 16.2
./install_release.sh -t v2026-10-29 -n  # what an older release would install

To install an archive by hand, extract it at the root of the file system so that it lands in /opt:

sudo tar -xJf amiga-gcc-16.2-20260825-linux-x86_64.tar.xz -C /
export PATH=/opt/amiga-16.2/bin:$PATH

Several versions and dates can be installed side by side.

zprofile is an example for zsh: add it to ~/.zprofile to get amiga6, amiga13 and amiga16, which switch the shell between the installed m68k-amigaos toolchains, with GCC 16.2 as the default and ppc-amigaos always on PATH.

On macOS, browser downloads may carry a quarantine flag that triggers an "Apple could not verify" warning for every executable. If you trust the downloaded toolchain, remove the flag after extraction:

sudo /usr/bin/xattr -rd com.apple.quarantine /opt/amiga-*-20261002/

Replace 20261002 with the date of your installation. This only clears the flag on those directories; it does not disable Gatekeeper.

Building from source

./build.sh                       # 6.5.0b, 13.4 and 16.2 into /opt/amiga-vVERSION-YYYYMMDD
./build.sh --version 16.2 --prefix /opt/amiga-16.2
./build.sh --target ppc-amigaos  # 16.2 into /opt/amiga-ppc-v16.2-YYYYMMDD
./build.sh --version 16.2 --release-tag v16.2-rc21  # a release, not the branch

--release-tag builds a release of AmigaPorts/m68k-amigaos-gcc, v16.2-rc18 or later, with every module at that release's tag instead of its branch.

On Ubuntu the script installs missing packages with apt-get (--skip-apt to opt out). On macOS it installs its dependencies with Homebrew (--skip-brew to opt out) and builds with Homebrew GCC.

Run ./build.sh --help for all options, including the NDK version, install prefix layout, host compilers and reuse of existing source trees. For ppc-amigaos, --sdk-archive uses a local copy of the SDK instead of downloading it.

Building container images

update_docker.sh builds the images the same way as the published ones: every supported version from its branch, tagged gcc-vVERSION and gcc-vVERSION-YYYYMMDD (gcc-vVERSION-ppc and gcc-vVERSION-ppc-YYYYMMDD for ppc-amigaos), with latest pointing at GCC 16.2. CI runs this script too. Use --no-push to only build and tag them locally:

./update_docker.sh --no-push            # asks before each step
./update_docker.sh --no-push --no-skip  # runs all steps without asking

--gcc-version VER builds only the images of that GCC version, both targets; repeat it for more. latest moves only when its version is among them. --release-tag TAG builds just the m68k-amigaos image of a release, as build.sh --release-tag does, tagged with the release without its "v"; it leaves latest alone:

./update_docker.sh --no-push --gcc-version 16.2
./update_docker.sh --no-push --release-tag v16.2-rc21  # amiga-gcc:16.2-rc21

Set DOCKER_CLI=podman to build with Podman instead of Docker.

To build a single image by hand:

podman build --build-arg BUILD_GCC_VERSION=16.2 \
  --build-arg BUILD_GCC_BRANCH=amiga16.2 -t amiga-gcc:16.2 .

With Docker, name the Containerfile explicitly:

docker build -f Containerfile --build-arg BUILD_GCC_VERSION=16.2 \
  --build-arg BUILD_GCC_BRANCH=amiga16.2 -t amiga-gcc:16.2 .

For a release, add --build-arg BUILD_RELEASE_TAG=v16.2-rc21, with the matching BUILD_GCC_VERSION.

For ppc-amigaos, add --build-arg BUILD_TARGET=ppc-amigaos and pass the AmigaPorts/gcc ref as BUILD_GCC_BRANCH:

podman build --build-arg BUILD_TARGET=ppc-amigaos \
  --build-arg BUILD_GCC_VERSION=16.2 \
  --build-arg BUILD_GCC_BRANCH=amiga16.2 -t amiga-gcc:16.2-ppc .

Publishing images

Every push to main that changes what goes into the images builds them and publishes them to GHCR; a newer push cancels the build still running for an older one. The image of a release of AmigaPorts/m68k-amigaos-gcc, such as 16.2-rc21, is built by running the workflow with that release tag, which a release of the toolchain archives from that tag does too:

gh workflow run publish.yml -f release_tag=v16.2-rc21

Docker Hub is updated from GHCR, without rebuilding:

docker login docker.io
./copy_to_dockerhub.sh

copy_to_dockerhub.sh finds the newest dated build on GHCR, lists its tags (gcc-vVERSION, gcc-vVERSION-YYYYMMDD and latest) and the release images (such as 16.2-rc21), and asks before copying them. It also points latest of the retired stefanreinauer/amigappc-gcc repository at the newest gcc-vVERSION-ppc image, for users of the old ppc-amigaos images. Tags that are already up to date are skipped. Use --dry-run to only list them and --yes to copy without asking.

Without --no-push, update_docker.sh builds the images locally (all versions, or those that --gcc-version or --release-tag select) and pushes them to Docker Hub directly, asking before each step.

Both scripts read the registry accounts from registry.conf. To publish from a fork, change the user and repository names there:

GITHUB_USER="reinauer"              # ghcr.io/GITHUB_USER/GITHUB_REPO
GITHUB_REPO="container-amiga-gcc"
DOCKERHUB_USER="stefanreinauer"     # docker.io/DOCKERHUB_USER/DOCKERHUB_REPO
DOCKERHUB_REPO="amiga-gcc"

A fork should also empty DOCKERHUB_PPC_LEGACY_REPOSITORY, which names the retired amigappc-gcc repository.

The --repository, --source and --destination options override these for a single run. The GitHub workflows don't use registry.conf; they publish to the GHCR package of the repository they run in.

Usage notes

Running programs with Vamos

Vamos runs AmigaOS command-line programs on the host, which is handy for tests and CI:

m68k-amigaos-gcc hello.c -o hello -noixemul
vamos hello

vbcc

vbcc is the one the m68k-amigaos-gcc toolchain builds and installs. vc finds its configs next to itself in bin, so no environment setup is needed. A VBCC variable set for another vbcc installation takes precedence: unset it to use this one.

vc hello.c -o hello            # default config
vc +aos68k hello.c -o hello    # select a target config

The available configs are aos68k, aos68km, aos68kr and kick13. aos68km and aos68kr link vbcc's minimal startup code, which opens no libraries: programs built with them open dos.library themselves.

AmigaOS 4 C runtimes

ppc-amigaos-gcc links against newlib by default. -mcrt=clib2 and -mcrt=clib4 select the other runtimes. -athread=native or single selects the thread model for C++, as does -athread=pthread with clib4:

ppc-amigaos-gcc -O2 hello.c -o hello
ppc-amigaos-g++ -O2 -mcrt=clib4 -athread=native hello.cc -o hello

History

This repository started as a fork of Sebastian Bergmann's container-amiga-gcc, a Dockerfile that built amiga-gcc in a container. It has since been rewritten: the build now lives in build.sh and runs natively on Linux and macOS, several GCC versions are built and published side by side, and native toolchain archives are produced alongside the container images. Thanks to Sebastian for the original work.