$60 bounty pkgs.pkgsCross.arm-embedded.buildPackages.gcc9 on aarch64-darwin

Homebrew has this cross compilation target, so my feeling is $30 is relatively reasonable?

clarification: aarch64-darwin is the host architecture I’m looking for.

edit: moved the bounty to 60 given that the homebrew package I was looking at is just the binary.

Where do you see that Homebrew supplies any GCC 9 for aarch64-darwin as the host machine? gcc@9 — Homebrew Formulae shows only x86_64.

It’s possible gcc9-with-no-aarch64-darwin patches will Just Work, as in gcc12: fix building foreign toolchain on aarch64-darwin by winterqt · Pull Request #217058 · NixOS/nixpkgs · GitHub, but I’d need to see.

Oh, it’s not home-brew mainline. My bad. Here’s a package that just downloads the binary, homebrew-px4/Formula/gcc-arm-none-eabi.rb at 21391a0a6bbe8bcbfe79c61822ea779ff408b4be · PX4/homebrew-px4 · GitHub which mean someone has a working gcc9 compilation. I’m not sure what patches it needs though.

That’s the binary gcc-arm-embedded-9, which was available in Nixpkgs until it was removed in gcc-arm-embedded-{6,7,8,9,10,11,12}: drop by prusnak · Pull Request #398202 · NixOS/nixpkgs · GitHub as GCC 9 is unsupported upstream (and presumably by Arm also?). It was only packaged for x86_64-darwin, as that’s all Arm offered; the Homebrew formula you linked also downloads an Intel binary (bin/arm-none-eabi-gcc: Mach-O 64-bit executable x86_64).

You can, however, still use it with Rosetta 2 from the nixpkgs-24.11-darwin branch (e.g. github:NixOS/nixpkgs/nixpkgs-24.11-darwin#legacyPackages.x86_64-darwin.gcc-arm-embedded-9). Hopefully that satisfies your needs.

Note that GCC 9 itself probably won’t be around in Nixpkgs much longer given its EOL status upstream, as the packages that required it have mostly been migrated to newer compilers or removed.

2 Likes