Bug 24496 - ia64: gdb fails to build from source
Summary: ia64: gdb fails to build from source
Status: RESOLVED DUPLICATE of bug 23814
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 8.2.1
: P2 normal
Target Milestone: 8.3
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-28 18:15 UTC by Jason Duerstock
Modified: 2019-04-29 13:20 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Duerstock 2019-04-28 18:15:23 UTC
On ia64, gdb 8.2.1 fails to build from source:

make[9]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir/gdb/build-gnulib/import'
make[8]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir/gdb/build-gnulib/import'
make[7]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir/gdb/build-gnulib/import'
make[6]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir/gdb/build-gnulib'
make[5]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir/gdb/build-gnulib'
make[4]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir/gdb'
  CXX    gdb.o
  CXX    ia64-tdep.o
  CXX    ia64-linux-tdep.o
/<<PKGBUILDDIR>>/gdb/ia64-tdep.c: In function ‘LONGEST getunwind_table(gdb_byte**)’:
/<<PKGBUILDDIR>>/gdb/ia64-tdep.c:2664:16: error: too many arguments to function ‘gdb::optional<std::vector<unsigned char, gdb::default_init_allocator<unsigned char, std::allocator<unsigned char> > > > target_read_alloc(target_ops*, target_object, const char*)’
     NULL, buf_p);
                ^
In file included from /<<PKGBUILDDIR>>/gdb/inferior.h:41,
                 from /<<PKGBUILDDIR>>/gdb/ia64-tdep.c:21:
/<<PKGBUILDDIR>>/gdb/target.h:341:40: note: declared here
 extern gdb::optional<gdb::byte_vector> target_read_alloc
                                        ^~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/gdb/ia64-tdep.c:2664:16: error: cannot convert ‘gdb::optional<std::vector<unsigned char, gdb::default_init_allocator<unsigned char, std::allocator<unsigned char> > > >’ to ‘LONGEST’ {aka ‘long int’} in assignment
     NULL, buf_p);
                ^
make[3]: *** [Makefile:1622: ia64-tdep.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir/gdb'
make[2]: *** [Makefile:8491: all-gdb] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir'
make[1]: *** [Makefile:850: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/build/objdir'

The full Debian build log can be found at https://buildd.debian.org/status/fetch.php?pkg=gdb&arch=ia64&ver=8.2.1-2&stamp=1555329632&raw=0
Comment 1 Jessica Clarke 2019-04-28 19:43:51 UTC
This was fixed in 5d691c8829d0e5c4c4b9cfb147c8a873ce18085b:

Commit

  9018be22e022 ("Make target_read_alloc & al return vectors")

failed to update the code in ia64-tdep.c, for HAVE_LIBUNWIND_IA64_H.
This patch fixes that.

gdb/ChangeLog:

    * ia64-tdep.c (ktab_buf): New global.
    (getunwind_table): Return a gdb::optional<gdb::byte_vector>.
    (get_kernel_table): Adjust.

Note that you'll also want c2a6c5da37c0135acdb859ca819870980db69b77 to build:

PR build/23814 points out that ia64-linux-nat.c will not compile any
more.  This patch fixes the problem.  Thanks to Andreas Schwab for
trying the patch.
    
gdb/ChangeLog
2018-11-18  Tom Tromey  <tom@tromey.com> 
  
    PR build/23814:                                      
    * target-delegates.c: Rebuild.
    * ia64-linux-nat.c (class ia64_linux_nat_target)
    <have_steppable_watchpoint>: Use override.  Return true, not 1.
    (ia64_linux_nat_target::can_use_hw_breakpoint): Rename.  Remove
    "self" argument.                       
    (ia64_linux_nat_target::low_new_thread): Rename.
    (class ia64_linux_nat_target) <read_description>: Don't declare.
    * target.h (struct target_ops) <have_steppable_watchpoint>: Return
    bool.
Comment 2 Tom Tromey 2019-04-29 13:20:01 UTC
Closing as a dup, then.
If this is in error, note it here & I will un-dup.
Thanks.

*** This bug has been marked as a duplicate of bug 23814 ***