Custom Cross Compiler with Nix Β· Hobson Space

πŸš€ Explore this must-read post from Hacker News πŸ“–

πŸ“‚ Category:

βœ… Main takeaway:

This post is about trying to do something seemingly simple. You have an unusual
system that you want to write code for. You even have a cross compiler! But
how can you get this working with nix? Although the answer turned out to be
simple, the journey to getting there was super long and undocumented. I hope
this post saves you a lot of time!

I have a deep love for an operating system called Risc Os. It is a really old operating system made by Acorn Computers Ltd. for their Archimedes range of computers
and you can still run it on Raspberry Pi! I love it for a few reasons:

  1. It’s so simple
  2. It was one of the first things I nerded out over after seeing at the
    national computing museum in Bletchley Park
  3. Programming it in C helped is where pretty much all of my C knowledge comes from

But programming it is not easy. It predates every programming convention we have. There are no good text editors on it, and compiling is a pain!

But there is a cross compiler! The only issue is that when you try to build it, it becomes obvious that you need a seriously old version of ubuntu on X86_64 linux (it’s a patched GCC 4.7.4) and these days, I sport an Arm Mac which won’t even build a compiler that old!

Can we nix it?