Bug 26029 - GDB build failure on SPARC
Summary: GDB build failure on SPARC
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: 9.1
: P2 normal
Target Milestone: 9.2
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2020-05-23 16:18 UTC by Joel Brobecker
Modified: 2020-06-03 13:44 UTC (History)
2 users (show)

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Joel Brobecker 2020-05-23 16:18:22 UTC
The following error was reported by a user:

I am trying to build a new version of the debugger on a SunBlade 100 running
FreeBSD 12.1. This build fails with the following complaint:

  CXX    sparc64-fbsd-nat.o
In file included from ../../gdb/sparc64-fbsd-nat.c:26:
../../gdb/sparc-nat.h: In instantiation of 'target_xfer_status
sparc_target<BaseTarget>::xfer_partial(target_object, const char*, gdb_byte*,
const gdb_byte*, ULONGEST, ULONGEST, ULONGEST*) [with BaseTarget =
fbsd_nat_target; gdb_byte = unsigned char; ULONGEST = long unsigned int]':
../../gdb/sparc-nat.h:67:27:   required from here
../../gdb/sparc-nat.h:78:12: error: invalid cast to abstract class type
   78 |     return BaseTarget (object, annex, readbuf, writebuf,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   79 |          offset, len, xfered_len);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../gdb/sparc64-fbsd-nat.c:24:
../../gdb/fbsd-nat.h:36:7: note:   because the following virtual functions are
pure within 'fbsd_nat_target':
   36 | class fbsd_nat_target : public inf_ptrace_target
      |       ^~~~~~~~~~~~~~~
In file included from ../../gdb/inf-ptrace.h:23,
                 from ../../gdb/fbsd-nat.h:23,
                 from ../../gdb/sparc64-fbsd-nat.c:24:
../../gdb/inf-child.h:42:8: note:       'virtual void
inf_child_target::fetch_registers(regcache*, int)'
   42 |   void fetch_registers (struct regcache *, int) override = 0;
      |        ^~~~~~~~~~~~~~~
../../gdb/inf-child.h:43:8: note:       'virtual void
inf_child_target::store_registers(regcache*, int)'
   43 |   void store_registers (struct regcache *, int) override = 0;
      |        ^~~~~~~~~~~~~~~
gmake[2]: *** [Makefile:1656: sparc64-fbsd-nat.o] Error 1
gmake[2]: Leaving directory '/usr/home/nicolc/gdb/gdb-9.1/build/gdb'
gmake[1]: *** [Makefile:9563: all-gdb] Error 2
gmake[1]: Leaving directory '/usr/home/nicolc/gdb/gdb-9.1/build'
gmake: *** [Makefile:851: all] Error 2
Comment 1 cvs-commit@gcc.gnu.org 2020-05-23 16:23:29 UTC
The gdb-9-branch branch has been updated by Joel Brobecker <brobecke@sourceware.org>:


commit c4997f6072e77371faa5a35b7a58c34ccbe290ce
Author: Christian Biesinger <cbiesinger@google.com>
Date:   Wed Feb 5 11:43:22 2020 -0600

    Fix base class function call
    This was a typo introduced in f6ac5f3d63e03a81c4ff3749aba234961cc9090e.
    Found by looking through NetBSD's GDB patches:
    This patch can't be tested on Linux because Linux does not use the
    sparc_target template.
    2020-05-23  Christian Biesinger  <cbiesinger@google.com>
            PR gdb/26029:
            * sparc-nat.h (struct sparc_target) <xfer_partial>: Fix base class
            function call.
    Change-Id: I4fa88cbdc365efe89b84cc0619b60db38718d9ce
    (cherry picked from commit c6a42d11acf2d485bf70d76eda76fd005fcd6825)
Comment 2 Joel Brobecker 2020-05-23 16:26:28 UTC
Note that the same patch than the one recorded as being pushed to branch "gdb-9-branch" was actually pushed to branch "master"on Feb 5th, 2020 (before this PR was created):

Comment 3 cvs-commit@gcc.gnu.org 2020-06-03 08:42:26 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:


commit 0ed18fa177858d67fec42babbca3fef4ae1d939f
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Jun 3 15:33:01 2020 +0930

    PR26069, strip/objcopy memory leaks
            PR 26029
            * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
            core files as well as objects.
Comment 4 Simon Marchi 2020-06-03 13:44:19 UTC
Alan, there's a typo in the bug number in that ChangeLog entry.