From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80054.outbound.protection.outlook.com [40.107.8.54]) by sourceware.org (Postfix) with ESMTPS id F407F3858D28 for ; Mon, 25 Apr 2022 07:41:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F407F3858D28 Received: from DB6P191CA0005.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::15) by AM6PR08MB4422.eurprd08.prod.outlook.com (2603:10a6:20b:be::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Mon, 25 Apr 2022 07:41:05 +0000 Received: from DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:28:cafe::7) by DB6P191CA0005.outlook.office365.com (2603:10a6:6:28::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15 via Frontend Transport; Mon, 25 Apr 2022 07:41:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT028.mail.protection.outlook.com (10.152.20.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14 via Frontend Transport; Mon, 25 Apr 2022 07:41:05 +0000 Received: ("Tessian outbound 9613c00560a5:v118"); Mon, 25 Apr 2022 07:41:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 01c52390d6619f05 X-CR-MTA-TID: 64aa7808 Received: from bd265797f6e5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6FD894B6-8BA8-4265-B2E7-DC1E8B1A48D8.1; Mon, 25 Apr 2022 07:40:59 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bd265797f6e5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 25 Apr 2022 07:40:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IFi0BsyCkgNlAAjCpkfm1Z1+/L33Kc2wEsjSyFM3lOtNQd7TlYKHAKkt0/VnQNIB/49lz8MlZ5JFG0Izy/gcOh1F+XHM9gzqCjAbSia/LgDhOK2iaku8b+owRuw9er0ZvsKeWoRYe4MmEhTpseQ9T4WKuyAsyhrKXfvQHA/drOglaFN7eOy3mFpBiOv+fW51BOGPlqnain2xJ+O+3OFMXt40vzlG6eNP0jn3sCxyHrdQ/ATytT2omr0bvA5H9EzXQVljcWSJadij8QNpix7W89WdyqyI46bHMQFYtpnA9jjwsg0nffht6CdPdL9E0sVhR9a8faSSrhMK0HB0aPhE5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OiPO8dfNF853NZ/AMhsVC0O8Sed+pK5+ig79VW1YkZ0=; b=dOzXVvFfnyuS+TV953QJNSOfH2WjEGF58k+OTw41sV0tF99IuOSUUs+tnBDXusdCQq+l+v3v+EDY6wpVsi8isRN0hG4aoSsn9QyK+ohEFfu9zqGEBx66p8h399e3kfvgHoNOFwjUwgp5RNxVXS8CSxNTirkNpxyymh6VLV1eDbcbmnHddoN7Na9IFi7wGvHv/q9wga4GA1rFFoGmbhZkdcqjByOUroe3MonbFakHs1RNrUyeYKA1QnpIHGgt/KZK4AhH5oo31Mo/6x9By1E/KS2fn6gXNwwRYpWyQuPvP4dUGNFpZ9uAnibvlM3E/KNwUAKriwHqqpmB6aip3AhKrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by VI1PR08MB3296.eurprd08.prod.outlook.com (2603:10a6:803:3e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Mon, 25 Apr 2022 07:40:56 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7080:6233:cf8f:a8a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7080:6233:cf8f:a8a6%7]) with mapi id 15.20.5186.021; Mon, 25 Apr 2022 07:40:56 +0000 Message-ID: <2b02c5bd-1db2-f322-79c9-e6878adf8b67@arm.com> Date: Mon, 25 Apr 2022 08:40:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH, v2] Fix 32-bit build for --enable-targets=all Content-Language: en-US To: Joel Brobecker , Alan Modra Cc: binutils@sourceware.org, jose.marchesi@oracle.com, vapier@gentoo.org References: <20220422132513.22471-1-luis.machado@arm.com> From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0068.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:153::19) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 61c37ecb-c803-486c-652b-08da268ef440 X-MS-TrafficTypeDiagnostic: VI1PR08MB3296:EE_|DB5EUR03FT028:EE_|AM6PR08MB4422:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: LUSP/R7Wm3QRMSdu6KtIfiFkLuJQICrS51ft6hup/ojr1v9nf2vR9HsT+VI8Cnzo/L+epnQ+i+tTJ9UnfHOBVyRlId4MnHD0yWYL3m+xvPa2O9/1Fq20yEyv9dfKRX6C7R4W/cy7lGyeYs3XgeiPHchvIKknWSxgFrOkQ4FYShE8zbgQ3kT0AeMmwpJ6TkHsHRW+riMK9qGEz2lIHVBevugBvMmjSigtTGGxdZnHLR62qnsdafLaP8FaTXmKvKnSi+Zrfy7iuHuzOZeEpyUJNbdPgnPfxutOueS6e3dES4n/wNpNBADZeLPA23SFYyS7gqM+FmDwS3TT7nAI/bG3LfZ13hmOaRNNcq0A+2ltQBv9wCodiB2ODo/XxCDqB0I5jhpw0B2EjwS/hJIAE3P6c8B7UMSevVBTaReCJx4vzjlcTijaCyPhozf207g6hMwghzQ8zuZCKxcJ+Sbbon7Qn70W64GukO8KrlspCpGmHv6uj1OBZGXHUDh9d2zHi43VpoJk8hlOOogBzL1XRYtkCWQntBMS6kah/gFcmC9fLpruMaG2m+Hp5aCJxdDiPrbx2as3O+M2UVhOJC68866pNuO+n8O+27hprb6VmD7RB3hHIzH1ECnFQKOgYV1SdZbmMnICnCgccQXsaR7PhxJe8wH0+Pt9pMMCRo+IkdBRRpbB+6Grzqgp2toy783ERfD+Yeg73E8ImtZIzo6TDCdpHTopj716LDEQkFOnoM0eI6uYQL9S4Pnj5Oiaz3ZI1szZTiDoHmR7G7VeaeC/HI7xi4SPgHsgCdKEbiF8iXw7zWr5+HEWbuEY2s801Qc4hP4T X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(86362001)(83380400001)(6512007)(6506007)(31686004)(26005)(2616005)(186003)(31696002)(8936002)(44832011)(4326008)(66476007)(66556008)(8676002)(38100700002)(5660300002)(53546011)(2906002)(66946007)(36756003)(966005)(110136005)(6486002)(508600001)(316002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3296 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6a9e5ff3-d574-4cae-4c5d-08da268eef0f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DbNTRolrckUlWQX7FzO7y856cVbDchRA/jY15PCyZEwknY4cogsIxxRIRLzvEPW02B+kaR76wA30mjxEfbGCRPOEaqDGJ7qHRTXNkdfWVpvI8h3YGvBRNkHQ7RDMrDz3fYh2jaooUdsJ/E7m5lQCbfbEg25rUfzcYksWNUi3tyOVwVCQD07nHvmHyFkJmvcXPMH4EbLza/6/dR3Q5rqwIMk5sr8BUFy6SS5oRipRgcQN3ne5sqt9QMlRzsnTBlUnuaetlxDrdhsOiEdOgwEN1HFz7qcm1XmXOs8a7m+D9bbmdbQkaNWZB3uEB7XBoODJ9aXls1HPvHq8g73sksXgrRNtgnWa/vGdM9GTp0HOS1TK2iFZGJYP+3ILA3jabKTFkTDbdmwXjr8mv9UveOmyoKlPe83XvvOVFdAgiLcj9u8JpeNFU01MeIGr910DEToXOTFnnot87zwZ4qXwWON1ZLSys6wVLNSv498trS/qcNCNR2phde9yBvL9RwWnpa+MhcLewcr6uMMP1pAoMKlLU46zq4UhS41oSReLtqJmYY3NOdsxDTarnVBGuMOOA6Nlhz4jC0S6g7M2K44+2MLaC4e6mH5TE9DMBQwZSbuy1nCcXlfZTBueHlUl3CWSHTd5+JX8YYCe14DGyuoNusZg0kTBnp5aOVXfVBg9JW952habd/L8Delpp+wFFrgQmyc5Be9s1wpaj85TZD7kq5EVJRos/Q2oM3BK3yz5uyN/VLWZO5POJ4ipOcZPOJuJxsRrpyYF3vQCDzC45NIbFIO+HUwDJuWI5NUgygDHBNkK/gM= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(4326008)(2616005)(26005)(6512007)(70586007)(70206006)(8676002)(6506007)(53546011)(31696002)(107886003)(316002)(6486002)(82310400005)(966005)(40460700003)(36860700001)(47076005)(336012)(508600001)(81166007)(186003)(110136005)(86362001)(356005)(83380400001)(2906002)(44832011)(8936002)(31686004)(5660300002)(36756003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2022 07:41:05.1262 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61c37ecb-c803-486c-652b-08da268ef440 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4422 X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY 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: Mon, 25 Apr 2022 07:41:12 -0000 Hi Joel, On 4/24/22 15:58, Joel Brobecker wrote: > 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) > Yes, it looks that way. Unfortunately --enable-targets=all never really worked OK for 32-bit builds after splitting 64/32 targets. It is not clear to me if there are bugs elsewhere that are preventing a clean build, but right now it doesn't look buildable at all. Alan? >> @@ -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 >> >