ld linker is missing when installing gcc using Homebrew on Mac OS I am a new Mac user and need to install GNU compilers (C and C++) and CMake for the code I am using.

I installed gcc and its binary utilities and CMake via Homebrew with the correct PATH to the executables (/usr/local/bin). However, compiling my code shows error messages regarding a missing linker.

It seems like installing gcc and binutils via Homebrew does not include ld linker. Does anyone know how to manually install ld (via Homebrew preferrably)?
As explained in this Homebrew Github issue:


  GNU binutils's ld does not support Darwin (macOS), and is thus not built [in the Homebrew package]


Use the ld version provided with macOS located at /usr/bin/ld.