Bug 251646 - devel/gdb: fails to compile gdb-10.1/gdb/fbsd-kvm.c on CURRENT amd64
Summary: devel/gdb: fails to compile gdb-10.1/gdb/fbsd-kvm.c on CURRENT amd64
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Luca Pizzamiglio
URL: https://reviews.freebsd.org/D27499
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2020-12-06 18:07 UTC by Trond Endrestøl
Modified: 2020-12-08 10:32 UTC (History)
3 users (show)

See Also:
pizzamig: maintainer-feedback+
pizzamig: merge-quarterly-


Attachments
Complete build log for devel/gdb@py37 (994.81 KB, text/plain)
2020-12-06 18:07 UTC, Trond Endrestøl
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Trond Endrestøl 2020-12-06 18:07:02 UTC
Created attachment 220320 [details]
Complete build log for devel/gdb@py37

Both the running system (host) and the system snapshot used by ports-mgmt/synth are base/head amd64 r368387. The ports tree is ports/head at r557134.

  CXX    fbsd-kvm.o
/construction/xports/devel/gdb/work-py37/gdb-10.1/gdb/fbsd-kvm.c:342:10: error: typedef 'section_offsets' cannot be referenced with a struct specifier
                struct section_offsets *new_offsets;
                       ^
/construction/xports/devel/gdb/work-py37/gdb-10.1/gdb/symtab.h:1351:32: note: declared here
typedef std::vector<CORE_ADDR> section_offsets;
                               ^
/construction/xports/devel/gdb/work-py37/gdb-10.1/gdb/fbsd-kvm.c:349:22: error: no member named 'num_sections' in 'objfile'; did you mean 'sections'?
                                symfile_objfile->num_sections);
                                                 ^~~~~~~~~~~~
                                                 sections
/construction/xports/devel/gdb/work-py37/gdb-10.1/gdb/../include/libiberty.h:365:55: note: expanded from macro 'XALLOCAVEC'
#define XALLOCAVEC(T, N)        ((T *) alloca (sizeof (T) * (N)))
                                                             ^
/construction/xports/devel/gdb/work-py37/gdb-10.1/gdb/../include/libiberty.h:738:37: note: expanded from macro 'alloca'
# define alloca(x) __builtin_alloca(x)
                                    ^
/construction/xports/devel/gdb/work-py37/gdb-10.1/gdb/objfiles.h:653:23: note: 'sections' declared here
  struct obj_section *sections = nullptr;
                      ^
/construction/xports/devel/gdb/work-py37/gdb-10.1/gdb/fbsd-kvm.c:351:37: error: no member named 'num_sections' in 'objfile'
                        for (i = 0; i < symfile_objfile->num_sections; i++)
                                        ~~~~~~~~~~~~~~~  ^
3 errors generated.
gmake[3]: *** [Makefile:1625: fbsd-kvm.o] Error 1

Is this a pilot error on my part or an incompatibility with LLVM 11?
Comment 1 Luca Pizzamiglio freebsd_committer freebsd_triage 2020-12-07 09:18:04 UTC
Thanks for reporting.
we are aware of the issue.
we have to port that section of code, enabled only on CURRENT, to the new gdb C++ implementation.
Comment 2 Luca Pizzamiglio freebsd_committer freebsd_triage 2020-12-08 10:32:14 UTC
This bug has been already fixed yesterday, but no reference has been added to the commit message (yes, we are humans!).

No merge quarterly is needed, this fix the update to 10.1, not present in quarterly, because an upgrade from 9.x.

I'm going to close this bug report now.