From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30065.outbound.protection.outlook.com [40.107.3.65]) by sourceware.org (Postfix) with ESMTPS id A6605388B5B5 for ; Wed, 8 Jun 2022 12:50:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A6605388B5B5 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=eE+sQOwx3TL6SGtdT/nRtO31ZWdrzkZWu97yW/Ap/a40VIQcrKJ61jBAfNjI/Is8ynSbtE4L71Y3pGFs5r0oJJeqTHQD9FmTtjAJ6cLK2Xw7/A36X3SQ3iMVHom6pAMR7aVzEDGGtdfjC7F4Ss5nOCBg4Gb6Y6ebdjfic5tyL4NE63cgSIRVIFKIxRfukkGyWrPeNKWrOUDpykKuO3FM3T5UbDMXvQs/AZLtQ5WANn07LPIii8payse9q07HSkwCQpUDvCdwClnkBbEgcv/prm57bbBMNWLqWFgurATZVzXCkarii5A9VqfWWBijseVNlglmc1kTPQrt5TwJjknk/w== 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=dHeRVa2NH7AdJAHmiVsWzOD6qRqIHT4YGJz6I1O2qkk=; b=LiBA+I9y9sylKUh9XHY3t5DPoiE8OuMK6/PgasBe6Yont+v4ns1U1gHRTP4etSTx42QXtmJmIs9CsbwS1YbJLqgfXM9E7JRikqK4pcJ068Lvj1kpJXNyrQmfqkJoGz5Q5f6XO0CKndhbiyMaHple8L9BQuKeprOkVQo0J+EMxgxDFqPnlk9k6kzxenq1kheCVfv3LnDrMGksbMp7U4lf6lSRw3vVnXz8d0C40eVw1bywIDsgHB6ApQ09R+cZyd2bdb7KSffxJTRw5I5x4Y2Tg8yq2WoL3QxIpIh7swZt+MBO1oTBCrWl1ZIwYNTF++1YnyF++2a2KQM5Ij1Bzyfusg== 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 AS8P189CA0008.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::16) by VI1PR08MB5294.eurprd08.prod.outlook.com (2603:10a6:803:de::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Wed, 8 Jun 2022 12:50:27 +0000 Received: from AM5EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:31f:cafe::7d) by AS8P189CA0008.outlook.office365.com (2603:10a6:20b:31f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15 via Frontend Transport; Wed, 8 Jun 2022 12:50:27 +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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT031.mail.protection.outlook.com (10.152.16.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Wed, 8 Jun 2022 12:50:27 +0000 Received: ("Tessian outbound 4ab5a053767b:v120"); Wed, 08 Jun 2022 12:50:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2aaf8c5f226afdd9 X-CR-MTA-TID: 64aa7808 Received: from b4dcf0fbd312.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E2EA3395-EF5A-4157-B40B-226C22F2510A.1; Wed, 08 Jun 2022 12:50:20 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b4dcf0fbd312.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Jun 2022 12:50:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fp/vB2M0UXXb/Yh+rAbaEpB5Cx0CJQfmcnuDfrJfsj7NA76b50ujs8qPLLTU1jKCtwHaKTYSwoG041zmXc3nmGCfpn/c2aOG5LxufwrysilEV3OpAvUuBdxpp7ES8JSgy69jjHYCjczHYdkSBBZjuay16YILMg/LcwBdcNzHSL7BPs3AdZTLiohAa8lwXbWeNqrgtRj144Ye/okfJBX7hB2r1K09NNdqUAapec51iLRq1W68mumsjTT+1kEDkH9b1eYJSJR8WcMj/cWg/fZ0aLDX06lRKwyCC80org5Ur0H1tPgiGnFA4C2qi0jP07SPAQ3kxvskewf/sBS/L/ThAA== 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=dHeRVa2NH7AdJAHmiVsWzOD6qRqIHT4YGJz6I1O2qkk=; b=RSy10kc5eH7T5h3Ha0G5EU2+qVfR+258FTLQX/bqh21ArhxDpsU/up/rhqJWh8iqmr+TQ/m/aoEdB9o3jVnn9Svnau6/Li7kI6gMZ8t7OqmrB2qNWG9814woZqLsP4Tswc33fz3vapWbj4gUQ9ELc6IzKn71tWty6u2e5ykwgm3xcBfiD6IbmnTMUonPlicsFsg9og1Rf6tolYegR+jflk7WDRk/bN3Cs6OM8tOZTpfbvcj2As5DmExr9e11Dgy3wiOgLKVpFA8pqefMR4PgVPJPRfCC72bSt3xGu1Tz10JpzYv9qinZ0Oyr9/lGdeVcXHlhPTtY1Mh8mT+PFkoSsw== 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 DB7PR08MB3420.eurprd08.prod.outlook.com (2603:10a6:10:4a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.18; Wed, 8 Jun 2022 12:50:18 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::9545:ff73:df89:3e50]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::9545:ff73:df89:3e50%7]) with mapi id 15.20.5314.019; Wed, 8 Jun 2022 12:50:18 +0000 Message-ID: <26a30102-656c-0701-3066-8ef14b1fe0e4@arm.com> Date: Wed, 8 Jun 2022 13:50:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2] aarch64: Add fallback if ARM_CC_FOR_TARGET not set (was: Re: [PATCH 5/5] gdb: native target invalid architecture detection) Content-Language: en-US To: Pedro Alves , Andrew Burgess , John Baldwin , gdb-patches@sourceware.org References: <71a986a5-2cfa-543e-4034-70f3af7dfecf@FreeBSD.org> <87ee09d4rt.fsf@redhat.com> <09afe250-9573-45e1-993b-a2f911f03630@arm.com> <87ilpdhn73.fsf@redhat.com> <87ee01hed4.fsf@redhat.com> <12c3913e-186d-b676-fe52-cc3322b00926@arm.com> <5c316bab-c2d3-309e-f938-7480e861b444@palves.net> <9c711ccb-a558-8225-524b-5a1fa93fcee9@arm.com> <22be6164-79d7-c0f7-1b1b-c633be452e81@palves.net> <755636d3-b2b5-9eeb-1b23-6f9830e3edbb@palves.net> From: Luis Machado In-Reply-To: <755636d3-b2b5-9eeb-1b23-6f9830e3edbb@palves.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0276.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::24) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 4669f740-2503-4fc0-fae0-08da494d7656 X-MS-TrafficTypeDiagnostic: DB7PR08MB3420:EE_|AM5EUR03FT031:EE_|VI1PR08MB5294: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: YD3sFrlSob2z1YjgwitLWQeWEODEAInH2wX7kuN3LPKbWec+koh087cx1D1d/fHiLmEuSZhpJVfpwAzPBElYr7KLLNBaxOMrH0Z/hyLGY9rN6KPWpuVLL89//lVOKkHVFFdjtm8Cpxt9FFnDjeGlEqGlgHQ7K4tsWLCUmUG5tGoSpCGMDCiYdkytq50ALRvzibtaNtmKsNb7Py/OSPOHgqBWgZ9OkZ8+OXICj1HunzaJv6U6UhIUC6r5YsJPPleQ5DOBK268BB1n5ly6xk6BdyfZ+UxW0bnubaSaNwzkYkGHZDhFy9aZKX5vBEAyPsCX+/K9Vk43+3D1XjKDIubOV+2sZmPafWFP6lUcGS13tS9Pn9StJKkpJEcUVgTEKgeVWWUCtd9dWNefprQYFi8SDI9SZMv3sddBL6BXqFRISvBUrVfX4FEbn3CYGN6vyAkDdzIN4DoHZF4hcXQS9bBSWQOD65HN+hKeQqaP0v7BdCqj2O6nsJjdvhEdmotJLpf9nfyLBViUpE6FVpxA74ZgWR7f/lZ0Cgc4tJcX3eR0D54SMkvehN8wvCH8m+WRc1FZAnHcVtPhQab1fv1JuUaNpBV+u1o5RPRz4p353Do6gsmXfuksjmeEHeVW6E10CtN3zX4CQzQBW5naJdZi5chGIfjV3Hgs/z0VOSFZ8hirYkgx/8qnI/CnsY9UqRoWCHN7AkyhzSJyfj7hPFUxnOEKe5QZLM2gJ6Hy/s+slSQwGTeTsMNrYqAoSeTf5dkRqYG8PNGTHSFE9GJKGfMP3BWw5K5WO10sLnyVXkvDwlbbwMq0dKuYKBWBK8U3jYTVmda7 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)(53546011)(5660300002)(31686004)(86362001)(66946007)(2616005)(66476007)(66556008)(8936002)(83380400001)(508600001)(84970400001)(6506007)(6512007)(31696002)(36756003)(6486002)(44832011)(8676002)(186003)(110136005)(316002)(38100700002)(2906002)(26005)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3420 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: AM5EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5c905a8b-1c27-4576-89b0-08da494d70fd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MwTLQWjPydgWkK7Rmq0H4DEoBccHRU2LKP0at92Hyc0pkdqRj6NGiB3XHltyNmQzPITGCYQJnTHXgReMiR5IZEWxHTNYmoSHZeb3R4akTns4vk06c5+kxU0vTE1kqaMx6/o3rO7ydNKYT5DnQ+nBFhKOSeSem55nJ2XBM2FkFdVI2g3gDbZtFFIIwbRTpM9rtkLCAuHPks40JZoibtKGnFjMJksUHFOd49fqvRnIBsWSyiTw2JH0oW9i9kHqNQWkB8zWixpzO1SLFe48FazNX4ZQibJ3QGjAUndTybqFr7dQwkQOWTmVRy00DTHfjvgg9A6uC2DE54IynpY//mc76fHBOdn8QH7Y9IpMgorrAV1heAOSFRsJrX1k3wXEFLpIYrvAPxv1dSWi+qfvLDmVy21inCAloapyKvonXmO9xR1vhuDjxIw/M7VRnnWjzYuUZt1j3OGaHP0ykefsj0dlJO2PBGYJi8II0G2o+0BuCtR4tm1wqoCPhF+18VfNt4DnOZu3epknz8tBmCXgaN4NKFgp2sksiUKh7aUPoJVLUvgu7UYZ2S1gh/nFD+fHBmd0hvO1vq+KmiTCGltg89fZO4L4nqLC7xEWZXKX6RLx9ByR6FXU3E/qmo5nSVZuzYWXKZM0ZPaY4bwWnNGXd/dPQ3VAeOs8Zlm+7PgEQchY5UHsLkQT2CPkyBH2/qgJdzEZ7vRCmocW1BMayKJUfv1ybPr4DasbG5eB6Ki9TSvH4QuU5X21IRWRhwIQNYQhqrk49W8glitNhbnDgYdt2ctal2in0/Qtr23X9/JEF3l5JoY= 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)(36840700001)(46966006)(40470700004)(86362001)(83380400001)(186003)(336012)(47076005)(110136005)(508600001)(36860700001)(53546011)(82310400005)(6512007)(26005)(6506007)(31696002)(2616005)(316002)(5660300002)(6486002)(31686004)(70206006)(70586007)(356005)(84970400001)(81166007)(2906002)(36756003)(8936002)(8676002)(44832011)(40460700003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2022 12:50:27.2269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4669f740-2503-4fc0-fae0-08da494d7656 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: AM5EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5294 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 12:50:33 -0000 On 6/8/22 12:20, Pedro Alves wrote: > On 2022-06-08 11:12, Pedro Alves wrote: >> On 2022-06-08 08:54, Luis Machado wrote: > >> A 64-bit program can always exec a 32-bit program. Likewise the other way around. That should be >> debuggable with a single gdb. >> >> As you say, it's supported. So, better test it routinely. Not testing it doesn't gain us anything, >> other than leading to bitrot, as has happened. >> >>>> >>>> Maybe it would be possible to come up with a way to default ARM_CC_FOR_TARGET to >>>> something that works for most people when testing aarch64, somehow. >>> The problem is that a compiler is not enough to make things run fine. If you have an aarch64 >>> Ubuntu, for example, you'd need to add armhf as an architecture option and install both the >>> compiler and the libraries (libc6:armhf mostly). >> >> That is not an issue specific to aarch64. On x86-64, you need to install extra runtime >> packages to test -m32 too, just the compiler isn't enough, and those packages aren't installed >> by default. >> >>> >>> Another problem is that not every processor/kernel supports running a 32-bit process in a >>> 64-bit environment. This makes things more complicated. >>> >> >> Why "more complicated"? If you're worried about FAILs in the testsuite, then we can e.g. make it run >> the 32-bit program once outside gdb to check that running 32-bits works. If that fails, then >> we don't run the test. Seems simple, not complicated. > > Here's a new version of the patch, doing that. This version also moves the ARM_CC_FOR_TARGET fallback > discovery to lib/gdb.exp so it can be used by gdb.multi/multi-arch-exec.exp as well. I've now tested > this on gcc80 on the GCC compile farm (an aarch64 ubuntu 18.04 machine), and confirmed that it works. As in, > we pick the right compiler (turns out it is arm-linux-gnueabihf-gcc, the third fallback compiler, so the try-to-run > code is exercised). Of course, the testcases actually FAIL, due to 32-bit support bitrot in gdb itself. > > From 689671e40f88f1bf29af2433c7b6c7662c8f38c6 Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Tue, 7 Jun 2022 20:11:32 +0100 > Subject: [PATCH] aarch64: Add fallback if ARM_CC_FOR_TARGET not set > > On Aarch64, you can set ARM_CC_FOR_TARGET to point to the 32-bit > compiler to use when testing gdb.multi/multi-arch.exp and > gdb.multi/multi-arch-exec.exp. If you don't set it, then those > testcases don't run. > > I guess that approximately nobody remembers to set ARM_CC_FOR_TARGET. > > This commit adds a fallback. If ARM_CC_FOR_TARGET is not set, and > testing for Linux, try arm-linux-gnueabi-gcc, > arm-none-linux-gnueabi-gcc, arm-linux-gnueabihf-gcc as 32-bit > compilers, making sure that the produced executable runs on the target > machine before claiming that the compiler produces useful executables. > > Change-Id: Iefe5865d5fc84b4032eaff7f4c5c61582bf75c39 > --- > gdb/testsuite/gdb.multi/multi-arch-exec.exp | 4 +- > gdb/testsuite/gdb.multi/multi-arch.exp | 4 +- > gdb/testsuite/lib/gdb.exp | 57 +++++++++++++++++++++ > 3 files changed, 61 insertions(+), 4 deletions(-) > > diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp > index a1496fb5571..a8e81e29ee9 100644 > --- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp > +++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp > @@ -62,8 +62,8 @@ proc append_arch2_options {options_var} { > upvar 1 $options_var options > > if { [istarget "aarch64*-*-*"] } { > - if {[info exists ARM_CC_FOR_TARGET]} { > - lappend options "compiler=${ARM_CC_FOR_TARGET}" > + if {[arm_cc_for_target] != ""} { > + lappend options "compiler=[arm_cc_for_target]" > return 1 > } else { > unsupported "ARM compiler is not known" > diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp > index e5c2d9cc161..b564e6caf25 100644 > --- a/gdb/testsuite/gdb.multi/multi-arch.exp > +++ b/gdb/testsuite/gdb.multi/multi-arch.exp > @@ -60,8 +60,8 @@ if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \ > set options [list debug] > > if [istarget "aarch64*-*-*"] { > - if {[info exists ARM_CC_FOR_TARGET]} { > - lappend options "compiler=${ARM_CC_FOR_TARGET}" > + if {[arm_cc_for_target] != ""} { > + lappend options "compiler=[arm_cc_for_target]" > } else { > unsupported "ARM compiler is not known" > return -1 > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 402450152ac..ac01a31655f 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -8666,5 +8666,62 @@ proc get_set_option_choices {set_cmd} { > return $values > } > > +# Return the compiler that can generate 32-bit ARM executables. Used > +# when testing biarch support on aarch64. If ARM_CC_FOR_TARGET is > +# set, use that. If not, try a few common compiler names, making sure > +# that the executable they produce can run. > + > +gdb_caching_proc arm_cc_for_target { > + if {[info exists ARM_CC_FOR_TARGET]} { > + # If the user specified the compiler explicitly, then don't > + # check whether the resulting binary runs outside GDB. Assume > + # that it does, and if it turns out it doesn't, then the user > + # should get loud FAILs, instead of UNSUPPORTED. > + return $ARM_CC_FOR_TARGET > + } > + > + # Fallback to a few common compiler names. Also confirm the > + # produced binary actually runs on the system before declaring > + # we've found the right compiler. > + > + if [istarget "*-linux*-*"] { > + set compilers { > + arm-linux-gnueabi-gcc > + arm-none-linux-gnueabi-gcc > + arm-linux-gnueabihf-gcc > + } > + } else { > + set compilers {} > + } > + > + foreach compiler $compilers { > + if {![is_remote host] && [which $compiler] == 0} { > + # Avoid "default_target_compile: Can't find > + # $compiler." warning issued from gdb_compile. > + continue > + } > + > + set src { int main() { return 0; } } > + if {[gdb_simple_compile aarch64-32bit \ > + $src \ > + executable [list compiler=$compiler]]} { > + > + set result [remote_exec target $obj] > + set status [lindex $result 0] > + set output [lindex $result 1] > + > + file delete $obj > + > + if { $output != "" || $status != 0} { > + continue > + } > + > + return $compiler > + } > + } > + > + return "" > +} > + > # Always load compatibility stuff. > load_lib future.exp > > base-commit: bcdbf606bc054bd1fa9a1c8978f2d3a57e42adf4 That looks OK to me. Thanks for writing the patch. I'll send a patch later documenting the ARM_CC_FOR_TARGET option and maybe another one for listing/installing Ubuntu packages required by the testsuite for broad coverage.