From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60054.outbound.protection.outlook.com [40.107.6.54]) by sourceware.org (Postfix) with ESMTPS id B8AE4388703B for ; Fri, 29 Apr 2022 12:35:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B8AE4388703B ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=i1Ya2o0An/V0BoK/ut3dcAZUbhZpOcDuLT8IuleAqsdxz4HbFibY16c1+lH9X5RQIe9na8tRNXBau/VB7TfuuN4CI7sFXip3X39WpR9AdkE8j2hnc834Dy5lScNTX7d2PCf845Z8Q3Wq/8hU+OCpOnp57C1rKu3TMtnpmj7nDOI2ncbGmCPzwVlnp4AO/y9R0i/KUIHxphP8UAfDRNdoEijd/lX8dV6tsaveD1+lUSl+FSFvz3wQB9zYNXIr2L73ltecaYk239JXTniIBY34YbHhw9bHkMJx8ovlJ2RlrCHViYLWIFaz7khfQDbw31CJQPpXIluf5U+gzpckkVj3Fw== ARC-Message-Signature: i=2; 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=MP9im+7git0aq3pOUHMaHMDb5A2wclAfiPX12FmKmro=; b=AAOku67l5Mj7tjLwO61F/jd6cAO02dsx6xDb4v1w6v0dZEhH9EADO7AgKeGZz5XCIALQcbEoymBSwIl4GLsNmfuWRKN0Nwvqeb20peyzya22JuDGkoRHaAnRoSvpvyo035e4EwNUeF6chEbHcYoOXSwcC+xgfBAN5UhnTSMz8OCEGnS6wAa/NWFLEVJc/pDU9dDnII2u6fFJtq28rqMnGAPJAAEDnWmVYd/gXe6YWMFJcMyNG06I02Lgir6K1Wa95as39ZpBHBsoPOLxYm+tqSTFne468DYCl3so5kFQxFhs3NuQw8Yh9ldNuioUQfT30vhgMMtLy/srZFvJ9PRIFg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from DU2PR04CA0253.eurprd04.prod.outlook.com (2603:10a6:10:28e::18) by AM0PR08MB5201.eurprd08.prod.outlook.com (2603:10a6:208:15b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Fri, 29 Apr 2022 12:35:15 +0000 Received: from DBAEUR03FT056.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28e:cafe::e1) by DU2PR04CA0253.outlook.office365.com (2603:10a6:10:28e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.14 via Frontend Transport; Fri, 29 Apr 2022 12:35:15 +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 DBAEUR03FT056.mail.protection.outlook.com (100.127.142.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Fri, 29 Apr 2022 12:35:15 +0000 Received: ("Tessian outbound ab7864ef57f2:v118"); Fri, 29 Apr 2022 12:35:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 674d5cb36c14de4b X-CR-MTA-TID: 64aa7808 Received: from feb8b32e7621.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EBF42356-2867-4C2F-BF4B-A6BCA43329C6.1; Fri, 29 Apr 2022 12:35:08 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id feb8b32e7621.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 29 Apr 2022 12:35:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fP2pRBrqHADcJwI/Z1vkYHNAASSv17LcxxzWAvtAdGo5NTlctLHjk6yAgeoTVYm4pLjyssyf1FyoZAQJPPb3Un21uZ+QCJQJ90p9DRJXuw6d3975tk4h5BLV6RZ5VZEW5tB20N3aAAAZwNmUQ+SJFBI5oclVjnLrF1KxHUa0k/EewSF1Wp10Dq6SkH2ceNCXQNlP+ugHnHEmPFv/9UnmCiBBm1kznu94xc8zLNco05Ijr1/i1UCcfsfbOMMaLHnSC+qxdIPZBjNJ4gxOIk6NwzLd99xs4DceJtkNFvsqcsJ6jR2IMAmQqY8abN0UiXqvAJUb9mCg8ZasUNP84lGj/g== 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=MP9im+7git0aq3pOUHMaHMDb5A2wclAfiPX12FmKmro=; b=hJNzkxwBxGx7Cq9eHzSThuLOnt/ygPLUWUYhCynnj7rrCXM83Jate7wALTwps5MampFCw70KhaPxRea8qw4aMX7lQpj2Xq3XBzTub0b/6Db9+817jGXL6xxAzJJe1w+1uNBUnT7gkLaVlaW1LXdmlG53GvlyA4FY2hXAgbxgP5+09ObZ6bzZ5B3JSFo3EbUZjU98OpFAFLo9pEJbvwzTcIsuVDH0BZgQVCVOOo2OLtho/236adVFu5wfZEqbfBhENN87337Ql8ko5ZNgATMLUfJF7ZBQd4nJNKl8XLa7Kawi+PYJmZ4wUlKFu09U57FWNE2pIZZ1q8MRqL+WBgTNQg== 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 PAXPR08MB6864.eurprd08.prod.outlook.com (2603:10a6:102:132::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12; Fri, 29 Apr 2022 12:35:06 +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.023; Fri, 29 Apr 2022 12:35:06 +0000 Message-ID: <9d9ad2f0-ce12-b701-371e-7bb9eb0356cf@arm.com> Date: Fri, 29 Apr 2022 13:35:03 +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: Alan Modra , "Jose E. Marchesi" Cc: Joel Brobecker , binutils@sourceware.org, vapier@gentoo.org References: <20220422132513.22471-1-luis.machado@arm.com> <2b02c5bd-1db2-f322-79c9-e6878adf8b67@arm.com> <87v8uwi7xi.fsf@oracle.com> From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0096.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::36) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 0b83661b-5bb6-4590-f5ec-08da29dcb64a X-MS-TrafficTypeDiagnostic: PAXPR08MB6864:EE_|DBAEUR03FT056:EE_|AM0PR08MB5201: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: HQeEDdDuUm0PRhnAz+jA7vRHjnDTcb2R3Tst2L+QPyG3j3mvDQs6Y0k4u+VnoVpCXMElC1I4/kDY8wzpy9PwkX74A0LlBWjN9iRPykOQAZBmj5BxHjzljCT+svq8tBiGxNx0H/juQG1hWpSvmuEKopVJP/UkQ7IIPyWkEg8r1CHttpYo7pQqLDZ0akuj2r/CDYL/SILqU3C4lPJg+wmh77tJCKlsXiX9ubNhyLk0KTDJHv30tGKsjlonQ1uNE+NR6l/yNJOzTdfvxscMGn7SkPckZa7QTl0sz6Rcr/QPDNTCvi1TBQEBSCh+zDPYHCpggCbOJhp/NmEldjsfLYFtb74iQDAUaRTatGDJnEuOrlaOMsRBmjP1XYddxmOI/jPoOEhNg29qghq957pc5tqyvmOAW5UNRWcF3tM+rnk385AbgAYYtPpe2x629BHp4St1NUkwQIPlfMJBPsVuZxepYSMvAJOpgd9DNnuwmpQ4FC4yNFPL2GsyDWt378u5D9D+Hg93jcebMhBE9cfP+aW6PV8nAnA3wLNL7/h/fKrRge8UDCgXstMv4NFqn23Uj8N2v7FWq9/74EUBxfU65xBqGIMvdMipk/glyuqaNpFT1lMvkb/I1n5IgaID6+mif2Ai+OlU/9BueUEYRR6u63dvBGVOZCrRzSU7WzaRTYTELxPt0gCy1ceFWegoa9NFye4LQFN6soO9843j1hYz1sC+R2WtAR6Wxw0tupYtgjJuf5xKqRX1JBuEeFBjUHbT3vfS9JTVSWvqxyhkSuFJP5Xkkaxs2gs1mrMbKM7+5m4FaYSkma1sK9aS8L4TaqyfCkKG 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)(186003)(36756003)(5660300002)(2906002)(66946007)(66556008)(316002)(66476007)(44832011)(83380400001)(8676002)(4326008)(8936002)(31686004)(110136005)(2616005)(31696002)(966005)(6486002)(86362001)(508600001)(38100700002)(6666004)(26005)(6512007)(53546011)(6506007)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6864 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: DBAEUR03FT056.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 70941fe3-637e-4864-5e17-08da29dcb0b9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7LQLtcsjdBt3oKfWDuxIr6FuOO4Uz8kEdEQya/UMNvvjr0FjT5V11nBlGN0yWnx4kysLRPqcaupbEmHH3jRwmoKuQR6V8T62TxPe1wAbIhNN9TRhDVS5TqytrF6KCJxEZJprIVR3RnEmC5WuavgbsirI0+sdS6wtUbLDZ5W94yBHbrrzNCAkay+oA44U6OTkLdTRKdM5ABQmxFiw4NoOP8Imys5ztISIC9zsq1cV1OsvpqMvNph8HTZ9CrdQRmRB4j4paS130VDIArzrpPtGK4cmPd6Ee5WwW9B+7LMFpnPo5TCTpjgcELr0VgUZERCBO5kW5BZ+fW8WD6Opz/EK/J+P0Eg+0hUU+5WBmgP1++TPohxMwiObvUT64/368+5M6s8pHzrNYdtlH9HFr7NjA2BHWkGi/HK7DodHtrGD+U5eM/V7CCql0uIkv1a4otcNhbEfyj4iVqfuQYwO4J2FeTQ8YNlywRKbBq+LqGCoKpTaf1LfowCP1bLeQGtIAwEREiQx3R1BdK0h8K6MnEKrMQPmfvOsgBqyQyiQSjLfTb7tl8Y8DzZRwI70J4BDCwA1G32D46ep0DNvsPSw4PKn/dZGPAqa/e+17v6lZm321gryIeHxhOmjOt+y9+0fZYeZQ8mczF3c1kD4TpgKRNBZtNNUbbZZzNteaMH2aaA+ikAGJptc9deGlvh68waVGFnCltMpxg8tliWbz/ekAJraefENYhWOLqo+vxEhdEETjU9Qm3wjQlqdqwZqJ8Ukv/HdKkIvq1p9R2DfrGLJp3r4wV7WV7bUAhGXyGYyr5GC7+w= 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)(46966006)(40470700004)(36840700001)(26005)(70206006)(316002)(70586007)(110136005)(6486002)(966005)(83380400001)(40460700003)(36860700001)(186003)(81166007)(356005)(31696002)(53546011)(86362001)(508600001)(6506007)(6512007)(6666004)(336012)(47076005)(107886003)(2616005)(2906002)(5660300002)(44832011)(8936002)(82310400005)(36756003)(31686004)(4326008)(8676002)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2022 12:35:15.4100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b83661b-5bb6-4590-f5ec-08da29dcb64a 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: DBAEUR03FT056.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5201 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, 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: Fri, 29 Apr 2022 12:35:20 -0000 On 4/26/22 14:22, Alan Modra wrote: > On Tue, Apr 26, 2022 at 10:07:53AM +0200, Jose E. Marchesi wrote: >> >> Hi Alan. >> >>> On Mon, Apr 25, 2022 at 08:40:54AM +0100, Luis Machado wrote: >>>> On 4/24/22 15:58, Joel Brobecker wrote: >>>>> 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? >>> >>> The major problem I have with your patch is that all it does is sweep >>> a problem under the rug. While it may fix a build breakage I doubt >>> that it actually improves anything for users. For example, if I apply >>> your patch for a 32-bit --enable-targets=all binutils build, then >>> attempt to disassemble one of the bpf gas testsuite objects: >>> >>> $ ~/build/gas/all32/binutils/objdump -dr tmpdir/lddw.o >>> /home/alan/build/gas/all32/binutils/objdump: tmpdir/lddw.o: file format not recognized >>> >>> That's due to lack of the required support from bfd/elf64-bpf.c to >>> load bpf object files into BFD. >> >> Could you please elaborate on that? >> >> What is it in elf64-bpf.c that must be improved in order to support >> 32-bit --enable-targets=all binutils? > > It isn't that elf64-bpf.c is missing something, it's that the entire > file is not built on a 32-bit host with --enable-targets=all and > without --enable-64-bit-bfd. > >>> I think you'll find a similar result for the other targets your patch >>> touches, and not just with objdump but with everything else that uses >>> libbfd. >>> >>> There is also a minor problem with the patch in that it adds entries >>> to TARGET32_LIBOPCODES_CFILES without removing the corresponding >>> entries from TARGET64_LIBOPCODES_CFILES. Similarly for the defines in >>> opcodes/disassemble.c. > After some investigation, it seems the bpf target is a bit of a corner case. It's within the 64-bit bfd group, so libopcodes gets built only if --enable-64-bit-bfd. Otherwise, libopcodes doesn't include bpf. The bpf sim gets built regardless of having a 32-bit bfd or 64-bit bfd, so in the case of a 32-bit build with --enable-targets=all (and no --enable-64-bit-bfd), libopcodes doesn't include bpf, causing a libsim linking failure due to missing symbols (. Things work fine for 64-bit though. I think the fix would involve not building the sim if the bpf files are not linked into libopcodes. -- libsim.a(sim-close.o): In function `sim_close': /builds/binutils-gdb-armhf-bionic/sim/bpf/../../../../repos/binutils-gdb/sim/bpf/../common/sim-close.c:43: undefined reference to `bpf_cgen_cpu_close' libsim.a(sim-if.o): In function `sim_open': /builds/binutils-gdb-armhf-bionic/sim/bpf/../../../../repos/binutils-gdb/sim/bpf/sim-if.c:166: undefined reference to `bpf_cgen_cpu_open_1' /builds/binutils-gdb-armhf-bionic/sim/bpf/../../../../repos/binutils-gdb/sim/bpf/sim-if.c:179: undefined reference to `bpf_cgen_init_dis' collect2: error: ld returned 1 exit status