On Fri, 2023-08-25 at 16:12 -0400, Michael Welsh Duggan via Gcc wrote: > I am attempting to debug an issue in gcc (PR 110827, if curious). In > order to do this I have built a stage 1 compiler with debugging and > without optimization as discussed here: > > https://gcc.gnu.org/wiki/DebuggingGCC#Building_a_Debuggable_Compiler > > I would like run the compiler from its build location without > installing > it, but I cannot determine how to have gcc look for its include files > and libraries from within its source and build trees. My first > problem > was that it looked for for cc1plus in the wrong location; my next > problems involved include paths. > > Is it possible to do this without extensive command-line options, or > does this need to be installed? If the latter, what target do I use > to > install the unoptimized stage 1 compiler? >
You could try: ./xgcc -B. REST OF GCC OPTIONS -wrapper gdb,--args where "./xgcc -B." will run the locally-built "driver" binary (xgcc), and make it look for things like "cc1" in ".". You may find this guide on debugging gcc helpful: https://gcc-newbies-guide.readthedocs.io/en/latest/debugging.html Dave