Here I show how to compile GCC, GDB and clang in debian, I compiled the source code from the latest in master. Before doing the steps below I cloned the git repos for all of them.
The OS is Debian Buster and Debian Stretch, there are less steps in Buster since it is newer than Stretch.
For debugging my programs, I use gdb, the gnu debugger. In general, gdb is available precompiled in the package repositories but sometimes I want to use the latest or enable more features.
Here is how to compile gdb with syntax highlighting in TUI mode in Debian Buster (it requires flex 2.6.4, so it doesn't work in debian stretch unless you install flex 2.6.4 manually)
gcc can use
lld for linking with the option
In my tests,
lld is 5% faster than gold.