
Prerequistite:
Make sure you have homebrew installed on your Mac device.
⛏️ How to install Brew on M1/M2 Mac
The quickest way to get GCC on the M1/M2 ARM based Mac is using brew.
% brew search gcc
==> Formulae
aarch64-elf-gcc gcc@11 gcc@6 gcc@9 x86_64-elf-gcc scc
gcc gcc@4.9 gcc@7 i686-elf-gcc ghc tcc
gcc@10 gcc@5 gcc@8 libgccjit grc ncc
==> Casks
gcc-aarch64-embedded gcc-arm-embedded gcs icc
% brew install gcc
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/manifests/6.2.1_1
...
...
==> Installing dependencies for gcc: gmp, isl, mpfr, libmpc, lz4 and zstd
...
...
==> Installing gcc
==> Pouring gcc--12.2.0.arm64_monterey.bottle.1.tar.gz
🍺 /opt/homebrew/Cellar/gcc/12.2.0: 1,470 files, 358.9MB
==> Running `brew cleanup gcc`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
As you can see, the version installed is the ARM64 one!
% gcc -v
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: arm64-apple-darwin22.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Have Questions? Post them here!
- How to find path of file on Mac Terminal
- How to disable Siri on Mac Monterey
- [fix] macOS Ventura xcrun: error: invalid active developer path missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
- Select Line Number TextEdit on Mac
- Go to Specific file path using Mac Finder
- How to find Java HOME in Mac Terminal
- bash: command not found error [macOS Terminal Linux, Unix or Windows]
- Must Know Homebrew Commands for Mac/Linux Users
- How to Insert an Inverted Question Mark on Mac ¿
- Hide Keyboard Text Input Icon on macOS Ventura Menu Bar
- How to make macOS Terminal window Transparent (or Opaque)
- How to check of Updates on Microsoft Edge Browser on Mac (macOS)
- Limit scrollback rows in macOS Terminal
- How to identify installed Java (JDK) Version on macOS
- Keyboard Shortcut to delete a file on a Mac [Macbook]
- Open Docker from Terminal Command on Mac
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to take a screenshot on a Mac - updated for Ventura 13 [updated 2023]
- ls: .: Operation not permitted - Mac Terminal ZSH Error
- How to remove username from Mac Menu Bar?
- macOS Ventura XCode Command Line Tools Installation
- Where is .zshrc file located in macOS
- How to Show Path of Files or App in Mac Spotlight Search
- How to enable root user on Mac Terminal
- Install Java 17 (LTS) JDK on ARM based M1/M2 Mac Natively
- Okta Hacked - Source Code Stolen from GitHub Repo - News
- Trigger Notification Center Message using Mac Terminal Command - MacOS
- Convert Java Object to YAML using Jackson Library - Java
- Sort a List using Java 8 Stream Examples - Java
- How to take a screenshot on Microsoft Windows OS on PC or Laptop - Microsoft
- [Docker M1/M2 Mac] qemu-x86_64: Could not open /lib64/ld-linux-x86-64.so.2: No such file or directory AWS CLI - Docker
- Android : Duplicate registration for activity com.example.abc - Android
- Perform an Empty Commit in Git without anything in Staging Area - Git