I’ve tried cross compiling the default zig app for my target board which is running a Microchip SAMA5D3 (Cortex-A5) but run into an illegal instruction error.
From the Host:
> mkdir armtest
> cd armtest
> zig init-exec
> zig build -Dtarget=arm-linux-gnueabihf
> file zig-out/bin/armtest
zig-out/bin/armtest: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
… copy to target and run …
~ # /armtest
Illegal instruction (core dumped)
~ # uname -a
Summit Linux V2470034 4.19.231 #1 PREEMPT none armv7l GNU/Linux
~ # strace /armtest
execve("/armtest", ["/armtest"], 0xbeafddb0 /* 14 vars */) = 0
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x98b10} ---
+++ killed by SIGILL (core dumped) +++
Illegal instruction (core dumped)
Any help on how I could further troubleshoot this?
Zig version: 0.12.0-dev.47+0461a64a9