From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CsM/Iu2sq1/yJgAAWB0awg (envelope-from ) for ; Wed, 11 Nov 2020 04:20:45 -0500 Received: by simark.ca (Postfix, from userid 112) id 7EC131F08B; Wed, 11 Nov 2020 04:20:45 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1F0601E58F for ; Wed, 11 Nov 2020 04:20:45 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FB4C398780E; Wed, 11 Nov 2020 09:20:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FB4C398780E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605086444; bh=QjQxzWURJm6d9pYi+iV7Ok7Swf0Ejk4FDUOk9mZKtPo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=xWePYuJsc6vr+ypOLEkHZE9GopyxJBZUcIM0L2o1JfBTuYh8uR5PRYvVNFPHfF/0V edZsPmT1mefxDJonFW52wfJ4IJ61SDA7jw55Fo7TwkewqN0t0GuFduZWjP+wCgaleh F2xAR93geWTQGFw8R0xfGBPbKm9AGZGJPppNkY+E= Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) by sourceware.org (Postfix) with ESMTPS id 39BF6398780E for ; Wed, 11 Nov 2020 09:20:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 39BF6398780E X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from host86-152-156-159.range86-152.btcentralplus.com ([86.152.156.159]:50590 helo=Alexs-MBP-10.home) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:alr48) (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1kcmIy-000eLR-dT (Exim 4.92.3) (return-path ); Wed, 11 Nov 2020 09:20:40 +0000 To: gdb-patches@sourceware.org Subject: [PATCH] GDB: Fix detection of ELF support when configuring with -Werror Date: Wed, 11 Nov 2020 09:20:21 +0000 Message-Id: <20201111092021.5428-1-Alexander.Richardson@cl.cam.ac.uk> X-Mailer: git-send-email 2.29.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Alex Richardson via Gdb-patches Reply-To: Alex Richardson Cc: Alex Richardson Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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 + #include #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 + #include #include "bfd.h" #include "elf-bfd.h" int @@ -16858,6 +16859,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + #include #include "bfd.h" #include "mach-o.h" int -- 2.29.1