Skip to content

Releases: simonjwright/building-gcc-macos-native

GCC 14.2.0-3 (aarch64)

16 Nov 14:29
gcc-14.2.0-3-aarch64
Compare
Choose a tag to compare

This is GCC 14.2.0 built on macOS Sonoma (14, Darwin 23) for Apple silicon, with Command Line Utilities 15.3.0 and Python 3.9.13.

It will also run on Sequoia (15, Darwin24) and with Xcode/Command Line Tools 16, but it will not run on Monterey.

Compilers included: Ada, C, C++.

Compiler sources are from https://github.com/iains/gcc-14-branch at tag gcc-14.2-darwin-r2.

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

Configured with:

--prefix=/Volumes/Miscellaneous3/aarch64/gcc-14.2.0-3-aarch64
--enable-languages=c,c++,ada
--build=aarch64-apple-darwin23
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/../MacOSX14.sdk
--with-specs='%{!-sysroot:--sysroot=%:if-exists-else(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk)}'
--with-bugurl=https://github.com/simonjwright/building-gcc-macos-native
--enable-bootstrap

Installation, setting PATH

Please see the Wiki.

Notes

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

All compilations were done with export MACOSX_DEPLOYMENT_TARGET=14 so that libraries and executables are compatible with macOS Sonoma and later.

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.

GMP

This library (release 6.2.1) is installed with the compiler.

Other sources

The necessary patches to the v25.0.0 tools are included in the release in the file gcc-14.2.0-3-patches.zip.

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.

GCC 14.2.0-2 (aarch64)

31 Oct 18:41
gcc-14.2.0-2-aarch64
Compare
Choose a tag to compare

This is GCC 14.2.0 built on macOS Sonoma (14, Darwin 23) for Apple silicon, with Command Line Utilities 15.3.0 and Python 3.9.13. It will run on Sequoia (15, Darwin 24).

This release supports compiling C or C++ if the SDK (Xcode or Command Line Tools) is at version 16 (for macOS Sequoia, version 15)

Compilers included: Ada, C, C++.

Compiler sources are from https://github.com/iains/gcc-14-branch at tag gcc-14.2-darwin-r2.

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

Configured with:

--prefix=/Volumes/Miscellaneous3/aarch64/gcc-14.2.0-2-aarch64
--enable-languages=c,c++,ada
--build=aarch64-apple-darwin23
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/../MacOSX14.sdk
--with-specs='%{!-sysroot:--sysroot=%:if-exists-else(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk)}'
--with-bugurl=https://github.com/simonjwright/building-gcc-macos-native
--enable-bootstrap
CC='/Volumes/Miscellaneous3/aarch64/gcc-14.2.0-clt15-aarch64/bin/gcc
--sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'
CXX='/Volumes/Miscellaneous3/aarch64/gcc-14.2.0-clt15-aarch64/bin/g++
--sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'

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-14.2.0-2-aarch64/bin at the front:

bash

Insert

export PATH=/opt/gcc-14.2.0-2-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-14.2.0-2-aarch64.

All compilations were done with export MACOSX_DEPLOYMENT_TARGET=14 so that libraries and executables are compatible with macOS Sonoma and later.

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.

GMP

This library (release 6.2.1) is installed with the compiler.

Other sources

The following patches to the v24.0.0 versions were needed to allow the builds to see the new compiler.

GNATColl Bindings

diff --git a/python3/setup.py b/python3/setup.py
index 18a29157..15c00c21 100755
--- a/python3/setup.py
+++ b/python3/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import logging
 import sys
 import re

GPR2

diff --git a/Makefile b/Makefile
index ce203ff9..82799b1c 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,11 @@ TARGET := $(shell gcc -dumpmachine)
 #
 # first let's check if Makefile is symlinked: realpath will return the actual
 # (after link resolution) relative path of the Makefile from PWD.
+ifeq ($(shell uname -s),Darwin)
+MFILE         := $(shell realpath "$(firstword ${MAKEFILE_LIST})"))
+else
 MFILE         := $(shell realpath --relative-to=. "$(firstword ${MAKEFILE_LIST})"))
+endif
 # as Makefile is in the root dir, SOURCE_DIR is just dirname of the Makefile
 # path above.
 SOURCE_DIR    := $(shell dirname "${MFILE}")

GPRBuild

diff --git a/gpr/src/gpr-version.ads b/gpr/src/gpr-version.ads
index 4238bedf..60a42c2c 100644
--- a/gpr/src/gpr-version.ads
+++ b/gpr/src/gpr-version.ads
@@ -30,17 +30,17 @@
 
 package GPR.Version is
 
-   Gpr_Version : constant String := "18.0w";
+   Gpr_Version : constant String := "24.0.1";
    --  Static string identifying this version
 
-   Date : constant String := "19940713";
+   Date : constant String := "20240409";
 
-   Current_Year : constant String := "2016";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, FSF, GPL);
    --  See Get_Gnat_Build_Type below for the meaning of these values
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := FSF;
    --  Kind of GNAT Build:
    --
    --    FSF

and (see gprbuild issue 141)

diff --git a/src/gprlib.adb b/src/gprlib.adb
index aaec038e..edc74f13 100644
--- a/src/gprlib.adb
+++ b/src/gprlib.adb
@@ -875,7 +875,7 @@ procedure Gprlib is
          if Separate_Run_Path_Options then
             for J in 1 .. Rpath.Last_Index loop
                Options_Table.Append
-                 (Concat_Paths (Path_Option, " ") & ' ' & Rpath (J));
+                 (Concat_Paths (Path_Option, " ") & Rpath (J));
             end loop;
 
          else

Libadalang Tools

diff --git a/src/utils-versions.ads b/src/utils-versions.ads
index 11ebb13a..a1fba976 100644
--- a/src/utils-versions.ads
+++ b/src/utils-versions.ads
@@ -23,12 +23,12 @@
 
 package Utils.Versions is
 
-   Version      : constant String := "dev";
-   Current_Year : constant String := "unknown";
+   Version      : constant String := "24.0.0";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, GPL);
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := GPL;
    --  Kind of GNAT Build:
    --
    --    Gnatpro

XML/Ada

diff --git a/Makefile.in b/Makefile.in
index 14d3dc4..26707d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,13 +35,9 @@ MODULES=unicode input_sources sax dom schema
 MODULE_INSTALL=${MODULES:%=%_inst}
 
 GPROPTS=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
+GPROPTS+=--target=${TARGET_ALIAS}
 
-ifeq (${HOST},${TARGET})
 IPREFIX=${DESTDIR}${prefix}
-else
-GPROPTS+=--target=${TARGET_ALIAS}
-IPREFIX=${DESTDIR}${prefix}/${TARGET_ALIAS}
-endif
 
 ifdef RTS
 GPROPTS+=--RTS=${RTS}

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.

GCC 14.2.0-1 (aarch64)

20 Sep 13:14
gcc-14.2.0-1-aarch64
Compare
Choose a tag to compare

This is GCC 14.2.0 built on macOS Sonoma (14, Darwin 23) but able to run on Monterey, for Apple silicon, with Command Line Utilities 15.3.0 and Python 3.9.13.

Compilers included: Ada, C, C++.

Compiler sources are from https://github.com/iains/gcc-14-branch at tag gcc-14.2-darwin-r1.

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

Configured with:

--prefix=/Volumes/Miscellaneous3/aarch64/gcc-14.2.0-1-aarch64
--enable-languages=c,c++,ada
--build=aarch64-apple-darwin21
--with-build-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
--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-bugurl=https://github.com/simonjwright/building-gcc-macos-native
--enable-bootstrap

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-14.2.0-1-aarch64/bin at the front:

bash

Insert

export PATH=/opt/gcc-14.2.0-1-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-14.2.0-1-aarch64.

All compilations were done with export MACOSX_DEPLOYMENT_TARGET=12 so that libraries and executables are compatible with macOS Monterey and later.

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.

GMP

This library (release 6.2.1) is installed with the compiler.

Other sources

The following patches to the v24.0.0 versions were needed to allow the builds to see the new compiler.

GNATColl Bindings

diff --git a/python3/setup.py b/python3/setup.py
index 18a29157..15c00c21 100755
--- a/python3/setup.py
+++ b/python3/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import logging
 import sys
 import re

GPR2

diff --git a/Makefile b/Makefile
index ce203ff9..82799b1c 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,11 @@ TARGET := $(shell gcc -dumpmachine)
 #
 # first let's check if Makefile is symlinked: realpath will return the actual
 # (after link resolution) relative path of the Makefile from PWD.
+ifeq ($(shell uname -s),Darwin)
+MFILE         := $(shell realpath "$(firstword ${MAKEFILE_LIST})"))
+else
 MFILE         := $(shell realpath --relative-to=. "$(firstword ${MAKEFILE_LIST})"))
+endif
 # as Makefile is in the root dir, SOURCE_DIR is just dirname of the Makefile
 # path above.
 SOURCE_DIR    := $(shell dirname "${MFILE}")

GPRBuild

diff --git a/gpr/src/gpr-version.ads b/gpr/src/gpr-version.ads
index 4238bedf..60a42c2c 100644
--- a/gpr/src/gpr-version.ads
+++ b/gpr/src/gpr-version.ads
@@ -30,17 +30,17 @@
 
 package GPR.Version is
 
-   Gpr_Version : constant String := "18.0w";
+   Gpr_Version : constant String := "24.0.1";
    --  Static string identifying this version
 
-   Date : constant String := "19940713";
+   Date : constant String := "20240409";
 
-   Current_Year : constant String := "2016";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, FSF, GPL);
    --  See Get_Gnat_Build_Type below for the meaning of these values
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := FSF;
    --  Kind of GNAT Build:
    --
    --    FSF

and (see gprbuild issue 141)

diff --git a/src/gprlib.adb b/src/gprlib.adb
index aaec038e..edc74f13 100644
--- a/src/gprlib.adb
+++ b/src/gprlib.adb
@@ -875,7 +875,7 @@ procedure Gprlib is
          if Separate_Run_Path_Options then
             for J in 1 .. Rpath.Last_Index loop
                Options_Table.Append
-                 (Concat_Paths (Path_Option, " ") & ' ' & Rpath (J));
+                 (Concat_Paths (Path_Option, " ") & Rpath (J));
             end loop;
 
          else

Libadalang Tools

diff --git a/src/utils-versions.ads b/src/utils-versions.ads
index 11ebb13a..a1fba976 100644
--- a/src/utils-versions.ads
+++ b/src/utils-versions.ads
@@ -23,12 +23,12 @@
 
 package Utils.Versions is
 
-   Version      : constant String := "dev";
-   Current_Year : constant String := "unknown";
+   Version      : constant String := "24.0.0";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, GPL);
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := GPL;
    --  Kind of GNAT Build:
    --
    --    Gnatpro

XML/Ada

diff --git a/Makefile.in b/Makefile.in
index 14d3dc4..26707d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,13 +35,9 @@ MODULES=unicode input_sources sax dom schema
 MODULE_INSTALL=${MODULES:%=%_inst}
 
 GPROPTS=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
+GPROPTS+=--target=${TARGET_ALIAS}
 
-ifeq (${HOST},${TARGET})
 IPREFIX=${DESTDIR}${prefix}
-else
-GPROPTS+=--target=${TARGET_ALIAS}
-IPREFIX=${DESTDIR}${prefix}/${TARGET_ALIAS}
-endif
 
 ifdef RTS
 GPROPTS+=--RTS=${RTS}

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.

GCC 14.1.0-1 (aarch64)

16 Jul 08:52
gcc-14.1.0-1-aarch64
Compare
Choose a tag to compare

This is GCC 14.1.0 built on macOS Sonoma (14, Darwin 23) but able to run on Monterey, for Apple silicon, with Command Line Utilities 15.3.0 and Python 3.9.13.

Compilers included: Ada, C, C++.

Compiler sources are from https://github.com/iains/gcc-14-branch at tag gcc-14.1-darwin-r1.

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

Configured with:

--prefix=/Volumes/Miscellaneous3/aarch64/gcc-14.1.0-1-aarch64
--enable-languages=c,c++,ada
--build=aarch64-apple-darwin21
--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-bugurl=https://github.com/simonjwright/building-gcc-macos-native
--enable-bootstrap

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-14.1.0-1-aarch64/bin at the front:

bash

Insert

export PATH=/opt/gcc-14.1.0-1-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-14.1.0-1-aarch64.

All compilations were done with export MACOSX_DEPLOYMENT_TARGET=12 so that libraries and executables are compatible with macOS Monterey and later.

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.

GMP

This library (release 6.2.1) is installed with the compiler.

Other sources

The following patches to the v24.0.0 versions were needed to allow the builds to see the new compiler.

GNATColl Bindings

diff --git a/python3/setup.py b/python3/setup.py
index 18a29157..15c00c21 100755
--- a/python3/setup.py
+++ b/python3/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import logging
 import sys
 import re

GPR2

diff --git a/Makefile b/Makefile
index ce203ff9..82799b1c 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,11 @@ TARGET := $(shell gcc -dumpmachine)
 #
 # first let's check if Makefile is symlinked: realpath will return the actual
 # (after link resolution) relative path of the Makefile from PWD.
+ifeq ($(shell uname -s),Darwin)
+MFILE         := $(shell realpath "$(firstword ${MAKEFILE_LIST})"))
+else
 MFILE         := $(shell realpath --relative-to=. "$(firstword ${MAKEFILE_LIST})"))
+endif
 # as Makefile is in the root dir, SOURCE_DIR is just dirname of the Makefile
 # path above.
 SOURCE_DIR    := $(shell dirname "${MFILE}")

GPRBuild

diff --git a/gpr/src/gpr-version.ads b/gpr/src/gpr-version.ads
index 4238bedf..60a42c2c 100644
--- a/gpr/src/gpr-version.ads
+++ b/gpr/src/gpr-version.ads
@@ -30,17 +30,17 @@
 
 package GPR.Version is
 
-   Gpr_Version : constant String := "18.0w";
+   Gpr_Version : constant String := "24.0.1";
    --  Static string identifying this version
 
-   Date : constant String := "19940713";
+   Date : constant String := "20240409";
 
-   Current_Year : constant String := "2016";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, FSF, GPL);
    --  See Get_Gnat_Build_Type below for the meaning of these values
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := FSF;
    --  Kind of GNAT Build:
    --
    --    FSF

and (see gprbuild issue 141)

diff --git a/src/gprlib.adb b/src/gprlib.adb
index aaec038e..edc74f13 100644
--- a/src/gprlib.adb
+++ b/src/gprlib.adb
@@ -875,7 +875,7 @@ procedure Gprlib is
          if Separate_Run_Path_Options then
             for J in 1 .. Rpath.Last_Index loop
                Options_Table.Append
-                 (Concat_Paths (Path_Option, " ") & ' ' & Rpath (J));
+                 (Concat_Paths (Path_Option, " ") & Rpath (J));
             end loop;
 
          else

Libadalang Tools

diff --git a/src/utils-versions.ads b/src/utils-versions.ads
index 11ebb13a..a1fba976 100644
--- a/src/utils-versions.ads
+++ b/src/utils-versions.ads
@@ -23,12 +23,12 @@
 
 package Utils.Versions is
 
-   Version      : constant String := "dev";
-   Current_Year : constant String := "unknown";
+   Version      : constant String := "24.0.0";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, GPL);
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := GPL;
    --  Kind of GNAT Build:
    --
    --    Gnatpro

XML/Ada

diff --git a/Makefile.in b/Makefile.in
index 14d3dc4..26707d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,13 +35,9 @@ MODULES=unicode input_sources sax dom schema
 MODULE_INSTALL=${MODULES:%=%_inst}
 
 GPROPTS=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
+GPROPTS+=--target=${TARGET_ALIAS}
 
-ifeq (${HOST},${TARGET})
 IPREFIX=${DESTDIR}${prefix}
-else
-GPROPTS+=--target=${TARGET_ALIAS}
-IPREFIX=${DESTDIR}${prefix}/${TARGET_ALIAS}
-endif
 
 ifdef RTS
 GPROPTS+=--RTS=${RTS}

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.

GCC 14.1.0 (x86_64)

14 May 16:18
gcc-14.1.0-x86_64
Compare
Choose a tag to compare

This is GCC 14.1.0 built on macOS Sonoma (14, Darwin 23) but able to run on Monterey, for Intel silicon, with Command Line Utilities 14.2.0 and Python 3.9.13.

It will run on Intel Macs, or Apple silicon (M series) Macs under Rosetta.

Compilers included: Ada, C, C++.

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

Configured with:

Configured with:
  --prefix=/Volumes/Miscellaneous3/x86_64/gcc-14.1.0-x86_64
  --without-libiconv-prefix
  --disable-libmudflap
  --disable-libstdcxx-pch
  --disable-libsanitizer
  --disable-libcc1
  --disable-libcilkrts
  --disable-multilib
  --disable-nls
  --enable-languages=c,c++,ada
  --host=x86_64-apple-darwin21
  --target=x86_64-apple-darwin21
  --build=x86_64-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-bugurl=https://github.com/simonjwright/building-gcc-macos-native
  --enable-bootstrap
  --enable-host-pie
  CFLAGS=-Wno-deprecated-declarations
  CXXFLAGS=-Wno-deprecated-declarations

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-14.1.0-x86_64/bin at the front:

bash

Insert

export PATH=/opt/gcc-14.1.0-x86_64/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-14.1.0-x86_64.

All compilations were done with export MACOSX_DEPLOYMENT_TARGET=12 so that libraries and executables are compatible with macOS Monterey and later.

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.

GMP

This library (release 6.2.1) is installed with the compiler.

Other sources

The following patches to the v24.0.0 versions were needed to allow the builds to see the new compiler.

GNATColl Bindings

diff --git a/python3/setup.py b/python3/setup.py
index 18a29157..15c00c21 100755
--- a/python3/setup.py
+++ b/python3/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import logging
 import sys
 import re

GPR2

diff --git a/Makefile b/Makefile
index ce203ff9..82799b1c 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,11 @@ TARGET := $(shell gcc -dumpmachine)
 #
 # first let's check if Makefile is symlinked: realpath will return the actual
 # (after link resolution) relative path of the Makefile from PWD.
+ifeq ($(shell uname -s),Darwin)
+MFILE         := $(shell realpath "$(firstword ${MAKEFILE_LIST})"))
+else
 MFILE         := $(shell realpath --relative-to=. "$(firstword ${MAKEFILE_LIST})"))
+endif
 # as Makefile is in the root dir, SOURCE_DIR is just dirname of the Makefile
 # path above.
 SOURCE_DIR    := $(shell dirname "${MFILE}")

GPRBuild

diff --git a/gpr/src/gpr-version.ads b/gpr/src/gpr-version.ads
index 4238bedf..60a42c2c 100644
--- a/gpr/src/gpr-version.ads
+++ b/gpr/src/gpr-version.ads
@@ -30,17 +30,17 @@
 
 package GPR.Version is
 
-   Gpr_Version : constant String := "18.0w";
+   Gpr_Version : constant String := "24.0.1";
    --  Static string identifying this version
 
-   Date : constant String := "19940713";
+   Date : constant String := "20240409";
 
-   Current_Year : constant String := "2016";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, FSF, GPL);
    --  See Get_Gnat_Build_Type below for the meaning of these values
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := FSF;
    --  Kind of GNAT Build:
    --
    --    FSF

and (see gprbuild issue 141)

diff --git a/src/gprlib.adb b/src/gprlib.adb
index aaec038e..edc74f13 100644
--- a/src/gprlib.adb
+++ b/src/gprlib.adb
@@ -875,7 +875,7 @@ procedure Gprlib is
          if Separate_Run_Path_Options then
             for J in 1 .. Rpath.Last_Index loop
                Options_Table.Append
-                 (Concat_Paths (Path_Option, " ") & ' ' & Rpath (J));
+                 (Concat_Paths (Path_Option, " ") & Rpath (J));
             end loop;
 
          else

Libadalang Tools

diff --git a/src/utils-versions.ads b/src/utils-versions.ads
index 11ebb13a..a1fba976 100644
--- a/src/utils-versions.ads
+++ b/src/utils-versions.ads
@@ -23,12 +23,12 @@
 
 package Utils.Versions is
 
-   Version      : constant String := "dev";
-   Current_Year : constant String := "unknown";
+   Version      : constant String := "24.0.0";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, GPL);
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := GPL;
    --  Kind of GNAT Build:
    --
    --    Gnatpro

XML/Ada

diff --git a/Makefile.in b/Makefile.in
index 14d3dc4..26707d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,13 +35,9 @@ MODULES=unicode input_sources sax dom schema
 MODULE_INSTALL=${MODULES:%=%_inst}
 
 GPROPTS=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
+GPROPTS+=--target=${TARGET_ALIAS}
 
-ifeq (${HOST},${TARGET})
 IPREFIX=${DESTDIR}${prefix}
-else
-GPROPTS+=--target=${TARGET_ALIAS}
-IPREFIX=${DESTDIR}${prefix}/${TARGET_ALIAS}
-endif
 
 ifdef RTS
 GPROPTS+=--RTS=${RTS}

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.

GCC 14.1.0 (aarch64)

13 May 17:14
gcc-14.1.0-aarch64
Compare
Choose a tag to compare

This is GCC 14.1.0 built on macOS Sonoma (14, Darwin 23) but able to run on Monterey, for Apple silicon (M1), with Command Line Utilities 15.3.0 and Python 3.9.13.

Compiler sources are from https://github.com/iains/gcc-14-branch at tag gcc-14.1-darwin-r0.

Compilers included: Ada, C, C++.

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

Configured with:

Configured with:
  --prefix=/Volumes/Miscellaneous3/aarch64/gcc-14.1.0-aarch64
  --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-bugurl=https://github.com/simonjwright/building-gcc-macos-native
  --enable-bootstrap
  --enable-host-pie
  CFLAGS=-Wno-deprecated-declarations
  CXXFLAGS=-Wno-deprecated-declarations

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-14.1.0-aarch64/bin at the front:

bash

Insert

export PATH=/opt/gcc-14.1.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-14.1.0-aarch64.

All compilations were done with export MACOSX_DEPLOYMENT_TARGET=12 so that libraries and executables are compatible with macOS Monterey and later.

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.

GMP

This library (release 6.2.1) is installed with the compiler.

Other sources

The following patches to the v24.0.0 versions were needed to allow the builds to see the new compiler.

GNATColl Bindings

diff --git a/python3/setup.py b/python3/setup.py
index 18a29157..15c00c21 100755
--- a/python3/setup.py
+++ b/python3/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import logging
 import sys
 import re

GPR2

diff --git a/Makefile b/Makefile
index ce203ff9..82799b1c 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,11 @@ TARGET := $(shell gcc -dumpmachine)
 #
 # first let's check if Makefile is symlinked: realpath will return the actual
 # (after link resolution) relative path of the Makefile from PWD.
+ifeq ($(shell uname -s),Darwin)
+MFILE         := $(shell realpath "$(firstword ${MAKEFILE_LIST})"))
+else
 MFILE         := $(shell realpath --relative-to=. "$(firstword ${MAKEFILE_LIST})"))
+endif
 # as Makefile is in the root dir, SOURCE_DIR is just dirname of the Makefile
 # path above.
 SOURCE_DIR    := $(shell dirname "${MFILE}")

GPRBuild

diff --git a/gpr/src/gpr-version.ads b/gpr/src/gpr-version.ads
index 4238bedf..60a42c2c 100644
--- a/gpr/src/gpr-version.ads
+++ b/gpr/src/gpr-version.ads
@@ -30,17 +30,17 @@
 
 package GPR.Version is
 
-   Gpr_Version : constant String := "18.0w";
+   Gpr_Version : constant String := "24.0.1";
    --  Static string identifying this version
 
-   Date : constant String := "19940713";
+   Date : constant String := "20240409";
 
-   Current_Year : constant String := "2016";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, FSF, GPL);
    --  See Get_Gnat_Build_Type below for the meaning of these values
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := FSF;
    --  Kind of GNAT Build:
    --
    --    FSF

and (see gprbuild issue 141)

diff --git a/src/gprlib.adb b/src/gprlib.adb
index aaec038e..edc74f13 100644
--- a/src/gprlib.adb
+++ b/src/gprlib.adb
@@ -875,7 +875,7 @@ procedure Gprlib is
          if Separate_Run_Path_Options then
             for J in 1 .. Rpath.Last_Index loop
                Options_Table.Append
-                 (Concat_Paths (Path_Option, " ") & ' ' & Rpath (J));
+                 (Concat_Paths (Path_Option, " ") & Rpath (J));
             end loop;
 
          else

Libadalang Tools

diff --git a/src/utils-versions.ads b/src/utils-versions.ads
index 11ebb13a..a1fba976 100644
--- a/src/utils-versions.ads
+++ b/src/utils-versions.ads
@@ -23,12 +23,12 @@
 
 package Utils.Versions is
 
-   Version      : constant String := "dev";
-   Current_Year : constant String := "unknown";
+   Version      : constant String := "24.0.0";
+   Current_Year : constant String := "2024";
 
    type Gnat_Build_Type is (Gnatpro, GPL);
 
-   Build_Type : constant Gnat_Build_Type := Gnatpro;
+   Build_Type : constant Gnat_Build_Type := GPL;
    --  Kind of GNAT Build:
    --
    --    Gnatpro

XML/Ada

diff --git a/Makefile.in b/Makefile.in
index 14d3dc4..26707d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,13 +35,9 @@ MODULES=unicode input_sources sax dom schema
 MODULE_INSTALL=${MODULES:%=%_inst}
 
 GPROPTS=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
+GPROPTS+=--target=${TARGET_ALIAS}
 
-ifeq (${HOST},${TARGET})
 IPREFIX=${DESTDIR}${prefix}
-else
-GPROPTS+=--target=${TARGET_ALIAS}
-IPREFIX=${DESTDIR}${prefix}/${TARGET_ALIAS}
-endif
 
 ifdef RTS
 GPROPTS+=--RTS=${RTS}

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.

GCC 13.2.0 (aarch64)

10 Dec 17:04
gcc-13.2.0-aarch64
Compare
Choose a tag to compare

This is GCC 13.2.0 built on macOS Sonoma (14, Darwin 23) but able to run on Monterey, for Apple silicon (M1), with Command Line Utilities 14.2.0 and Python 3.9.13.

The Xcode 15 fix has been applied.

Compiler sources are from https://github.com/iains/gcc-13-branch at tag gcc-13.2-darwin-r0.

Compilers included: Ada, C, C++.

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

Configured with:

--prefix=/opt/gcc-13.2.0-aarch64 
--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-bugurl=https://github.com/simonjwright/building-gcc-macos-native 
--enable-bootstrap 
--enable-host-pie 
CFLAGS=-Wno-deprecated-declarations 
CXXFLAGS=-Wno-deprecated-declarations

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-13.2.0-aarch64/bin at the front:

bash

Insert

export PATH=/opt/gcc-13.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-13.2.0-aarch64.

All compilations were done with export MACOSX_DEPLOYMENT_TARGET=12 so that libraries and executables are compatible with macOS Monterey and later.

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.

GMP, MPFR, MPC

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

Other sources

The following patches to the v23.0.0 versions were needed to allow the builds to see the new compiler.

XML/Ada

diff --git a/Makefile.in b/Makefile.in
index 14d3dc4..26707d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,13 +35,9 @@ MODULES=unicode input_sources sax dom schema
 MODULE_INSTALL=${MODULES:%=%_inst}

 GPROPTS=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
+GPROPTS+=--target=${TARGET_ALIAS}

-ifeq (${HOST},${TARGET})
 IPREFIX=${DESTDIR}${prefix}
-else
-GPROPTS+=--target=${TARGET_ALIAS}
-IPREFIX=${DESTDIR}${prefix}/${TARGET_ALIAS}
-endif

 ifdef RTS
 GPROPTS+=--RTS=${RTS}

Gprbuild

diff --git a/Makefile b/Makefile
index d4de8894..6fddd346 100644
--- a/Makefile
+++ b/Makefile
@@ -37,13 +37,7 @@ LIB_DIR       = lib/
 # Load current setup if any
 -include makefile.setup

-# target options for cross-build
-ifeq ($(HOST),$(TARGET))
-GTARGET=
-# INSTALLER=exe/$(BUILD)/$(LIB_INSTALLER)
-else
 GTARGET=--target=$(TARGET)
-endif

 INSTALLER=$(LIB_INSTALLER)
 EXEC_INSTALLER=$(INSTALLER) -XBUILD=${BUILD}

and (see gprbuild issue 141)

diff --git a/src/gprlib.adb b/src/gprlib.adb
index d7547b1d..20abd33a 100644
--- a/src/gprlib.adb
+++ b/src/gprlib.adb
@@ -923,7 +923,7 @@ procedure Gprlib is
          if Separate_Run_Path_Options then
             for J in 1 .. Rpath.Last_Index loop
                Options_Table.Append
-                 (Concat_Paths (Path_Option, " ") & ' ' & Rpath (J));
+                 (Concat_Paths (Path_Option, " ") & Rpath (J));
             end loop;

          else

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.

GCC 13.1.0 (aarch64)

07 Dec 11:54
gcc-13.1.0-aarch64-2
Compare
Choose a tag to compare

This is GCC 13.1.0 built on macOS Ventura (13, Darwin 22) but able to run on Monterey, for Apple silicon (M1), with Command Line Utilities 14.2.0 and Python 3.9.13.

