Tech Blog – Native GCC Pack
In the old good times installation of GCC compiler on Amiga was not an easy task. Now GCC Pack makes it easy with Installer script. It installs native (both hosted on and targetted to m68k-amigaos architecture) GCC 2.95.3. Then it integrates it with AmigaOS 3.2 NDK.
Are you sure?
A few words before downloading. Developing for Amiga on Amiga (especially on a real hardware) is for patient people. Most people developing for Amiga just use cross-compilers. Why?
- Amiga is slow. Even if GCC 2.95.3 is an ancient compiler, released in 2000, it won't be fast on A500. I am using it on a 68020 processor at 28 MHz, and I do not recommend going below this specification. It also requires 32 MB of RAM as a reasonable minimum. Of course, you can run this compiler on an Amiga emulator, where speed and memory is no longer an issue.
- GCC 2.95.3 is old. You are at C99 standard (with a few things missing). Cross-compilers are much more modern.
- Cross-compiling on a modern platform brings modern tools. One can for example write in VSCode and use its powers.
Still here?
GCC-Pack is distributed as a LhA archive. Installation is easy, unpack it, then click the "Install" icon. It starts the standard Amiga Installer program.
IMPORTANT: GCC-Pack requires AmigaOS Native Developer Kit (NDK) v3.2R4 archive, as it extracts system header files and autodocs from it. Download the NDK from Hyperion Entertainment website and move to Amiga disk.
Installation options
The installation script offers a set of optional modules.
Options choice depends on your decision on using standard C library (called clib) in your programs. If unsure, leave all options on. Usage of clib in particular project is controlled by compiler options (given in makefile usually). Not installing some options just saves disk space, if you are short of it. Short explanation of options:
- stdlib includes – you need them if you plan to use clib in any way. It may be handy to have them even if you don't plan to use clib. For example one may include <math.h> just to have constant M_PI defined.
- C standard library via shared ixemul.library – programs compiled this way require Amiga shared library ixemul.library. Executables are shorter, but ixemul requires considerable amount of memory at first opening. Users need to install it, or you have to redistribute it with your programs. Unfortunately a few broken versions of ixemul.library are in circulation, as people tried to "improve" it.
- C standard library via static Libnix – this is more traditional way for clib. Code of clib functions used is statically linked with the executable. Compiler option -noixemul turns this mode on. Recommended way.
I plan to write more about GCC and libc in a separate article.
Version history
0.3 (29.03.2024)
- FIXED: updated the compiler to the latest available 2.95.3-4. It fixes wrong calculation of stack offsets for function arguments when -fbaserel and -fomit-frame-pointer are used together.
0.2 (26.01.2024)
- FIXED: installation script, parameter for confirm had no quotes.
- FIXED: installation script, wrong filename of ixemul.library, when installing on 68060.
- FIXED: when 68LC060 is detected, 68020 version of ixemul.library should be installed.
0.1 (24.01.2024)
- Initial release.