Of the myriad LLVM projects, only Clang, LLD, and LLVM proper have received attention. The MOS target is still considered experimental (and unfinished

llvm-mos / llvm-mos

submited by
Style Pass
2021-05-28 12:30:06

Of the myriad LLVM projects, only Clang, LLD, and LLVM proper have received attention. The MOS target is still considered experimental (and unfinished!), so you need to pass -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="MOS" to cmake in order to actually build the new target. If you like, you can speed up the build by disabling the other targets: -DLLVM_TARGETS_TO_BUILD="".

It's early days for Clang and the LLVM code generator, but the assembler and linker (LLD) are both MVP complete. Both use ELF as their object format; the target-specific ELF definitions were extended to accomodate the 6502.

No libraries or platform support are included with this repository to keep it a clean fork of LLVM. These are contained in the related llvm-mos-sdk. The default mos target will only use compiler built-in include and library paths (e.g., stdint.h), so the compiler can be used without the SDK. However, the various platform subtargets (e.g. apple2e, c64, etc) used by the compiler driver will require the SDK to be present. See the SDK for more information as it develops.

The LLVM Getting Started documentation may be out of date. The Clang Getting Started page might have more accurate information.

Leave a Comment
Related Posts