From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105349 invoked by alias); 26 Sep 2018 16:47:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 105340 invoked by uid 89); 26 Sep 2018 16:47:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=H*RU:209.85.221.65, Hx-spam-relays-external:209.85.221.65 X-HELO: mail-wr1-f65.google.com Received: from mail-wr1-f65.google.com (HELO mail-wr1-f65.google.com) (209.85.221.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Sep 2018 16:47:48 +0000 Received: by mail-wr1-f65.google.com with SMTP id j15-v6so23637708wrt.8 for ; Wed, 26 Sep 2018 09:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/D136yFGJMKW5gXpE2BZUgXgvBan2qtLBjLQf4N00Cs=; b=Jp9I5x0QvcNreyxLIO/IU9PKXI/AX1TrVDdnLMO2QJV+Y2i2lbUDoUC5zVcyDuZQ5r eDGAINiRFPg5Cce0UoK2i/rpAWHySnlOuBmAwjACqzd2S5ty6c1NzXcO4HwZ1F4yiBxE K8BbP9KGzw0bGWKYhn9AUOwlSSz1ooHo6j76WH8vQzdCBmGoDN7jEKGyE5sYXYkdxiaU wM/nods3yUT3WErbK52xUSmE5v3lu9f5fPU7VQtiTNaUzE2FaTiO9aHPpxaMS6Z4hdSf vXKx7eg5kToGxkysrGvpjplPpCoxpDmd/kWhtKHOXDtVR+NJDoVEQnzpxUErOX8oAP7I Oidw== Return-Path: Received: from localhost (host81-154-73-63.range81-154.btcentralplus.com. [81.154.73.63]) by smtp.gmail.com with ESMTPSA id 124-v6sm8371970wmk.20.2018.09.26.09.47.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 09:47:45 -0700 (PDT) Date: Wed, 26 Sep 2018 16:47:00 -0000 From: Andrew Burgess To: Tom Tromey Cc: Andreas Schwab , gdb-patches@sourceware.org Subject: Re: [PATCH] Do not accidentally include in-tree readline headers Message-ID: <20180926164743.GM5952@embecosm.com> References: <20180926125834.8845-1-tom@tromey.com> <87r2hgjr9v.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r2hgjr9v.fsf@tromey.com> X-Fortune: Bank error in your favor. Collect $200. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00855.txt.bz2 * Tom Tromey [2018-09-26 07:57:00 -0600]: > >>>>> "Andreas" == Andreas Schwab writes: > > Andreas> On Sep 26 2018, Tom Tromey wrote: > >> This patch fixes the problem in a mildly hacky way: remove the > >> offending -I option, and change gdb to use #include "../opcodes/..." > >> instead. This continues to make it clear where the header comes from, > >> without allowing incorrect behavior. > > Andreas> Most of these headers are "opcode/...", not "opcodes/...". > > Whoops, I made the patch via perl and didn't really read it. > Here's a better one. > > Tom > > commit d6df2198c8b7b42a351b00507f089de9e087ac6c > Author: Tom Tromey > Date: Wed Sep 26 06:54:17 2018 -0600 > > Do not accidentally include in-tree readline headers > > PR build/17077 points out that when --with-system-readline is given, > gdb will still pick up the in-tree readline headers. Normally this is > not a big problem, because readline is very stable and so the ABI does > not change much; but it is clearly a bug to do this, and could bite at > some point. > > The basic problem is that OPCODES_CFLAGS uses -I$(OPCODES_SRC)/.. so > that #include "opcodes/..." works. However, this also makes it so > the srcdir. I don't really understand what the last sentence is telling me. It feels like there's a bit missing from the end... Thanks, Andrew > > This patch fixes the problem in a mildly hacky way: remove the > offending -I option, and change gdb to use #include "../opcodes/..." > instead. This continues to make it clear where the header comes from, > without allowing incorrect behavior. > > Tested by rebuilding and then looking at the *.Po files. > > gdb/ChangeLog > 2018-09-26 Tom Tromey > > PR build/17077: > * Makefile.in (OPCODES_CFLAGS): Remove "-I$(OPCODES_SRC)/..". > * arc-tdep.c, frv-tdep.c, lm32-tdep.c, mep-tdep.c, > microblaze-tdep.c, or1k-tdep.h: Use ../opcodes, not opcodes, in > #include. > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index fa1ca59cc0..7f13a1ceb4 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,11 @@ > +2018-09-26 Tom Tromey > + > + PR build/17077: > + * Makefile.in (OPCODES_CFLAGS): Remove "-I$(OPCODES_SRC)/..". > + * arc-tdep.c, frv-tdep.c, lm32-tdep.c, mep-tdep.c, > + microblaze-tdep.c, or1k-tdep.h: Use ../opcodes, not opcodes, in > + #include. > + > 2018-09-26 Tom Tromey > > * valops.c (auto_abandon): Remove dead code. > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 3b158fa1db..3d28120fb8 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -446,8 +446,7 @@ OPCODES = $(OPCODES_DIR)/libopcodes.a > # Where are the other opcode tables which only have header file > # versions? > OP_INCLUDE = $(INCLUDE_DIR)/opcode > -# Some source files like to use #include "opcodes/file.h" > -OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/.. > +OPCODES_CFLAGS = -I$(OP_INCLUDE) > > # The simulator is usually nonexistent; targets that include one > # should set this to list all the .o or .a files to be linked in. > diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c > index fad9170978..b9dcbbc1e5 100644 > --- a/gdb/arc-tdep.c > +++ b/gdb/arc-tdep.c > @@ -33,7 +33,7 @@ > > /* ARC header files. */ > #include "opcode/arc.h" > -#include "opcodes/arc-dis.h" > +#include "../opcodes/arc-dis.h" > #include "arc-tdep.h" > > /* Standard headers. */ > diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c > index 1eed441f2b..dafab75654 100644 > --- a/gdb/frv-tdep.c > +++ b/gdb/frv-tdep.c > @@ -29,7 +29,7 @@ > #include "dis-asm.h" > #include "sim-regno.h" > #include "gdb/sim-frv.h" > -#include "opcodes/frv-desc.h" /* for the H_SPR_... enums */ > +#include "../opcodes/frv-desc.h" /* for the H_SPR_... enums */ > #include "symtab.h" > #include "elf-bfd.h" > #include "elf/frv.h" > diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c > index 942852140d..694d30ee1c 100644 > --- a/gdb/lm32-tdep.c > +++ b/gdb/lm32-tdep.c > @@ -35,7 +35,7 @@ > #include "regcache.h" > #include "trad-frame.h" > #include "reggroups.h" > -#include "opcodes/lm32-desc.h" > +#include "../opcodes/lm32-desc.h" > #include > > /* Macros to extract fields from an instruction. */ > diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c > index 69e7fdda59..e8ceec9288 100644 > --- a/gdb/mep-tdep.c > +++ b/gdb/mep-tdep.c > @@ -48,8 +48,8 @@ > > /* Get the user's customized MeP coprocessor register names from > libopcodes. */ > -#include "opcodes/mep-desc.h" > -#include "opcodes/mep-opc.h" > +#include "../opcodes/mep-desc.h" > +#include "../opcodes/mep-opc.h" > > > /* The gdbarch_tdep structure. */ > diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c > index 9bac8643c4..63095d3ede 100644 > --- a/gdb/microblaze-tdep.c > +++ b/gdb/microblaze-tdep.c > @@ -34,8 +34,8 @@ > #include "dwarf2-frame.h" > #include "osabi.h" > #include "target-descriptions.h" > -#include "opcodes/microblaze-opcm.h" > -#include "opcodes/microblaze-dis.h" > +#include "../opcodes/microblaze-opcm.h" > +#include "../opcodes/microblaze-dis.h" > #include "microblaze-tdep.h" > #include "remote.h" > > diff --git a/gdb/or1k-tdep.h b/gdb/or1k-tdep.h > index 4a93540c3a..b630c77053 100644 > --- a/gdb/or1k-tdep.h > +++ b/gdb/or1k-tdep.h > @@ -24,8 +24,8 @@ > #define TARGET_OR1K > #endif > > -#include "opcodes/or1k-desc.h" > -#include "opcodes/or1k-opc.h" > +#include "../opcodes/or1k-desc.h" > +#include "../opcodes/or1k-opc.h" > > /* General Purpose Registers */ > #define OR1K_ZERO_REGNUM 0