-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zig is failing to build for m68k-freestanding-eabi #19510
Comments
did you build zig with |
Okay, I now tried doing that, this happened:
|
Your LLVM needs to also be built with |
Yeah, I did build llvm with the experimental m68k target, like I said the clang I built does recognize the target. |
Similar issue: #5467 (comment) |
My zig-fork with
$ cat start.c
void _start(){}
$ zig cc -target m68k-freestanding-none start.c -c -v
clang version 18.0.0git
Target: m68k-unknown-unknown-unknown
Thread model: posix
InstalledDir: /usr/bin
(in-process)
"/home/kassane/zig-bootstrap/out/zig-mos-x86_64-linux-musl-baseline/zig" -cc1 -triple m68k-unknown-unknown-unknown -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name start.c -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -ffreestanding -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -gdwarf32 -fdebug-compilation-dir=/home/kassane/zig-bootstrap -v -fcoverage-compilation-dir=/home/kassane/zig-bootstrap -nostdsysteminc -nobuiltininc -resource-dir /home/kassane/zig-bootstrap/out/lib/clang/18 -dependency-file /home/kassane/.cache/zig/tmp/124d4dd3231e3be0-start.o.d -MT /home/kassane/.cache/zig/tmp/124d4dd3231e3be0-start.o -sys-header-deps -MV -isystem out/zig-mos-x86_64-linux-musl-baseline/lib/include -D _DEBUG -O0 -ferror-limit 19 -fsanitize=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,integer-divide-by-zero,nonnull-attribute,null,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound -fsanitize-trap=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,integer-divide-by-zero,nonnull-attribute,null,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound -fno-sanitize-memory-param-retval -fno-sanitize-address-use-odr-indicator -fgnuc-version=4.2.1 -fcolor-diagnostics -fno-spell-checking -target-cpu generic -target-feature +isa-68000 -target-feature -isa-68010 -target-feature -isa-68020 -target-feature -isa-68030 -target-feature -isa-68040 -target-feature -isa-68060 -target-feature -isa-68881 -target-feature -isa-68882 -target-feature -reserve-a0 -target-feature -reserve-a1 -target-feature -reserve-a2 -target-feature -reserve-a3 -target-feature -reserve-a4 -target-feature -reserve-a5 -target-feature -reserve-a6 -target-feature -reserve-d0 -target-feature -reserve-d1 -target-feature -reserve-d2 -target-feature -reserve-d3 -target-feature -reserve-d4 -target-feature -reserve-d5 -target-feature -reserve-d6 -target-feature -reserve-d7 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/kassane/.cache/zig/tmp/124d4dd3231e3be0-start.o -x c start.c
clang -cc1 version 18.0.0git based upon LLVM 18.0.0git default target x86_64-linux-musl
#include "..." search starts here:
#include <...> search starts here:
out/zig-mos-x86_64-linux-musl-baseline/lib/include
End of search list.
LLD Link... ld.lld -r --error-limit=0 --image-base=65536 --eh-frame-hdr -znow -static -o start.o /home/kassane/.cache/zig/o/abd428bca8cfaa8d5f581a275cccb138/start.o --allow-shlib-undefined
Aborted (core dumped)
$ ./gcc-m68k/bin/m68k-elf-objdump -x $HOME/.cache/zig/o/abd428bca8cfaa8d5f581a275cccb138/start.o | head -n 5
/home/kassane/.cache/zig/o/abd428bca8cfaa8d5f581a275cccb138/start.o: file format elf32-m68k
/home/kassane/.cache/zig/o/abd428bca8cfaa8d5f581a275cccb138/start.o
architecture: m68k, flags 0x00000011:
HAS_RELOC, HAS_SYMS
$ cat start.zig
export fn _start() callconv(.C) void {
}
$ zig cc -target m68k-freestanding-none start.zig -c -v
LLVM Emit Object... error(codegen): LLVM failed to parse 'm68k-unknown-unknown-unknown': Unable to find target for this triple (no targets are registered)
thread 114923 panic: Invalid LLVM triple
Unwind error at address `exe:0xa396134` (error.InvalidDebugInfo), trace may be incomplete
Aborted (core dumped) Reference |
Note that m68k support in LLVM and Clang is still highly experimental and missing lots of essential features. Realistically, don't expect support for this target to be usable for some years still. |
Zig Version
0.12.0-dev.3498+aff71c613
Steps to Reproduce and Observed Behavior
I built Zig and LLVM with the m68k target enabled, however Zig fails to build or even emit assembly for
m68k-freestanding-eabi
.That's still confusing as the built clang can definitely emit assembly for the target zig is passing to llvm.
The command I used:
Expected Behavior
LLVM has support for this and the llvm/clang I built with m68k support when building Zig does accept this target, so I would expect Zig to also accept it.
The text was updated successfully, but these errors were encountered: