GCC 14 Compiler Adds AArch64 GNU/Hurd Support

Written by Michael Larabel in GNU on 11 April 2024 at 10:27 AM EDT. 25 Comments
While GNU Hurd continues having a tough time on x86 support and GNU Hurd x86_64 is being worked toward, the GCC 14 compiler has been working on compiler toolchain support for GNU Hurd AArch64.

With code merged this week to GCC Git ahead of the upcoming GCC 14.1 stable release, there is now support for "aarch64-gnu" for GNU/Hurd on AArch64 for 64-bit ARM systems. Paired with a Binutils patch, this allows a toolchain that can successfully build working binaries targeting the aarch64-gnu platform.

Hurd installation

The patch notes:
"Coupled with a corresponding binutils patch, this produces a toolchain that can sucessfully build working binaries targeting aarch64-gnu."

But given the tough state of GNU Hurd hardware support, this AArch64 work is presumably only beneficial in the semi near-term for 64-bit ARM VMs if anything. Right now there isn't any working GNU Hurd AArch64 for users. In Hurd's 2024-Q1 update it was noted:
"Last time, there was no AArch64 port of GNU Mach, and so the only testing I have done was running a simple statically-linked executable on Linux under GDB, which, nevertheless, helped me identify and fix a number of issues.

Since then, however, I have been (some may say, relentlessly) working on filling in the missing piece, namely porting GNU Mach (with important help & contributions by Luca D.). I am happy to report that we now have an experimental port of GNU Mach that builds and works on AArch64! While that may sound impressive, note that various things about it are in an extremely basic, proof-of-concept state rather than being seriously production-ready; and also that Mach is a small kernel (indeed, a microkernel), and it was designed from the start (back in the 80s) to be portable, so most of the "buisness logic" functionality (virtual memory, IPC, tasks/threads/scheduler) is explicitly arch-independent.

Despite the scary "WIP proof-of-concept" status, there is enough functionality in Mach to run userland code, handle exceptions and syscalls, interact with the MMU to implement all the expected virtual memory semantics, schedule/switch tasks and threads, and so on. Moreover, all of GNU Mach's userspace self-tests pass!

This meant there was enough things in place for me to try running glibc on it, and the amazing thing is my simple test executable, the same one I previously tested on Linux with GDB, just worked on real Mach without me having to make any additional changes to the glibc side, or even recompile it.

But I did not stop there, and I got several of the core Hurd servers working! Namely, these are ext2fs, exec, startup, auth, and proc servers. All of them but ext2fs are dynamically linked; ld aarch64.so.1 successfully locates and maps the programs themselves and their required dependencies, and Mach pages in code and data pages from ext2fs as they are accessed, transparently to the program, just as one would expect it to."

GNU Hurd still has a long ways to go in being useful especially as it concerns bare metal hardware support.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week