Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] GDB: Fix detection of ELF support when configuring with -Werror
@ 2020-11-11  9:20 Alex Richardson via Gdb-patches
  2020-11-11 20:48 ` Simon Marchi
  0 siblings, 1 reply; 10+ messages in thread
From: Alex Richardson via Gdb-patches @ 2020-11-11  9:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: Alex Richardson

I was 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 1ff6de031241c59d0ff9fa01d3c0a4049b0e97c9, bfd.h depends on strncmp()
being present, so configuring with -Werror 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/acinclude.m4 | 1 +
 gdb/configure    | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 64574e26314..68520d6d938 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -266,6 +266,7 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [
     [AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
 	  [#include <stdlib.h>
+	   #include <string.h>
 	   #include "bfd.h"
 	   #include "$4"],
 	  [return $3;]
diff --git a/gdb/configure b/gdb/configure
index 4a03cd9c3ec..ddbeefe426e 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -16745,6 +16745,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
+	   #include <string.h>
 	   #include "bfd.h"
 	   #include "elf-bfd.h"
 int
@@ -16858,6 +16859,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
+	   #include <string.h>
 	   #include "bfd.h"
 	   #include "mach-o.h"
 int
-- 
2.29.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-11-28 16:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11  9:20 [PATCH] GDB: Fix detection of ELF support when configuring with -Werror Alex Richardson via Gdb-patches
2020-11-11 20:48 ` Simon Marchi
2020-11-12  9:25   ` Alexander Richardson via Gdb-patches
2020-11-12 14:23     ` Tom Tromey
2020-11-12 14:25     ` Simon Marchi
2020-11-13 12:09       ` Nick Clifton via Gdb-patches
2020-11-13 13:46         ` Simon Marchi
2020-11-20  1:12           ` Alexander Richardson via Gdb-patches
2020-11-20 15:54             ` Tom Tromey
2020-11-28 16:50               ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox