From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 9990C3858D33 for ; Sun, 24 Apr 2022 14:58:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9990C3858D33 Received: by mail-pf1-x434.google.com with SMTP id b15so12606190pfm.5 for ; Sun, 24 Apr 2022 07:58:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=82d+3bnCt5y7HdPlX8wCBAh3HBXoB5ZsyBldL3PKhpI=; b=UFMj6gn727+zIoEWGoRpTYCmIAcPK6fqHlwOY6ObgZf7doVwrsOetW9ZPOehOfhUfn c4pNWiqr13ctNs43SKfNZMPimcZsUHKULshS4phcCb246eByqGzxvDI6KxfyBYJYpofM M9gGWzzGTFcPApt8H5rrsRLwrZE7g3ZjnnurAs4sXcwIrFNvJ3DC6g+TMsR45oLCL8Sz uKPw2n3NjGSGZnOCg8VyzI2pLQIDhb+sJrsYsJTzI41A43sVNfuqxV3Zgv8qGOda01vn qAJIinLiHas2kxhksz0LDycrwCZrIG2B8zmFTUi/0dfZwDHc49LTJepJyOxtJCxrDxFB 0mAQ== X-Gm-Message-State: AOAM533JSHvwvHMCx02H6Dz2eUuKEQCOc+btAy0tCRCQRUIhz2QtreHk bUpOqjkpz/VsSKmvlcqgfkGs X-Google-Smtp-Source: ABdhPJyG4h+kg0pfSixMka513BlPdXG3Otj8VZjgHRD12eT6AEj0Y03toE399a+845nbutnDQ8pi4A== X-Received: by 2002:a65:5b4b:0:b0:3a3:d8fb:6926 with SMTP id y11-20020a655b4b000000b003a3d8fb6926mr11478584pgr.76.1650812330579; Sun, 24 Apr 2022 07:58:50 -0700 (PDT) Received: from takamaka.home ([184.69.131.86]) by smtp.gmail.com with ESMTPSA id l5-20020a056a0016c500b004f768db4c94sm8747447pfc.212.2022.04.24.07.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 07:58:50 -0700 (PDT) Received: by takamaka.home (Postfix, from userid 1000) id 248B2A4D6E; Sun, 24 Apr 2022 07:58:49 -0700 (PDT) Date: Sun, 24 Apr 2022 07:58:49 -0700 From: Joel Brobecker To: Luis Machado Cc: binutils@sourceware.org, brobecker@adacore.com, jose.marchesi@oracle.com, vapier@gentoo.org Subject: Re: [PATCH, v2] Fix 32-bit build for --enable-targets=all Message-ID: References: <20220422132513.22471-1-luis.machado@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220422132513.22471-1-luis.machado@arm.com> X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2022 14:58:53 -0000 Hi Luis, On Fri, Apr 22, 2022 at 02:25:13PM +0100, Luis Machado wrote: > v2: > > - Enable disassembler support for bpf, cris, loongarch and tilegx for > 32-bit BFD. This prevents crashes when GDB tries to find a disassembler > for these architectures and runs into a null pointer. > > -- > > The following fixes the GDB build for 32-bit (tested on 32-bit arm) > for the following combinations: > > * --enable-targets=all --disable-sim > * --enable-targets=all > > Previously I was seeing failures of this kind: > > binutils-gdb-armhf-bionic/sim/bpf/../../../../repos/binutils-gdb/sim/bpf/../common/sim-close.c:43: > undefined reference to `bpf_cgen_cpu_close` > > binutils-gdb-armhf-bionic/sim/bpf/../../../../repos/binutils-gdb/sim/bpf/sim-if.c:166: > undefined reference to `bpf_cgen_cpu_open_1` > > binutils-gdb-armhf-bionic/sim/bpf/../../../../repos/binutils-gdb/sim/bpf/sim-if.c:179: > undefined reference to `bpf_cgen_init_dis` > > This particular combination of switches has not been tested for 32-bit > hosts in a while (since November/December 2021), so there might be bugs > that we need to address. The patch makes things build cleanly though. > > Tested on aarch64-linux Ubuntu 20.04 and armhf-linux-gnueabi Ubuntu 18.04. > > It would be nice to exercise this on other 32-bit targets, and get this > included in time for GDB 12. > --- > opcodes/Makefile.am | 10 ++++++++++ > opcodes/Makefile.in | 10 ++++++++++ > opcodes/disassemble.c | 4 ++++ > 3 files changed, 24 insertions(+) > > diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am > index afd19fa7785..681fbc07584 100644 > --- a/opcodes/Makefile.am > +++ b/opcodes/Makefile.am > @@ -124,6 +124,11 @@ TARGET32_LIBOPCODES_CFILES = \ > arm-dis.c \ > avr-dis.c \ > bfin-dis.c \ > + bpf-asm.c \ > + bpf-desc.c \ > + bpf-dis.c \ > + bpf-ibld.c \ > + bpf-opc.c \ > cgen-asm.c \ > cgen-bitset.c \ > cgen-dis.c \ Looking at this patch, I think you you may not have seen Alan's comment, which je sent on Apr 18, saying: https://sourceware.org/pipermail/gdb-patches/2022-April/187960.html | Anything that requires 64-bit BFD support does not belong in | TARGET32_LIBOPCODES_CFILES. In fact, the whole point of | TARGET32_LIBOPCODES_CFILES was to fix --enable-targets=all breakage on | 32-bit hosts without --enable-64-bit-bfd. Why would you want to put | bpf here? It's a 64-bit target! (I see that you weren't in the list of direct recipients for that email) > @@ -178,6 +183,9 @@ TARGET32_LIBOPCODES_CFILES = \ > lm32-ibld.c \ > lm32-opc.c \ > lm32-opinst.c \ > + loongarch-opc.c \ > + loongarch-dis.c \ > + loongarch-coder.c \ > m10200-dis.c \ > m10200-opc.c \ > m10300-dis.c \ > @@ -234,6 +242,8 @@ TARGET32_LIBOPCODES_CFILES = \ > ppc-opc.c \ > pru-dis.c \ > pru-opc.c \ > + riscv-dis.c \ > + riscv-opc.c \ > rl78-decode.c \ > rl78-dis.c \ > rx-decode.c \ > diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in > index 3ab8bfb0548..d3eee49b169 100644 > --- a/opcodes/Makefile.in > +++ b/opcodes/Makefile.in > @@ -516,6 +516,11 @@ TARGET32_LIBOPCODES_CFILES = \ > arm-dis.c \ > avr-dis.c \ > bfin-dis.c \ > + bpf-asm.c \ > + bpf-desc.c \ > + bpf-dis.c \ > + bpf-ibld.c \ > + bpf-opc.c \ > cgen-asm.c \ > cgen-bitset.c \ > cgen-dis.c \ > @@ -570,6 +575,9 @@ TARGET32_LIBOPCODES_CFILES = \ > lm32-ibld.c \ > lm32-opc.c \ > lm32-opinst.c \ > + loongarch-opc.c \ > + loongarch-dis.c \ > + loongarch-coder.c \ > m10200-dis.c \ > m10200-opc.c \ > m10300-dis.c \ > @@ -626,6 +634,8 @@ TARGET32_LIBOPCODES_CFILES = \ > ppc-opc.c \ > pru-dis.c \ > pru-opc.c \ > + riscv-dis.c \ > + riscv-opc.c \ > rl78-decode.c \ > rl78-dis.c \ > rx-decode.c \ > diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c > index bd1b90b3956..7228df40ec0 100644 > --- a/opcodes/disassemble.c > +++ b/opcodes/disassemble.c > @@ -42,7 +42,9 @@ > #define ARCH_arm > #define ARCH_avr > #define ARCH_bfin > +#define ARCH_bpf > #define ARCH_cr16 > +#define ARCH_cris > #define ARCH_crx > #define ARCH_csky > #define ARCH_d10v > @@ -58,6 +60,7 @@ > #define ARCH_ip2k > #define ARCH_iq2000 > #define ARCH_lm32 > +#define ARCH_loongarch > #define ARCH_m32c > #define ARCH_m32r > #define ARCH_m68hc11 > @@ -92,6 +95,7 @@ > #define ARCH_tic4x > #define ARCH_tic54x > #define ARCH_tic6x > +#define ARCH_tilegx > #define ARCH_tilepro > #define ARCH_v850 > #define ARCH_vax > -- > 2.25.1 > -- Joel