0

I get the following output when I run respectively gcc -v and whereis gcc:

Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
gcc: /usr/bin/gcc

Does this mean I have multiple installations of gcc on my mac ? If so, how do I uninstall the 'extra/unnecessary' ones ?

Thanks

sleepydrmike
  • 111
  • 1
  • 9
  • 1
    Well, why don't you take a look at what `/usr/bin/gcc` actually is, and see if this Scooby-Doo mystery can be easily solved. What does `ls -al /usr/bin/gcc` come back with? – Sam Varshavchik May 20 '22 at 20:21
  • `stat` the two paths and/or do `readlink -e` on both paths. I suspect they may actually be the same file. How much trouble macOS goes to to pretend otherwise I don't know. – ShadowRanger May 20 '22 at 20:22
  • @SamVarshavchik Well... it's not a symlink so I'm not really sure where to go from here Detective – sleepydrmike May 20 '22 at 20:24
  • @ShadowRanger Thanks now I see it. Was it a symlink after all then ? – sleepydrmike May 20 '22 at 20:28
  • 1
    @sleepydrmike: The directories themselves could be symlinks, not just `gcc` itself. `readlink -e` unravels *all* symlinks along the path, which helps (though it doesn't help with hard links if those are involved). Or the same file system could be remounted with different roots. *shrugs* I don't use macOS, so I can't say what nonsense they're doing here. – ShadowRanger May 20 '22 at 20:30
  • 4
    OT: Maybe I'm too nitpicking, but you may have [*no*](https://stackoverflow.com/questions/64992467/mac-clang-installation-seems-to-override-gcc-install) installation of GCC at all on your mac. – Bob__ May 20 '22 at 20:38
  • 1
    Please see ["Use whereis can not find the file in the Mac"](https://apple.stackexchange.com/questions/287467/use-whereis-can-not-find-the-file-in-the-mac) over at `stackexchange`. – G.M. May 20 '22 at 20:45

0 Answers0