skyfluid / amacc

Small C Compiler generating ELF executable for Arm architecture

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AMaCC = Another Mini ARM C Compiler

Introduction

AMaCC is built from scratch, supporting ARM architecture. There are 3 execution modes AMaCC implements:

  • Just-in-Time compiler (JITC) for ARM backend
  • Generate valid Executable and Linkable Format (ELF) executables
  • Interpreter-only execution

Compatibility

AMaCC is capable of compiling C source files written in the following syntax:

  • data types: char, int, struct, and pointer
  • condition statements: if, while, for, switch, return, and expression

Prerequisites

  • Code generator in AMaCC relies on several GNU/Linux behaviors, and it is necessary to have ARM/Linux installed in your build environment.

  • Install Linaro ARM Toolchain

    • Check "Latest Linux Targeted Binary Toolchain Releases"
    • Select arm-linux-gnueabihf (32-bit Armv7-a, hard-float, little-endian)
  • Install QEMU for ARM user emulation

sudo apt-get install qemu-user

Running AMaCC

Run make check and you should see this:

[ C to IR translation          ] Passed
[ JIT compilation + execution  ] Passed
[ ELF generation               ] Passed
[ nested/self compilation      ] Passed

Acknowledgements

AMaCC is based on the infrastructure of c4.

Related Materials

About

Small C Compiler generating ELF executable for Arm architecture

License:Other


Languages

Language:C 92.2%Language:Makefile 4.5%Language:Python 3.2%