From patchwork Wed Sep 26 12:58:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 29550 Received: (qmail 83330 invoked by alias); 26 Sep 2018 12:59:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 83314 invoked by uid 89); 26 Sep 2018 12:59:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Numbers, Macros, bite, csky-tdep.c X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.144.91) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Sep 2018 12:59:16 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway31.websitewelcome.com (Postfix) with ESMTP id CD23A536DC0 for ; Wed, 26 Sep 2018 07:59:14 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 59OpgDzzFBcCX59P8gaYHr; Wed, 26 Sep 2018 07:59:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Bht4Wn+i3jdFNzHgDSgETQRMOtRHmNJGN3rpYkcg4vA=; b=rGdKrl6UCbcsagZthj+JnsvQ0F 71Nc9qpUqkvNYxd05uYPkQUgJtR/bLtgSJnhwW6TMSeXf8rD1XmbRP3QbKE6zICw+J5XrXq/p+7BV 5y4uD9VqPlnIyVmSDzwYl4mCY; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:44668 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1g59Oo-001Zvd-QH; Wed, 26 Sep 2018 07:58:38 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Do not accidentally include in-tree readline headers Date: Wed, 26 Sep 2018 06:58:34 -0600 Message-Id: <20180926125834.8845-1-tom@tromey.com> 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. 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)/..". * gdb/aarch64-tdep.c, gdb/amd64-tdep.c, gdb/arc-tdep.c, gdb/cris-tdep.c, gdb/csky-tdep.c, gdb/frv-tdep.c, gdb/ft32-tdep.c, gdb/i386-tdep.c, gdb/lm32-tdep.c, gdb/m68hc11-tdep.c, gdb/mep-tdep.c, gdb/microblaze-tdep.c, gdb/mips-tdep.c, gdb/msp430-tdep.c, gdb/nds32-tdep.c, gdb/nios2-tdep.h, gdb/or1k-tdep.h, gdb/riscv-tdep.c, gdb/riscv-tdep.h, gdb/rl78-tdep.c, gdb/rx-tdep.c, gdb/tilegx-tdep.c: Use ../opcode, not opcode, in #include. --- gdb/ChangeLog | 13 +++++++++++++ gdb/Makefile.in | 3 +-- gdb/aarch64-tdep.c | 2 +- gdb/amd64-tdep.c | 2 +- gdb/arc-tdep.c | 4 ++-- gdb/cris-tdep.c | 2 +- gdb/csky-tdep.c | 2 +- gdb/frv-tdep.c | 2 +- gdb/ft32-tdep.c | 2 +- gdb/i386-tdep.c | 2 +- gdb/lm32-tdep.c | 2 +- gdb/m68hc11-tdep.c | 2 +- gdb/mep-tdep.c | 4 ++-- gdb/microblaze-tdep.c | 4 ++-- gdb/mips-tdep.c | 2 +- gdb/msp430-tdep.c | 2 +- gdb/nds32-tdep.c | 2 +- gdb/nios2-tdep.h | 2 +- gdb/or1k-tdep.h | 4 ++-- gdb/riscv-tdep.c | 8 ++++---- gdb/riscv-tdep.h | 2 +- gdb/rl78-tdep.c | 2 +- gdb/rx-tdep.c | 2 +- gdb/tilegx-tdep.c | 2 +- 24 files changed, 43 insertions(+), 31 deletions(-) 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/aarch64-tdep.c b/gdb/aarch64-tdep.c index 90b6deb0ea..d73c37a356 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -56,7 +56,7 @@ #include "record-full.h" #include "arch/aarch64-insn.h" -#include "opcode/aarch64.h" +#include "../opcode/aarch64.h" #include #define submask(x) ((1L << ((x) + 1)) - 1) diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 088542d72b..096cf54793 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -20,7 +20,7 @@ along with this program. If not, see . */ #include "defs.h" -#include "opcode/i386.h" +#include "../opcode/i386.h" #include "dis-asm.h" #include "arch-utils.h" #include "block.h" diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index fad9170978..8db5518386 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -32,8 +32,8 @@ #include "trad-frame.h" /* ARC header files. */ -#include "opcode/arc.h" -#include "opcodes/arc-dis.h" +#include "../opcode/arc.h" +#include "../opcodes/arc-dis.h" #include "arc-tdep.h" /* Standard headers. */ diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index e0371a2a28..ce5d5c0bc3 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -33,7 +33,7 @@ #include "gdbcmd.h" #include "target.h" #include "value.h" -#include "opcode/cris.h" +#include "../opcode/cris.h" #include "osabi.h" #include "arch-utils.h" #include "regcache.h" diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index 95bcead877..fae46fb3ab 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -56,7 +56,7 @@ #include "csky-tdep.h" #include "regset.h" #include "block.h" -#include "opcode/csky.h" +#include "../opcode/csky.h" #include #include 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/ft32-tdep.c b/gdb/ft32-tdep.c index 7198b84aca..e9667dca09 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -37,7 +37,7 @@ #include "dis-asm.h" #include "record.h" -#include "opcode/ft32.h" +#include "../opcode/ft32.h" #include "ft32-tdep.h" #include "gdb/sim-ft32.h" diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index a6994aaf12..5b6646a996 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -18,7 +18,7 @@ along with this program. If not, see . */ #include "defs.h" -#include "opcode/i386.h" +#include "../opcode/i386.h" #include "arch-utils.h" #include "command.h" #include "dummy-frame.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/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 1490ee2866..5d39d3ebdf 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -40,7 +40,7 @@ #include "reggroups.h" #include "target.h" -#include "opcode/m68hc11.h" +#include "../opcode/m68hc11.h" #include "elf/m68hc11.h" #include "elf-bfd.h" 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/mips-tdep.c b/gdb/mips-tdep.c index 5e0a60625b..4031436ef1 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -38,7 +38,7 @@ #include "mips-tdep.h" #include "block.h" #include "reggroups.h" -#include "opcode/mips.h" +#include "../opcode/mips.h" #include "elf/mips.h" #include "elf-bfd.h" #include "symcat.h" diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index b6e062a380..5931e36d2d 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -36,7 +36,7 @@ #include "reggroups.h" #include "elf/msp430.h" -#include "opcode/msp430-decode.h" +#include "../opcode/msp430-decode.h" #include "elf-bfd.h" /* Register Numbers. */ diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c index b616cc9b2c..65312b3f8e 100644 --- a/gdb/nds32-tdep.c +++ b/gdb/nds32-tdep.c @@ -40,7 +40,7 @@ #include "nds32-tdep.h" #include "elf/nds32.h" -#include "opcode/nds32.h" +#include "../opcode/nds32.h" #include #include "features/nds32.c" diff --git a/gdb/nios2-tdep.h b/gdb/nios2-tdep.h index 097975ea30..0bee428eeb 100644 --- a/gdb/nios2-tdep.h +++ b/gdb/nios2-tdep.h @@ -21,7 +21,7 @@ #define NIOS2_TDEP_H /* Nios II ISA specific encodings and macros. */ -#include "opcode/nios2.h" +#include "../opcode/nios2.h" /* Registers. */ #define NIOS2_Z_REGNUM 0 /* Zero */ 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 diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 254914c9c7..db3b64d2be 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -35,7 +35,7 @@ #include "riscv-tdep.h" #include "block.h" #include "reggroups.h" -#include "opcode/riscv.h" +#include "../opcode/riscv.h" #include "elf/riscv.h" #include "elf-bfd.h" #include "symcat.h" @@ -51,7 +51,7 @@ #include "user-regs.h" #include "valprint.h" #include "common-defs.h" -#include "opcode/riscv-opc.h" +#include "../opcode/riscv-opc.h" #include "cli/cli-decode.h" #include "observable.h" #include "prologue-value.h" @@ -69,7 +69,7 @@ static inline bool is_ ## INSN_NAME ## _insn (long insn) \ { \ return (insn & INSN_MASK) == INSN_MATCH; \ } -#include "opcode/riscv-opc.h" +#include "../opcode/riscv-opc.h" #undef DECLARE_INSN /* Cached information about a frame. */ @@ -193,7 +193,7 @@ static const struct register_alias riscv_register_aliases[] = { "ft10", 63 }, { "ft11", 64 }, #define DECLARE_CSR(name, num) { #name, (num) + 65 }, -#include "opcode/riscv-opc.h" +#include "../opcode/riscv-opc.h" #undef DECLARE_CSR }; diff --git a/gdb/riscv-tdep.h b/gdb/riscv-tdep.h index 8a2454eb66..30de167bd6 100644 --- a/gdb/riscv-tdep.h +++ b/gdb/riscv-tdep.h @@ -44,7 +44,7 @@ enum RISCV_FIRST_CSR_REGNUM = 65, /* First CSR */ #define DECLARE_CSR(name, num) \ RISCV_ ## num ## _REGNUM = RISCV_FIRST_CSR_REGNUM + num, -#include "opcode/riscv-opc.h" +#include "../opcode/riscv-opc.h" #undef DECLARE_CSR RISCV_LAST_CSR_REGNUM = 4160, RISCV_CSR_LEGACY_MISA_REGNUM = 0xf10 + RISCV_FIRST_CSR_REGNUM, diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index ace01b1171..0cf1e8ccae 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -24,7 +24,7 @@ #include "prologue-value.h" #include "target.h" #include "regcache.h" -#include "opcode/rl78.h" +#include "../opcode/rl78.h" #include "dis-asm.h" #include "gdbtypes.h" #include "frame.h" diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 94d57913a3..4e964b000a 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -24,7 +24,7 @@ #include "prologue-value.h" #include "target.h" #include "regcache.h" -#include "opcode/rx.h" +#include "../opcode/rx.h" #include "dis-asm.h" #include "gdbtypes.h" #include "frame.h" diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c index 9ed696630e..f9864f78da 100644 --- a/gdb/tilegx-tdep.c +++ b/gdb/tilegx-tdep.c @@ -38,7 +38,7 @@ #include "objfiles.h" #include "solib-svr4.h" #include "tilegx-tdep.h" -#include "opcode/tilegx.h" +#include "../opcode/tilegx.h" #include #include "common/byte-vector.h"