From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Z8nmNUeOrl/obgAAWB0awg (envelope-from ) for ; Fri, 13 Nov 2020 08:46:47 -0500 Received: by simark.ca (Postfix, from userid 112) id CB2D41E552; Fri, 13 Nov 2020 08:46:47 -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.3 required=5.0 tests=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 7592C1E552 for ; Fri, 13 Nov 2020 08:46:47 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C70E53A4B83C; Fri, 13 Nov 2020 13:46:46 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3343D385481C; Fri, 13 Nov 2020 13:46:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3343D385481C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A94AC1E552; Fri, 13 Nov 2020 08:46:43 -0500 (EST) Subject: Re: [PATCH] GDB: Fix detection of ELF support when configuring with -Werror To: Nick Clifton , Alexander Richardson References: <20201111092021.5428-1-Alexander.Richardson@cl.cam.ac.uk> <52dc77e4-ff34-be60-13af-f580d3cf77e7@simark.ca> <76418730-3d48-b0f1-b5cc-5626d3c2feae@redhat.com> From: Simon Marchi Message-ID: Date: Fri, 13 Nov 2020 08:46:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <76418730-3d48-b0f1-b5cc-5626d3c2feae@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit 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: , Cc: Binutils , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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. Simon