Update GDB on RTEMS 5
Summary
On multiple host OSes with newer GCC or LLVM, the gdb used in the RTEMS 5 tools no longer builds. The failure varies based on the RTEMS target and host. On some hosts, the build failure is in a simulator while others fail elsewhere.
- FreeBSD 14 fails with this:
In file included from ../../gdb-9.1/gdb/defs.h:56: ../../gdb-9.1/gdb/gdbsupport/enum-flags.h:85:52: error: integer value -1 is outside the valid range of values [0, 15] for the enumeration type 'ui_out_flag' [-Wenum-constexpr-conversion] 85 | integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type
- FreeBSD 13 fails with this:
/usr/bin/cc -O2 -pipe -fbracket-depth=1024 -I/usr/home/tester/rtems-cron-5/rtems-source-builder/rtems/build/tmp/sb-1003/5/rtems-v850/home/tester/rtems-cron-5/tools/5/include -DHAVE_CONFIG_H -DWITH_DEFAULT_ALIGNMENT=NONSTRICT_ALIGNMENT -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31 -DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE -DDEFAULT_INLINE=0 -DWITH_RESERVED_BITS=1 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -DDEBUG -I../../../gdb-9.1/sim/v850/../../newlib/libc/sys/sysnecv850 -I. -I../../../gdb-9.1/sim/v850 -I../common -I../../../gdb-9.1/sim/v850/../common -I../../include -I../../../gdb-9.1/sim/v850/../../include -I../../bfd -I../../../gdb-9.1/sim/v850/../../bfd -I../../opcodes -I../../../gdb-9.1/sim/v850/../../opco des -g -O2 -L/usr/home/tester/rtems-cron-5/rtems-source-builder/rtems/build/tmp/sb-1003/5/rtems-v850/home/tester/rtems-cron-5/tools/5/lib -o run \
nrun.o libsim.a ../../bfd/libbfd.a ../../opcodes/libopcodes.a ../../libiberty/libiberty.a -L../../zlib -lz\
ld: error: duplicate symbol: idecode_issue
defined at irun.c:31 irun.o:(idecode_issue) in archive libsim.a defined at idecode.h:71 (./idecode.h:71) engine.o:(.bss+0x0) in archive libsim.a`
- Cygwin fails with this:
In file included from ../../gdb-9.1/gdb/break-catch-sig.c:25: ../../gdb-9.1/gdb/inferior.h: In member function 'void infcall_suspend_state_deleter::operator()(infcall_suspend_state*) const': ../../gdb-9.1/gdb/inferior.h:80:19: warning: 'bool std::uncaught_exception()' is deprecated: use 'std::uncaught_exceptions()' instead [-Wdeprecated-declarations] 80 | if (!std::uncaught_exception ()) | ^~~~~~~~~~~~~~~~~~ In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ext/concurrence.h:34, from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/shared_ptr_base.h:62, from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/shared_ptr.h:53, from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/memory:77, from ../../gdb-9.1/gdb/gdbsupport/common-exceptions.h:25, from ../../gdb-9.1/gdb/gdbsupport/common-defs.h:137, from ../../gdb-9.1/gdb/defs.h:28, from ../../gdb-9.1/gdb/break-catch-sig.c:20: /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/exception:109:8: note: declared here 109 | bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__)); | ^~~~~~~~~~~~~~~~~~ In file included from ../../gdb-9.1/gdb/break-catch-sig.c:25: ../../gdb-9.1/gdb/inferior.h:80:38: warning: 'bool std::uncaught_exception()' is deprecated: use 'std::uncaught_exceptions()' instead [-Wdeprecated-declarations] 80 | if (!std::uncaught_exception ())
There are other odd issues like a simulator build issue with the v850 that shows on some hosts.
Recommended Solution
Update GDB version for RTEMS 5.
Help is requested from @chris as expect updating GDB will require bringing in the changes needed to include mpfr/gmp building with gdb that were recently introduced to the main branch.