As a sooner than expected follow-up to the recent news article around Apple M1 / M2 / M3 core support for the GCC compiler, that code has now been successfully merged in time for the upcoming GCC 15 stable compiler release.
While Apple compiler engineers focus exclusively on the LLVM compiler stack for which their Xcode is derived and they have invested heavily in LLVM over the years, the GNU Compiler Collection now has initial targets merged for the Apple M1, M2, and M3 cores plus the A12 core too.
Independent compiler engineer Iain Sandoe has been working on this Apple Cores support for GCC with a focus of usage on Darwin/macOS. In cooperation with Arm engineers and the Apple open-source team, the necessary values were determined for the new apple-a12, apple-m1, apple-m2, and apple-m3 targets. There isn’t yet any support in place for the brand new Apple M4 cores.
For those interested, this patch is what was merged to GCC Git this week ahead of the GCC 15.1 stable compiler release due out in the coming weeks. A nice step forward for those preferring the GCC compiler over LLVM/Clang and wanting to target these Apple Silicon ARM processors.