Open paulmadejong opened 3 years ago
Hey Paul, Dominque, turns out Simon (GDB guy) is asking me to merge your changes into my pool - so I can get the combined set of fixes into 11.0 GDB. I'm about to "git am" your changes '21 04-08 into my tree.
Ultimately my goal is to get Eclipse/CDT reliable, having seen the 2020/06 Eclipse/CDT to have instability issues on start-up of a debug session. I noticed that when I gdb'd gdb (debugged gdb using gdb) that the system would often hang too, which apparently your changes resolve. So, maybe I can help save some time by merging the changes into my tree, and build/share for your use.
I also reached out the Homebrew and Macports -which to get the net result updated on their distributions sites.
Hi Paul, I created a build environment first using gcc, and gdb 10.2 sources (sent the info on that mike Myers spot). I have all the versions of the tools I used documented. I think if you repro to use exactly the same tools you'll resolve your build environment. I saved this in a Parallel's guest.
After I had working gdb built from these tools I copied the Paralle's guest, then installed the beta Xcode. The build still functions if I am careful to mimic the 1st guests environment. Yet, doing so removes many of the SDKs content supplied when installing Xcode. For the moment, I tabled the effort of getting the Xcode build to function - but I intend to get this working. Perhaps we can collaborate more.
I think the core of the issue is that Homebrew always builds with clang/clang++, and so uses libc++, but almost nobody that develops GDB works on macOS (or another systems whose default C++ standard library is libc++), and so the codebase just does not work with lib++ (only with libsdc++). I don't think there is any way to convince Homebrew to use GCC (the real one, not /usr/bin/gcc
which really is clang).
So, as @srwarner describes, it's really easier to download the GDB tarball, apply the patches in https://github.com/domq/homebrew-gdb/blob/master/Formula/gdb.rb manually, then ./configure CC=gcc-$VERSION CXX=g++-$VERSION
etc.
And for anyone wondering, "that Mike Myers spot" that @swarner mentions is https://gist.github.com/mike-myers-tob/9a6013124bad7ff074d3297db2c98247
Thanks for these fixes. Would be great if gdb is functional again after all this time.
However, compiling gdb failed for me on Big Sur 11.4. I first had to remove CommandLineTools (10.15 from my previous Catalina install) to reinstall it again to get rid of the warning that a newer version was available. Once CLT were reinstalled, homebrew attempted to compile gdb using the brew command of this post but it fails with a few errors:
From the created logfile I can see that homebrew uses the following CLT and Xcode versions (also reported by
brew doctor
):Currently xcrun uses the Xcode.APP SDK which doesn't affect HOMEBREW_SDKROOT apparently:
However, I've also tried setting it the the CLT SDK but the error persist. I have no idea how to change HOMEBREW_SDKROOT.
Another attempt to resolve this was by upgrading gcc and g++ through homebrew since the previously installed versions had the old sysroot when running
gcc/g++ -v
. The new versions of gcc and g++ (11+) did not resolve the error though.Anyone any other ideas?