Re: Building GDB
Tom Kacvinsky via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CAG_eJLcG543uBO9gEiV-061Za0RU3qPpT=7F0pWjFFDHV181ow@mail.gmail.com> |
On Mon, Feb 19, 2024 at 6:01 PM Levente via Gdb <[email protected]> wrote: > Hi all, > > > > I'm putting together a toolchain for AVR micro-controllers, and want to > build GDB without binutils. I checked out the source, and when I'm on > the binutils-2_42 tag, the build fails with this: > > CXX tui/tui-command.o > In file included from ../../gdb/tui/tui-data.h:28, > from ../../gdb/tui/tui-command.c:24: > ../../gdb/../gdbsupport/gdb-checked-static-cast.h: In instantiation of > ‘T gdb::checked_static_cast(V*) [with T = tui_cmd_window*; V = > tui_win_info]’: > ../../gdb/tui/tui-command.c:65:15: required from here > ../../gdb/../gdbsupport/gdb-checked-static-cast.h:63:14: error: cannot > convert from pointer to base class ‘tui_win_info’ to pointer to derived > class ‘tui_cmd_window’ because the base is virtual > 63 | T result = static_cast<T> (v); > | ^~~~~~~~~~~~~~~~~~ > make[2]: *** [Makefile:1930: tui/tui-command.o] Error 1 > > > So I decided to build gdb and binutils separately from different > commits. I can disable GDB by specifying --without-gdb. > > The question is, how can I build GDB without binutils? > > So here is what I want to do: > > check out binutils-2_42 > configure/build/install binutils > clean the repo > chec out gdb-14.1-release > configure/build/install gcc > > How can I do this? > I did this as follows (through experimentation) git checkout gdb-14.1-release mkdir build cd build ../configure --disable-binutils --disable-gas --disable-ld --disable-gprof --disable-gprofng --prefix=/your/path/here This will build the bits necessary for building gdb, then build gcore, gdb, gdb-add-index and gdbserver. There might be a better - that is, official - way of doing this. Tom