Skip to content

M68k experimental backend support

Min-Yih Hsu edited this page Jan 8, 2021 · 3 revisions

@mshockwave is a PhD student working on an experimental backend for LLVM targeting Motorola 68000 series CPUs (aka m68k) in https://github.com/M680x0/M680x0-mono-repo.

Fetch LLVM sources

$ git remote add m68k https://github.com/M680x0/M680x0-mono-repo.git
$ git checkout -b m68k m68k/dev-upstream-rename
$ cmake ... -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="M68k;"

Note that the branch dev-upstream-rename is also used for the ongoing LLVM upstream review, that means any changes in that branch will be rebased into one of the existing commits instead of appending a new one, which inevitable created non-linear git history. Thus always use force pull (i.e. git pull --force) if the normal pull gives you conflict messages.

This is just a temporary workaround. Once the M68k backend is upstreamed we won't have this issue anymore.

GNU binutils dependencies

$ sudo apt install binutils-m68k-linux-gnu

Kernel build

$ ARCH=m68k CROSS_COMPILE=m68k-linux-gnu- make CC=clang -j71 defconfig
$ ARCH=m68k CROSS_COMPILE=m68k-linux-gnu- make CC=clang -j71

Known issues for LLVM M68k

The full roadmap of LLVM M68k backend can be found here: https://github.com/M680x0/M680x0-mono-repo/projects

Currently the issue that is more relevant to clang-built-linux is lacking support on some assembly syntax, given the fact that the backend is using integrated assembler, which is not as mature as existing GNU AS (i.e. m68k-unknown-linux-as).

Clone this wiki locally