From 0b6c348aff36defee70306eee64b52c9cba1138f Mon Sep 17 00:00:00 2001 From: Saagar Jha Date: Tue, 22 Sep 2020 23:52:18 -0700 Subject: [PATCH] Include string headers in a configure test for GDB Some configure tests include elf-bfd.h by itself and fail because they can't find prototypes for the string functions in it (which makes GDB think BFD has no support for ELF files). Normally we'd include sysdep.h, but for the case of this configure test it's easier to copy the relevant parts out rather than deal with the redefinitions that would arise were we to include it directly. gdb/Changelog: * configure: Include string headers in a test that needed it. --- gdb/ChangeLog | 4 ++++ gdb/configure | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ce9cef5f516..23a4e13b38f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-09-22 Saagar Jha + + * configure: Include string headers in a test that needed it. + 2020-09-21 Tom Tromey * sparc-tdep.c (sparc32_skip_prologue): Use diff --git a/gdb/configure b/gdb/configure index a8942ecbd5d..3345320a0fe 100755 --- a/gdb/configure +++ b/gdb/configure @@ -16771,6 +16771,24 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +// This configure test needs string functions, but bfd/sysdep.h isn't included +// here so we need to copy/paste the relevant part into this test. +#ifdef STRING_WITH_STRINGS +#include +#include +#else +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#else +extern char *strchr (); +extern char *strrchr (); +#endif +#endif +#endif + #include "bfd.h" #include "elf-bfd.h" -- 2.28.0