Given the following problem when trying to install gdb, which demands gcc6, which ridiculously requires gcc7, which refuses to compile under Xcode:

Error: To install this port upgrade Xcode to 11.3 or newer
Error: Failed to fetch libgcc7: incompatible Xcode version

I found several other links to not provide a viable solution.

1 Answer 1


The solution that ultimately worked for me was:

  1. Install the newest security patch for Big Sur - on Nov 22, 2021 a new one was released that claims to fix this exact issue, which it does not... on it's own
  2. Install the newest Xcode (tested with Xcode 13.1)
  3. sudo rm -r /Library/Developer/CommandLineTools (yes really, installing a new one with the old present seems to break)
  4. Find your proper Xcode Command Line Tools link here and install it: https://developer.apple.com/download/all/?q=command%20line%20tools
  5. sudo xcode-select -switch /Library/Developer/CommandLineTools
  6. sudo port selfupdate
  7. sudo port upgrade outdated
  8. sudo port uninstall gcc6
  9. sudo port install gcc8 (because gcc6 and gcc7 still don't install, and I suspect 9 and 10 will not either, as per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061)
  10. sudo port install gdb
  11. ggdb

Yes, after all that, it installs it under a name not mentioned ever during installation. For reasons.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .