Howdy! Posted about this yesterday on the Zig subreddit, but I figure it’s worth sharing here, too Long story short: I managed to get a Zig “hello world” running on a Nintendo 64. As far as I know this is the first public example of Zig on the N64 (I’ve searched pretty hard for “Zig on N64” stuff and haven’t found anything else), but if I’m wrong about that I’d love to stand corrected; the more the merrier!
The post is old an those stdlib interfaces have changed a bunch, but I recently tried to emulate this blog post on my own in a barebones riscv32 OS and was able to get the new stdlib code to bend to my will. Unfortunately I wasn’t able to get it working because of (what I suspect to be) some linking problem, but the general methodology seems still good enough.
Thanks! Andrew’s article was indeed a huge help for the current panic handler stub, and yeah, even panic()'s signature is a little bit different these days, but that’s to be expected considering how much Zig has evolved since then
What linking problem did you hit? I know the article mentions hitting one when including the DWARF data in the emitted binary, and while it sounds like it was an LLVM bug that should be resolved upstream by now, I wonder if there are similar overzealous restrictions still lurking. I know RISC-V and MIPS are pretty similar in a lot of respects, so I wouldn’t be surprised if snags affecting one might affect the other.