From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mNueOCIYt19oVQAAWB0awg (envelope-from ) for ; Thu, 19 Nov 2020 20:13:06 -0500 Received: by simark.ca (Postfix, from userid 112) id E42EA1E58E; Thu, 19 Nov 2020 20:13:06 -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 8DA541E58E for ; Thu, 19 Nov 2020 20:13:06 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DD79B39F6C2D; Fri, 20 Nov 2020 01:13:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD79B39F6C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605834785; bh=i9NsewaoAaP2ej/+u28biegK7ELkzqUb3rYoZ4VslW0=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=j9VmcpyhP+ME2o5ey/Dq70L1JtRhPDAMrbfZ7Fm1A4ORpE1K5ysgxfZ5akhWkxj9J XlNlZcZ5qu4ZZJU2R2jd83OzLLNBEiyLmQiTqog0UF2UNc3D2LoparM2bIrbVnw6Yd Y7cPl5ASQ4W7aMGdNo1IhzmPA8osLUtGjpAvoeMw= Received: from ppsw-31.csi.cam.ac.uk (ppsw-31.csi.cam.ac.uk [131.111.8.131]) by sourceware.org (Postfix) with ESMTPS id 02AEC393D028; Fri, 20 Nov 2020 01:13:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 02AEC393D028 X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from mail-ed1-f41.google.com ([209.85.208.41]:35520) by ppsw-31.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (PLAIN:alr48) (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1kfuyy-000rjY-MQ (Exim 4.92.3) (return-path ); Fri, 20 Nov 2020 01:13:00 +0000 Received: by mail-ed1-f41.google.com with SMTP id cf17so4277878edb.2; Thu, 19 Nov 2020 17:13:00 -0800 (PST) X-Gm-Message-State: AOAM531L0g4HnXPTNSRnkaGXYV3li+JmOrdNYAuERFAth7LhITOKhomG CWi4F1iImGx4Fbw0LFQHBDLJK0xfS7j2QsVkwF0= X-Google-Smtp-Source: ABdhPJzjArvl/sS3+lZfy26IlL+l/AO0TY67q9S1PYNIThZPSR6kxOV2TtRtVvARkaPyjX6wwuuESVEPuJmi662soUw= X-Received: by 2002:aa7:c508:: with SMTP id o8mr33664337edq.339.1605834780667; Thu, 19 Nov 2020 17:13:00 -0800 (PST) MIME-Version: 1.0 References: <20201111092021.5428-1-Alexander.Richardson@cl.cam.ac.uk> <52dc77e4-ff34-be60-13af-f580d3cf77e7@simark.ca> <76418730-3d48-b0f1-b5cc-5626d3c2feae@redhat.com> In-Reply-To: Date: Fri, 20 Nov 2020 01:12:43 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] GDB: Fix detection of ELF support when configuring with -Werror To: Simon Marchi Content-Type: text/plain; charset="UTF-8" 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: Alexander Richardson via Gdb-patches Reply-To: Alexander Richardson Cc: Nick Clifton , gdb-patches@sourceware.org, Binutils Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On Fri, 13 Nov 2020 at 13:46, Simon Marchi wrote: > > > On 2020-11-13 7:09 a.m., Nick Clifton wrote: > > Hi Simon, > > > >>> that's what I originally planned, but it seems like elf-bfd.h (and the > >>> headers it includes) don't include any system headers. Since I'm not > >>> familiar with any of this code I assumed this was intentional. > >>> > >>> Alex > >>> > >> > >> Hi binutils@, > >> > >> Could you check the discussion above? Is there a reason elf-bfd.h > >> doesn't include the header file it needs to use the functions it uses? > > > > Essentially this is because elf-bfd.h is internal to the binutils > > sources, and not expected to be used elsewhere. So any code that > > includes it is also expected to include the sysdep.h header which > > does then include the needed system headers. > > > > The idea is that all of the configuration time decisions about which > > system headers to include are confined to one file - sysdep.h - rather > > than having to be copied into all header files. > > > > Cheers > > Nick > > > > > > Ah ok I remember this, we started discussing this in: > > https://sourceware.org/pipermail/gdb-patches/2020-September/172041.html > > In an ideal world, GDB would stop using BFD's internal functions. But > for this, BFD would need to expose some ELF-specific bits, such as > program headers. I don't know if this is against BFD's design > principles to abstract things across various executable formats. > > I think Alexander's patch is fine, I don't think the complexity of the > patch linked above is necessary. Are there even any systems today that > GDB supports for which strncmp isn't found in string.h? > > Alexander, may I ask what particular configuration you are using? It > would be good to document it in the commit log. > Hi Simon, I was configuring GDB with -Werror=implicit-function-definition in CFLAGS and the --disable-werror configure argument. I've dropped that flag from my build scripts for now, but I would like to add it again if this patch is accepted. Thanks, Alex