Name Modified Size InfoDownloads / Week
Parent folder
gcc-11.1.0-x86_64-apple-darwin15.pkg 2021-05-13 336.5 MB
gdb-24069.diff 2021-05-02 1.7 kB
README-for-gcc-11.1.0-x86_64-apple-darwin15.md 2021-05-02 5.1 kB
Totals: 3 Items   336.5 MB 0

This is GCC 11.1.0 built on Mac OS X El Capitan (10.11, Darwin 15), with Xcode 8.2.1.

Also runs on macOS versions up to Big Sur (11.2, Darwin 20).

gcc-11.1.0-x86_64-apple-darwin15.pkg

Compilers included: Ada, C, C++, Objective C, Objective C++, Fortran.

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

Full GPL:

  • GDB 10.2 with the patch here and here.

GPL with the Runtime Library Exception:

Target: x86_64-apple-darwin15

Configured with:

/Volumes/Miscellaneous1/src/gcc/configure 
  --prefix=/Volumes/Miscellaneous1/x86_64/gcc-11.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,fortran,objc,obj-c++
  --host=x86_64-apple-darwin15 
  --target=x86_64-apple-darwin15 
  --build=x86_64-apple-darwin15 
  --with-boot-ldflags='-static-libstdc++ -static-libgcc -Wl,-headerpad_max_install_names' 
  --with-stage1-ldflags='-static-libstdc++ -static-libgcc -Wl,-headerpad_max_install_names'

Install

Xcode is required.

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

bash

Insert

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

in your ~/.bash_profile_common.

zsh

Likewise, but in ~/.zshrc.

See here for helpful information on moving to zsh.

SDKROOT

If you're running on macOS Mojave or later, the expected /usr/include and (in Big Sur) /usr/lib aren't present; instead, they're in the Software Development Kit (SDK), to be found as part of Xcode.

Tell the compiler where to find this by setting the environment variable SDKROOT, in the same script file as noted above:

export SDKROOT=$(xcrun --show-sdk-path)

Installing GDB

gdb has to be 'code-signed' (unless you're willing to run it as root!) and under Sierra and later macOS releases there are additional steps that have to be taken.

For El Capitan, see here.

For Sierra, and High Sierra, see here; in the case of High Sierra, the 10.12.1 paragraph refers.

For Mojave, Catalina and Big Sur, see here.

Notes

The software was built using the building-x86_64 scripts at Github, tag 11.1.0.

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

The GNU Multiple Precision Arithmetic Library 6.1.0, built as part of the compiler build, is installed with the compiler (static library only).

Include, library paths

As noted above and 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 distribution does not contain the fix described: instead, on macOS Mojave and above, you must define the environment symbol SDKROOT by (bash)

export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/

Tool notes

ASIS is no longer supported.

GDB was rebuilt with the new compiler, with an additonal patch, as noted above. To use the debugger, it must be signed: again, see above.

Distribution

The distribution was prepared using the distributing-gcc project at Github, tag 11.1.0.

Source: README-for-gcc-11.1.0-x86_64-apple-darwin15.md, updated 2021-05-02