From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130071.outbound.protection.outlook.com [40.107.13.71]) by sourceware.org (Postfix) with ESMTPS id 848C93856DCA for ; Wed, 8 Jun 2022 08:19:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 848C93856DCA ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ikfRzgAtA6xsrTyXB/+bqLjVLhu44fnsEC3F8jCuwS2vT5ATQWjcCnhQ9bT+Uf8rYBZfeaVq+cMUaq1Rp5OZCULbibkJ1fcRSWbPWCol+pP4V3VgpDT9U4YhvLFYpks0jd80nzjaB/zLiluuv4lsWJmhJBbzAl3pGdMz5mnsB7en9bbXWdji1z3KMIWle2C47k99dtYuL6IRjJJMI6of+AXRFikgS2iugoziFc9VaTV7Xstm+rPkRGR8Zu161n35qcUOVtYvjJO2HR1gYI9XFOam3rclYYb8LXleiG9D9son5dnlqhZ5OU7jkg1Sjd08QyO9wluiQeKqvitvfj4Zeg== 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=L40IY2QAswjguglo6cbHb2ykNWRWf39zcCB77vNp2LQ=; b=RdCG9yrhfn5KSAap3EpGJAlriYxzM70B4vF1gmPndmX3kHdLU2+koKRUjiYdzTl3prmGcJTbgJeCsQugPAHn0zymIK6qJXQ9N3xqxU1r2n6Uuo76l4IOs7DNdgIWE4+Yila86Jd4dhv7FX7SIvsku9ahFVwtwprpoBkWlc2O89FtGUvYvXWv2gAujPgKzTvtk99csBBituY2yFZuCYSM1+S5fvxn8ibPK6yXATvw59ElZsJYtdPyCOJZBjsfnnXUgipRGsG4PInSdYnULzCFWxEX2NNW6xmKYVgPBG2/12jYpESEaf1m+fYmCjvftZq4EPXSzQX2x5WT5qpGkgtfFg== 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 AS8PR04CA0009.eurprd04.prod.outlook.com (2603:10a6:20b:310::14) by VI1PR08MB4414.eurprd08.prod.outlook.com (2603:10a6:803:f3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Wed, 8 Jun 2022 08:19:02 +0000 Received: from AM5EUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:310:cafe::ad) by AS8PR04CA0009.outlook.office365.com (2603:10a6:20b:310::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.11 via Frontend Transport; Wed, 8 Jun 2022 08:19:02 +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 AM5EUR03FT057.mail.protection.outlook.com (10.152.17.44) 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 08:19:02 +0000 Received: ("Tessian outbound ff2e13d26e0f:v120"); Wed, 08 Jun 2022 08:19:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a07a37cef7cfec3d X-CR-MTA-TID: 64aa7808 Received: from f705e017557f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 07B89550-839E-4595-9828-D2E2AA32209B.1; Wed, 08 Jun 2022 08:18:55 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f705e017557f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Jun 2022 08:18:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PDGY+sQgk2wHC4FPknvdJRLEMNgME6av5MfExoHM4JGSDFLKYPcjiP3HRdZORqiycEA0R1NBc0C7a6rWl5tYdlIiNuBWzFAqCXJXyUZiuqIzj4xMtVHDIkl4DZadZ0ka7nV8CkHbyD28ul7wHyZSwb1RTyIDK1qgi4HveBiinm9UEG/InkyXDuwjfpPe/XRw7hp1B/25vyTpQAKZ/QdzX8ZRhupj5BszTSN+uTmZzRSwn1I7wVTiBZ58wAgj8dfBY/qAEEqoERdPR75qhe+9NauXEltGcq79i4dZJLmD/4VKRFE4yd8YHMMopUV2x4B+33/kSe+uMj8NPVfJ8yTM2A== 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=L40IY2QAswjguglo6cbHb2ykNWRWf39zcCB77vNp2LQ=; b=RmiKpaujfTz3kJ7/JKrLQqhF/b1B0wwwnDQkfaUBfHOwQDvhd+dlj+EaQ8VBVoeKUhoO6LMGIRz7WcdCQTAXXp9yLBn6eJPb9YwKzS3FdYxUZ6OGGM5yNBUIJv3qq9XpphqYIudKkS1zAn4bXVtqvaBxbM+6WIS1mLYI3JP0xpwmIRC6CWm5jWkPBGuSVYVC0rKbV8XfK9GITjYPETycmKn7vbwJD6t66phiSSsqIcRHtY/OrO/55LmLWzCDL8rsY4XhZpNOIr6dMTJA1i1G+WIECiOd89xjYQ7uP5Jvw7OhomJen44L7zjZHxrTX/elo9QVo1KM+H9sbt+P7hIVqg== 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 AM6PR08MB4916.eurprd08.prod.outlook.com (2603:10a6:20b:ca::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Wed, 8 Jun 2022 08:18:52 +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 08:18:52 +0000 Message-ID: <49bdabab-414e-85c7-4fd3-bec68ac9822a@arm.com> Date: Wed, 8 Jun 2022 09:18:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: 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> From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0541.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:319::12) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8e218cb8-af95-4b63-b433-08da49278b99 X-MS-TrafficTypeDiagnostic: AM6PR08MB4916:EE_|AM5EUR03FT057:EE_|VI1PR08MB4414: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: uRVxfjk0zL1/CvS/s3Ec3lY6/46h88BvdrupyEmur8BNq8upZu/+PQwI0FOA4eU6WqfA5CX+Wbo/sisIE2ee5eGNsr+wVzp9UzuL4z5bzQzy0iu+wbiZmVOVHfaquMvZNVEIEKHmQmVW8dHjrG9BftP6yiJohI+O412vP/bSkB2ruc+VBUIFteAElEoxf47LMgiPfvAAg19529hLJpKToXTXFbLSvHIIwA1w438J16O464mo1NarprTYpV5kUiwimwvTtksmuxyAhrNwZ9mC6+lch/hd9J6ivyg31oR+9L7Jq77ceC9qdVsvz5ZNXiggmUEO6ihXBvUxpPSk/w5FMvBFDu20C5R3UkAx1dQlhYnwtk4ccWHAweKmUt88cYPsZbeSK0gSK4GEDdYb9LCwhU01GL9Lq6UN5bTJn/gqE2qEIN9SFUQqT1vrdomvqvPNudSFERLaE4kwR/+aBwhvpE/fQ3jDySuRplyc1RQAXQ7Z3VvSu5Vewlfa5v0E3y5B5DuoDZ2NNV+sMGCOQpyHfT/J169vwgmh3Re1O+V1d3op2wsiBPw7L0cuiz/H4qm7y+OIi6L83qptbGA4iBRkemH2K5BwPwYfZBiGYLEvOCaulkrrvZ/1o59kQjCPS3dR/s04+2gnWD0zYmEuEOKvvoMiPDRo6DPr/mRIIsrY/Cl4lleL52SNRGElSymnhsFp6luBbljSFkbGlzAhlpJt9SO1Ju4vd+KSweXTFm6zh3lRqihdWB6/yovBrg973pFOR1T2HV/tfn3YRvicK+Dq6y7D7JKUOothhqI3QrRKXbK33BWHjKkNTJnIOwPR4Vjz 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)(66476007)(2906002)(66946007)(8676002)(66556008)(44832011)(186003)(2616005)(5660300002)(8936002)(31696002)(6486002)(84970400001)(53546011)(6512007)(6506007)(508600001)(86362001)(26005)(31686004)(36756003)(38100700002)(316002)(110136005)(83380400001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4916 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: AM5EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b1458084-a45e-4e6b-1f2a-08da49278593 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oOOLUJySAbhnWZ0zvSIIljkQxMqNi0vz2Eyraw1FY14YB+0/HUZsCdQcqZggnuYk4gq/WIJcacW0yU7/cHmYOur/AiSv4yWk/i3h8elcePh3ZCK+vUt44xfbk/Z2yCRBkNrOzL4dVhDenYQLshQK/0zAheMaeJ3me2t11GSjq78PGyPVARriGfsDCkemJp97wWqm3BIsGyyjJZcZmxpkLB0mD6T4BkwgeNJue/WLftMvwrwTYMN6dZ2gDwB1gyszT5ssWhi0o4BR3J6RoFUDVgPvkiz/+pszuoxscKjUyYuSCZm4edqHp8iHT1WTCar2Yn8UjpGS9l1D//aRz5WPu/t7ldI63dOhBkN3eHfWisUYKCQR03QkdwpAe7VTFFR6DXXmXcqWXi1KFqT/+F56veudmwqKnLeyip/aSzhLpFVCexZJqMdacGT5ynFz9pMZj1GHMmPd/abIa0Gu1Saaa7fzcOAA/EwZvclEqWP2x1J4yzX1JC5d+EKQTAtZGRTzXX27cuzN8ssqVoyRiM7B7Tp6Wt3YMDuRKyXoSuXr4y0yWCPqpYJL0D4iFjRoW5AETxer/vBK4v8uULSTri5oX3Pp1XEV38fciGT9UJRhX+Sk7OOusqtUnqk0GVb3ORZCejkjD2GxtOjgUE91S2ZNOznmmG9m6Gipf1SNZF0cDODtWzOX8c5FtvaVDcdTN5SBpFgdOscHnWosl5R2fI3slXl39A0y7+MqbVit+eRZP5lBCLRQG2m/36cKKhyfOcz9/72YfQDM/mXCUKxa4zy+ZxBNnQ9JTvC5sEXNQgHM9LY= 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)(2906002)(8936002)(44832011)(70586007)(36756003)(70206006)(31696002)(47076005)(36860700001)(5660300002)(316002)(26005)(31686004)(6512007)(81166007)(356005)(83380400001)(110136005)(8676002)(82310400005)(336012)(6506007)(53546011)(84970400001)(2616005)(40460700003)(508600001)(6486002)(186003)(86362001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2022 08:19:02.0379 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e218cb8-af95-4b63-b433-08da49278b99 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: AM5EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4414 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 08:19:10 -0000 On 6/7/22 21:15, Pedro Alves wrote: > On 2022-06-07 19:42, Pedro Alves wrote: > >> When we use gcc for arm-linux target, its file name can be different, >> arm-linux-gnueabihf-gcc, arm-linux-gnueabi-gcc, or arm-none-linux-gnueabi-gcc, >> so I add a variable ARM_CC_FOR_TARGET, so that user can set the name >> of gcc for arm-linux target on aarch64, like: > > ... > >> 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. > > Maybe something like this? Completely untested, other than hacking it such that > the aarch64 linux path is taken on my x86-64 box, to ensure the tcl at least parses > as expected. > Thanks for the patch. I think it is fine to have some of these tests run conditionally based on the presence of an environment variable. What we're really missing is proper documentation of ARM_CC_FOR_TARGET, explaining what it does, when it should be enabled and under what conditions. I wonder if putting that on the GDB manual, under a testing section, would work. The Wiki has an entry for testing, but I find it a bit chaotic. What do you say? > I left arm-linux-gnueabihf-gcc last on the theory that binaries produced by > arm-linux-gnueabi-gcc and arm-none-linux-gnueabi-gcc would run everywhere, but > arm-linux-gnueabihf-gcc might now. I am not really sure about that, I may be > making that up. > > gdb.multi/multi-arch-exec.exp also uses ARM_CC_FOR_TARGET. If something like > this works, then we could do the same to that testcase. Even better if we > manage to factor this out to a shared procedure used by both testcases. > > From 56cdd32a54b236d35c433809fcb015f20487dc4b Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Tue, 7 Jun 2022 20:11:32 +0100 > Subject: [PATCH] aarch64: gdb.multi/multi-arch.exp: Add fallback if > ARM_CC_FOR_TARGET not set > > On Aarch64, you can set ARM_CC_FOR_TARGET to the 32-bit compiler to > use when testing gdb.multi/multi-arch.exp. If you set it, then the > testcase doesn'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. > > Change-Id: Iefe5865d5fc84b4032eaff7f4c5c61582bf75c39 > --- > gdb/testsuite/gdb.multi/multi-arch.exp | 39 ++++++++++++++++++++++---- > 1 file changed, 34 insertions(+), 5 deletions(-) > > diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp > index e5c2d9cc161..a9d442d89ad 100644 > --- a/gdb/testsuite/gdb.multi/multi-arch.exp > +++ b/gdb/testsuite/gdb.multi/multi-arch.exp > @@ -61,18 +61,47 @@ set options [list debug] > > if [istarget "aarch64*-*-*"] { > if {[info exists ARM_CC_FOR_TARGET]} { > - lappend options "compiler=${ARM_CC_FOR_TARGET}" > + set compilers [list ${ARM_CC_FOR_TARGET}] > + } elseif [istarget "*-linux*-*"] { > + # Try a few common compiler names. > + set compilers { > + arm-linux-gnueabi-gcc > + arm-none-linux-gnueabi-gcc > + arm-linux-gnueabihf-gcc > + } > } else { > + set compilers {} > + } > + > + set ok 0 > + foreach compiler $compilers { > + set arm_options $options > + lappend arm_options "compiler=$compiler" > + > + if {![is_remote host] && [which $compiler] == 0} { > + # Avoid "default_target_compile: Can't find > + # $compiler." warning issued from gdb_compile. > + continue > + } > + > + if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" ${exec2} \ > + executable $arm_options] == "" } { > + set ok 1 > + break > + } > + } > + > + if {!$ok} { > unsupported "ARM compiler is not known" > return -1 > } > } else { > lappend options "additional_flags=${march2}" > -} > > -if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \ > - $options]} { > - return -1 > + if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \ > + $options]} { > + return -1 > + } > } > > # Start inferior 1 > > base-commit: 0c8cd1de90b97f12b27b40c2922a03a68932eea1