Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alex Richardson via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Subject: [PATCH] GDB: Fix detection of ELF support when configuring with -Werror
Date: Wed, 11 Nov 2020 09:20:21 +0000	[thread overview]
Message-ID: <20201111092021.5428-1-Alexander.Richardson@cl.cam.ac.uk> (raw)

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


             reply	other threads:[~2020-11-11  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11  9:20 Alex Richardson via Gdb-patches [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201111092021.5428-1-Alexander.Richardson@cl.cam.ac.uk \
    --to=gdb-patches@sourceware.org \
    --cc=Alexander.Richardson@cl.cam.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox