Thes instructions have been tested on OSX, but should work just as fine on Linux.
Required:
- CMake
- clang
Optional
- GMake (for parallel build)
git clone git@github.com:allbinmani/M680x0-llvm.git
mkdir builddir && cd builddir
CMake, single process
cmake -DLLVM_TARGET_ARCH="m68k" -DLLVM_TARGETS_TO_BUILD="M680x0" ../M680x0-llvm/ && cmake --build .
CMake + Make, multiple processes
cmake -DLLVM_TARGET_ARCH="m68k" -DLLVM_TARGETS_TO_BUILD="M680x0" -G "Unix Makefiles" ../M680x0-llvm/ && make -j 4
echo 'int main(int argc, char **argv) {return 0;}' >main.c
clang -S -c main.c -emit-llvm -o - | ./bin/llc -mtriple=m68k=amiga-m680x0
All assemblers I have tried for the Amiga do not accept semicolons as comments, and does not seem to have options for it, which seems strange to me.. Anyway, to get #
as a coment character, I had to patch /lib/Target/M680x0/MCTargetDesc/M680x0MCAsmInfo.cpp
and change the CommentString
definition:
M680x0ELFMCAsmInfo::M680x0ELFMCAsmInfo(const Triple &T) {
...
CommentString = "#";