jserv/amacc
FreeSmall C Compiler generating ELF executable Arm architecture, supporting JIT execution
About jserv/amacc
AMaCC (Arguably Minimalist Arm C Compiler) is a small C compiler that generates ELF executables for the Arm architecture and supports just-in-time (JIT) execution. Built from scratch, it is designed primarily as a pedagogical tool for learning about compilers, linkers, and loaders. AMaCC compiles a subset of C sufficient to self-host on Arm/Linux systems (armv7hf). It employs a combination of recursive descent and operator precedence parsing, generates a stack-based VM intermediate representation, and outputs Arm32 instructions. The compiler supports all C89 statements (except typedef), all C89 expression operators, and data types including char, int, enum, struct, union, and multi-level pointers. It has been verified on Raspberry Pi 2/3/4 and requires the arm-linux-gnueabihf toolchain and QEMU user emulation for testing.
Key Features
Pros & Cons
- Excellent pedagogical tool with clear codebase
- Self-hosting capability demonstrates compiler completeness
- Supports both ELF generation and JIT execution
- Runs on low-cost Arm hardware like Raspberry Pi
- Active development with 290 commits and community contributions
- Documents prerequisites and testing procedures
- Only targets 32-bit Arm (armv7hf) Linux systems
- Does not support all C89 features (e.g., typedef, struct/union assignments)
- Not suitable for production use; designed for learning
- Requires Arm toolchain and QEMU for testing on non-Arm systems
- Limited documentation beyond the README
- No support for floating-point or aggregate array initialization