Compiler sources are from https://github.com/iains/gcc-13-branch at tag gcc-13.1-darwin-r0.

Compilers included: Ada, C, C++.

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

Configured with:

--prefix=/opt/gcc-13.1.0-aarch64
--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-as=/usr/bin/as
--with-ld=/usr/bin/ld
--with-ranlib=/usr/bin/ranlib
--with-dsymutil=/usr/bin/dsymutil
--with-build-config=no
--enable-bootstrap
CFLAGS=-Wno-deprecated-declarations
CXXFLAGS=-Wno-deprecated-declarations

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-13.1.0-aarch64/bin at the front:

bash

Insert

export PATH=/opt/gcc-13.1.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-13.1.0-aarch64-2.

All compilations were done with export MACOSX_DEPLOYMENT_TARGET=12 so that libraries and executables are compatible with macOS Monterey and later.

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.

GMP, MPFR, MPC

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

Other sources

The following patches to the v23.0.0 versions were needed to allow the builds to see the new compiler.

XML/Ada

diff --git a/Makefile.in b/Makefile.in
index 14d3dc4..26707d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,13 +35,9 @@ MODULES=unicode input_sources sax dom schema
 MODULE_INSTALL=${MODULES:%=%_inst}

 GPROPTS=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
+GPROPTS+=--target=${TARGET_ALIAS}

-ifeq (${HOST},${TARGET})
 IPREFIX=${DESTDIR}${prefix}
-else
-GPROPTS+=--target=${TARGET_ALIAS}
-IPREFIX=${DESTDIR}${prefix}/${TARGET_ALIAS}
-endif

 ifdef RTS
 GPROPTS+=--RTS=${RTS}

Gprbuild

diff --git a/Makefile b/Makefile
index d4de8894..6fddd346 100644
--- a/Makefile
+++ b/Makefile
@@ -37,13 +37,7 @@ LIB_DIR       = lib/
 # Load current setup if any
 -include makefile.setup

-# target options for cross-build
-ifeq ($(HOST),$(TARGET))
-GTARGET=
-# INSTALLER=exe/$(BUILD)/$(LIB_INSTALLER)
-else
 GTARGET=--target=$(TARGET)
-endif

 INSTALLER=$(LIB_INSTALLER)
 EXEC_INSTALLER=$(INSTALLER) -XBUILD=${BUILD}

and (see gprbuild issue 141)

diff --git a/src/gprlib.adb b/src/gprlib.adb
index d7547b1d..20abd33a 100644
--- a/src/gprlib.adb
+++ b/src/gprlib.adb
@@ -923,7 +923,7 @@ procedure Gprlib is
          if Separate_Run_Path_Options then
             for J in 1 .. Rpath.Last_Index loop
                Options_Table.Append
-                 (Concat_Paths (Path_Option, " ") & ' ' & Rpath (J));
+                 (Concat_Paths (Path_Option, " ") & Rpath (J));
             end loop;

          else

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.

GCC 13.1.0 (x86_64)

07 Dec 11:49
gcc-13.1.0-x86_64
Compare
Choose a tag to compare

This is GCC 13.1.0 built on macOS Monterey (12, Darwin 21), with Command Line Tools 14.2 and Python 3.9.8.

It will run on Intel Macs, or M1 Macs under Rosetta, and uses the Xcode SDK if found, the Command Line Tools SDK if not.

Compilers included: Ada, C, C++.

Tools included (all at version 23.0.0, and all with the Runtime Library Exception, except as noted):

Full GPL:

GPL with the Runtime Library Exception:

Configured with:

--prefix=/opt/gcc-13.1.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=x86_64-apple-darwin21
--target=x86_64-apple-darwin21
--build=x86_64-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
CFLAGS=-Wno-deprecated-declarations
CXXFLAGS=-Wno-deprecated-declarations

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-13.1.0/bin at the front:

bash

Insert

export PATH=/opt/gcc-13.1.0/bin:$PATH

in your ~/.bash_profile_common.

zsh

Likewise, but in ~/.zshrc.

See here for helpful information on moving to zsh.

Installing GDB

gdb has to be 'code-signed' (unless you're willing to run it as root!)

For Mojave, Catalina, Big Sur and Monterey, see here.

Notes

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

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.

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.

GCC 12.2.0 (aarch64)

06 Dec 20:33
gcc-12.2.0-aarch64
Compare
Choose a tag to compare

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.