1

I managed to nuke the g++ cc c++ gcc in my /usr/bin folder on my Mac running 10.9.1. I've tried running brew install gcc-49, apple-gcc42 and downloading Xcode's Command Line tools. All three haven't worked. I've seen some sources say that gcc on OSX is just clang symlinked.

If so, are there similar symlinks to cc, g++ and c++ that I could use? Even better, is there are way to just reset my system to whatever binaries I had initially?

1 Answers1

0

On my Mac running OS X 10.9.1, I have:

$ ls -l /usr/bin/gcc /usr/bin/g++ /usr/bin/clang
-rwxr-xr-x  1 root  wheel  14224 Oct 31 08:07 /usr/bin/clang
-rwxr-xr-x  1 root  wheel  14224 Oct 31 08:07 /usr/bin/g++
-rwxr-xr-x  1 root  wheel  14224 Oct 31 08:07 /usr/bin/gcc
$

However, despite appearances, the files are not identical:

$ sha1 /usr/bin/gcc /usr/bin/g++ /usr/bin/clang
2a080c37c2a4c2ef8bd04b5a7a4f51901d0826a4 /usr/bin/gcc
d783a5c4fa9abd856f65e34afaca8bca1ded447b /usr/bin/g++
9bed37669a0b8c7f13f71662869a5d1a2f4f1c3b /usr/bin/clang
$

So, that route is not going to help…fortunately, I checked before suggesting that it would.

There is a separate XCode Command Line Tools download, which is what you need to reinstate (reinstall) the programs in /usr/bin.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278