From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by sourceware.org (Postfix) with ESMTPS id 5B8B53857016 for ; Mon, 5 Sep 2022 18:26:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5B8B53857016 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jIgMlOuuNDGmnBuan/xXkIoMAST6K6cGVWLQjUMCXqYgmOnpO0ea/8/ur8P2bLE+TMpVvuL7q2pDqH5yRwE5ZVjrl0QhFDX6622aDo+dS2ACx9ukgt7YegDzkUoYLMEKKvpInNwbL/gfHtMj27DKL9M0yGV5lSvwzDho8EsR6nNAoAmWiIT179Zk6wx1g+C+cwXyAVfIir1KwYII/KeVLmwgIP1EaORAFVUr/ZCLtVasJbNVVqLEDV+D0yat5wPMi+oKQzXhRUykjrIivjRYbXV1pGo4Nu5+FZOaKDWvhVowYwKyCcBjn80l9mINj+Q5zXSRkYlP62Xxwagzyq8Owg== 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=iBN7VarqwkO8LHuiMeSsllLO7NX6lJ1SJzk1bdPksgc=; b=Eb1zdPWR7rhDqDY71m/wWEycuJhh9KpoV6wmTQ7l0wMh+Q2cDg+mwgLUtA53gmd0T3ARx2jM7/WGlddjWvrZ9DZhjR4plWpYWwqqkN7saaAdenKOR4hZ8ZePa+mGQkcbDifkJyfDh3QyQYLi6+NwhVm+wyuaH1sZfU3rZw5/1eQ277hPpD1stJ6XITk6EIGfzLwAijYN0jM4yfaY6ft/5SQwV4fbhHk5dqu3oSxd2BzPHKZjA+t2yUbXNIGAlDTcHN3iXcza9nasnYAwYu6TdsaS7ULwxbVV4RaVlLyHuOdbdu6Aay/5GDz+B4BikTJrC5haK5tuqvaLlknNEIt0Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from DM6PR06CA0026.namprd06.prod.outlook.com (2603:10b6:5:120::39) by DM6PR12MB4926.namprd12.prod.outlook.com (2603:10b6:5:1bb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Mon, 5 Sep 2022 18:26:33 +0000 Received: from DS1PEPF0000B077.namprd05.prod.outlook.com (2603:10b6:5:120:cafe::d8) by DM6PR06CA0026.outlook.office365.com (2603:10b6:5:120::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Mon, 5 Sep 2022 18:26:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000B077.mail.protection.outlook.com (10.167.17.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.10 via Frontend Transport; Mon, 5 Sep 2022 18:26:31 +0000 Received: from khazad-dum.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 5 Sep 2022 13:26:29 -0500 From: Lancelot SIX To: CC: , Lancelot SIX Subject: [PATCH] gdb/testsuite/lib/future.exp: follow dejagnu default_target_compile Date: Mon, 5 Sep 2022 19:26:16 +0100 Message-ID: <20220905182616.621993-1-lancelot.six@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000B077:EE_|DM6PR12MB4926:EE_ X-MS-Office365-Filtering-Correlation-Id: e3b31dc5-b6ad-4ebc-7c2d-08da8f6c2824 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Xw+dyrL3chHjtpH2T9ZFi0YfxXb+N/mGQInFitp2W7CrJIjSahPcJrPF+7XwZdWUCLfMDX1wGK91CRgYaCgSJxwl5KaLAp488T7VE6PIEq/F41ac4B/fUICDm0oIMlOP62NTAv2siIL/595GUmH5VSGEnrDE6QFBZJdpg4yTdTzvKnxHWTeY7ecwn9SqD4c5DC0EWxl5nJqkiBxFk9Bp7YNI+RB/OI/ZeD1emP7j+ah/62cNNMJoY/r2vt8zL3ORDbngJNURqxs0H0OnmJRU0bItsh0RqWojKRiklirNye1tERKjiBCSAmFsDYT6nFqnA5JE+40tdqelNJy+Ulo46Zx3csOlG1FbeWGHHSWs0r4Hxzmq3fagtU1eIRh4fCGaIk94DU/lsqcu1W6BA6UKVWMlh3YwT9B28YSo9koVFz0ydcZXDyx61PSgx+9TWcfby4asCx9D3xwDP5R05vP0rh396KWlpXXSuvKLvf2Teb8AloS4hUUAuqseoRNJAv9e6bGLBU3mO+Rd9KBXffYKvtqkbfU9F3IqKebhXrGruHkQAErNcq+xftGe7dYUss1+ao5t9BOQ/3+irFIoEtFK6LPq0MJNWG6cZ4xZhLG1Dml4nXFjlcvohMEgQlH5rEByRChEovbyTe5vVyUfF4sZY+zAxy0naaODJa/fxrYPRvkV1c86VSbA26h/YM2k76kF2bcM8yhVcDJ/B/D/GGjmG74WnxNMyIJagYVPye36cs8S/tDE6+rvGuuqbSov8UpO5jWrVu5rrDLNsJkeyoEhL6SRsZqcAfC+1l3RzUtlYRrzqpBN2lt0gOqb5ejytQv9rB5KDQAFu+ZLzbSCKmg0Q== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(376002)(39860400002)(136003)(346002)(40470700004)(46966006)(36840700001)(1076003)(26005)(6666004)(7696005)(478600001)(41300700001)(83380400001)(426003)(186003)(47076005)(966005)(5660300002)(16526019)(336012)(2616005)(8936002)(2906002)(82310400005)(6916009)(40460700003)(54906003)(40480700001)(8676002)(70206006)(70586007)(4326008)(82740400003)(86362001)(356005)(81166007)(36756003)(316002)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 18:26:31.3285 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3b31dc5-b6ad-4ebc-7c2d-08da8f6c2824 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000B077.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4926 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Mon, 05 Sep 2022 18:26:38 -0000 GDB's testsuite can override dejagnu's default_target_compile if the system provided dejagnu installation does not provide support to compile languages GDB needs. Recent version of dejagnu (1.6.3, installed on REHL-9) includes ba60272 "Establish a default C compiler by evaluating [find_gcc] if no other compiler is given."[1]. This commit removed calls such as `set_board_info compiler "[find_gcc]"` from the various baseboards and has default_target_compile call `find_gcc` itself to find a compiler if none was specified by the board description. On systems with dejagnu-1.6.3, if GDB's overrides is needed to support languages still unknown to dejagnu, we end up in the following situation: - The system board files do not set the C compiler anymore, - GDB's replacement for default_target_compile assumes that the compiler should have been set up by the board file. In this situation, no one sets the C compiler for the board and as a result many test are not compiled and not executed: [...] Running .../gdb/testsuite/gdb.base/bt-on-error-and-warning.exp ... gdb compile failed, default_target_compile: No compiler to compile with Running .../gdb/testsuite/gdb.base/dprintf-non-stop.exp ... gdb compile failed, default_target_compile: No compiler to compile with Running .../gdb/testsuite/gdb.base/structs3.exp ... gdb compile failed, default_target_compile: No compiler to compile with [...] We are observing this error with ROCgdb[2], a downstream port of GDB supporting AMD GPUs. This port needs to use GDB's override of default_target_compile to compile HIP programs since dejagnu does not provide support for this language yet. This patch changes gdb_default_target_compile_1 in a similar way default_target_compile has been updated so both implementations remain compatible. Even if this is not strictly required by GDB just yet, I believe keeping both implementations in sync desirable. Using board files provided with dejagnu <=1.6.2 is still supported: if the compiler is set by the board file, gdb_default_target_compile_1 uses it and does not need `find_gcc`. Patch tested on x86_64 REHL-9 and ubuntu-20.04 on top of GDB and ROCgdb. [1] http://git.savannah.gnu.org/gitweb/?p=dejagnu.git;a=commit;h=ba60272a5ac6f6a7012acca03f596a6ed003f044 [2] https://github.com/ROCm-Developer-Tools/ROCgdb Change-Id: Ibff52684d9cab8243a7c6748ecbd29f50c37e669 --- gdb/testsuite/lib/future.exp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp index 36dd611d61c..17736ed360a 100644 --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp @@ -403,7 +403,11 @@ proc gdb_default_target_compile_1 {source destfile type options} { } if { $compiler == "" } { - set compiler [board_info $dest compiler] + if { [board_info $dest exists compiler] } { + set compiler [board_info $dest compiler] + } elseif { $compiler_type eq "c" } { + set compiler [find_gcc] + } if { $compiler == "" } { return "default_target_compile: No compiler to compile with" } base-commit: b9593cb70533f28d276ab8d582dfe622aa4591d5 -- 2.25.1