Skip to content

GCC 12.2.0 (aarch64)

Compare
Choose a tag to compare
@simonjwright simonjwright released this 06 Dec 20:33
· 49 commits to main since this release
gcc-12.2.0-aarch64

This is GCC 12.2.0 built on macOS Monterey (12, Darwin 21), for Apple silicon (M1), with Command Line Utilities 13.3.0.

Compilers included: Ada, C, C++.

Tools included (all at version 22.0.0, and all with the Runtime Library Exception):

Target: aarch64-apple-darwin21

Configured with:

--prefix=/opt/gcc-12.2.0
--without-libiconv-prefix
--disable-libmudflap
--disable-libstdcxx-pch
--disable-libsanitizer
--disable-libcc1
--disable-libcilkrts
--disable-multilib
--disable-nls
--enable-languages=c,c++,ada
--host=aarch64-apple-darwin21
--target=aarch64-apple-darwin21
--build=aarch64-apple-darwin21
--without-isl
--with-build-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
--with-sysroot=
--with-specs='%{!sysroot=*:--sysroot=%:if-exists-else(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk)}'
--with-build-config=no
--enable-bootstrap

and patched for PR104871.

Install

One of Xcode or the Command Line Tools is required.

Xcode can be downloaded from the App Store.
Install the Command Line Tools by sudo xcode-select --install.

If you suspect your copy of the Command Line Tools is old, you can delete it by

sudo rm -rf /Library/Developer/CommandLineTools

and re-install.

Download the binary .pkg. It's not signed, so don't double-click on it; instead, right-click on it and Open. Accept the warning. You will be guided through the installation.

Setting PATH

PATH needs to be set to include /opt/gcc-12.2.0-aarch64/bin at the front:

bash

Insert

export PATH=/opt/gcc-12.2.0-aarch64/bin:$PATH

in your ~/.bash_profile_common.

zsh

Likewise, but in ~/.zshrc.

See here for helpful information on moving to zsh.

Notes

The software was built using the building-gcc-macos-native scripts at Github, tag gcc-12.2.0-aarch64.

Compiler

The compiler is GPL version 3. The runtime has the GCC Runtime Exception, so executables built with it can be released on proprietary terms.

The patch for PR104871 is included.

GMP, MPFR, MPC

These libraries (releases 6.2.1, 4.1.0, 1.2.1 respectively) are installed with the compiler.

Include, library paths

As noted here, Apple have changed the location of system include files and libraries; they used to be copied from the SDKs to the "standard" /usr/include and /usr/lib either automatically or on command.

This compiler has been built so you don't need to take any related action to use it: unfortunately, this means that paths in /usr/local and /Library/Frameworks aren't searched.