m68k backend is crashing with segfault
Zig Version
0.10.0-dev.1261+6f986298c
Steps to Reproduce
[felix@denkplatte-v2 e45fca2d]$ touch empty.zig
[felix@denkplatte-v2 e45fca2d]$ zig build-obj -fno-emit-bin -target m68k-freestanding empty.zig
Segmentation fault
exit code: 139
[felix@denkplatte-v2 e45fca2d]$
Expected Behavior
The code should've build an object file
Actual Behavior
A segmentation fault happens
LLVM codebase only support m68k st the compilation stage at the moment, LLD does not support m68k in their ELF module, you should check again at next LLVM update
New to this stuff, but is it possible to compile for m68k at all?
llvm has experimental support for m68k, zig doesn't support it out of the box yet but there's a flag if you build zig yourself
I want to tackle that at one point. It should be a managable amount of work on the selfhosted compiler
Spent the afternoon trying to find the flag for building zig. My LLVM (15) is now built with m68k support, and can compile C-code that creates correct m68k elf binary that runs in qemu. I'm no LLVM/cmake/make/gcc wizard, and trying to find the various option is a pain really. For zig to build, do i need to modify a cmake/makefile, or are there some cmake parameter here that I'm missing?
./build/stage3/bin/zig build -Dllvm-has-m68k -Dno-lib, there's no cmake option currently
The original crash here no longer reproduces.