#67370 closed defect (fixed)

gdb @13.1: build fails on Tiger

Reported by: Cebtenzzre Owned by: evanmiller (Evan Miller)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: tiger Cc:
Port: gdb gdb-apple

Description

gdb fails to build on OS X 10.4.8 Tiger i386. Here are the highlights:

:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat.c:42:10: fatal error: copyfile.h: No such file or directory
:info:build  #include <copyfile.h>
:info:build           ^~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat-info.c: In function 'void darwin_debug_regions_recurse(task_t)':
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat-info.c:615:3: error: 'vm_region_submap_short_info_data_64_t' was not declared in this scope
:info:build    vm_region_submap_short_info_data_64_t r_info;
:info:build    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat-info.c:615:3: note: suggested alternative: 'vm_region_submap_info_data_64_t'
:info:build    vm_region_submap_short_info_data_64_t r_info;
:info:build    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build    vm_region_submap_info_data_64_t
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat-info.c:647:21: error: 'VM_REGION_SUBMAP_SHORT_INFO_COUNT_64' was not declared in this scope
:info:build        r_info_size = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64;
:info:build                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat-info.c:647:21: note: suggested alternative: 'VM_REGION_SUBMAP_INFO_COUNT_64'
:info:build        r_info_size = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64;
:info:build                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build                      VM_REGION_SUBMAP_INFO_COUNT_64
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat-info.c: In function 'void disp_exception(const darwin_exception_info*)':
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat-info.c:785:18: error: 'EXC_MASK_CRASH' was not declared in this scope
:info:build        if (mask & EXC_MASK_CRASH)
:info:build                   ^~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/darwin-nat-info.c:785:18: note: suggested alternative: 'EXC_MASK_ALL'
:info:build        if (mask & EXC_MASK_CRASH)
:info:build                   ^~~~~~~~~~~~~~
:info:build                   EXC_MASK_ALL
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/i386-darwin-nat.c: In member function 'virtual void i386_darwin_nat_target::fetch_registers(regcache*, int)':
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/i386-darwin-nat.c:158:47: error: 'x86_float_state32_t {aka struct i386_float_state}' has no member named '__fpu_fcw'; did you mean 'fpu_fcw'?
:info:build     i387_supply_fxsave (regcache, -1, &fp_regs.__fpu_fcw);
:info:build                                                ^~~~~~~~~
:info:build                                                fpu_fcw
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/i386-darwin-nat.c: In function 'void i386_darwin_dr_set(int, CORE_ADDR)':
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/i386-darwin-nat.c:305:21: error: 'x86_debug_state32_t {aka struct x86_debug_state32}' has no member named '__dr0'; did you mean 'dr0'?
:info:build     dr_regs.uds.ds32.__dr0 = value;
:info:build                      ^~~~~
:info:build                      dr0
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/i386-darwin-nat.c: In function 'int i386_darwin_sstep_at_sigreturn(x86_thread_state_t*)':
:info:build /opt/local/var/macports/build/_Users_cebtenzzre_ports_devel_gdb/gdb/work/gdb-13.1/gdb/i386-darwin-nat.c:524:42: error: 'x86_thread_state32_t {aka struct i386_thread_state}' has no member named '__eip'; did you mean 'eip'?
:info:build    if (target_read_memory (regs->uts.ts32.__eip, buf, sizeof (buf)) == 0
:info:build                                           ^~~~~
:info:build                                           eip

Attachments (2)

main.log.bz2 (29.6 KB) - added by Cebtenzzre 19 months ago.
gdb-apple.log.bz2 (24.9 KB) - added by Cebtenzzre 19 months ago.
main.log for port install gdb-apple

Download all attachments as: .zip

Change History (7)

Changed 19 months ago by Cebtenzzre

Attachment: main.log.bz2 added

comment:1 Changed 19 months ago by Cebtenzzre

Port: gdb-apple added

gdb-apple is also affected by the debug register naming issue.

Changed 19 months ago by Cebtenzzre

Attachment: gdb-apple.log.bz2 added

main.log for port install gdb-apple

comment:2 Changed 19 months ago by evanmiller (Evan Miller)

gdb-apple will be your best bet. It looks like it just needs the register fields renamed and then will build successfully.

comment:3 in reply to:  1 Changed 19 months ago by kencu (Ken)

Replying to Cebtenzzre:

gdb-apple is also affected by the debug register naming issue.

Apple changed the register names in the Leopard SDK and newer. As all software uses the new names, many builds fail on Tiger for this reason.

I like the way Jeremy fixed it in the ld64 port, but they can be patched individually with a patchfile as well:

https://github.com/macports/macports-ports/blob/0dce830ca5a4308f470eb99d6111f677a324ea3c/devel/ld64/Portfile#L470

comment:4 Changed 19 months ago by evanmiller (Evan Miller)

I've posted a version update to gdb-apple with an attempted i386 fix here: https://github.com/macports/macports-ports/pull/18662

comment:5 Changed 18 months ago by evanmiller (Evan Miller)

Owner: set to evanmiller
Resolution: fixed
Status: newclosed

In 605e61ff2dee710c2ed9d22315417b0b716c3672/macports-ports (master):

gdb-apple: update to 2831

Closes: #67370

Note: See TracTickets for help on using tickets.