GDB: Fix detection of ELF support when configuring with -Werror=implicit-function-declaration
I am getting
I'm sorry, Dave, I can't do that. Symbol format `elf64-littleriscv' unknown.
errors after updating from GDB 8.3 to 10. Bisecting showed that since
commit
1ff6de031241 ("bfd, ld: add CTF section linking"), bfd.h depends
on strncmp() being present, so configuring with
-Werror=implicit-function-declaration results in the check for ELF
support in BFD failing:
.../gdb/gdb/../bfd/elf-bfd.h: In function 'bfd_section_is_ctf':
.../gdb/gdb/../bfd/elf-bfd.h:3086:10: error: implicit declaration of function 'strncmp' [-Werror=implicit-function-declaration]
return strncmp (name, ".ctf", 4) == 0 && (name[4] == 0 || name[4] == '.');
gdb/ChangeLog:
* acincludde.m4 (GDB_AC_CHECK_BFD): Include string.h in the test
program.
Change-Id: Iec5e21d454c2a544c44d65e23cfde552c424c18e