Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp642077lqh; Fri, 31 May 2024 11:39:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6stssSW9fnW0Cex/sX0rWB8HNqThZ+iVHqxirkAkbJpo0PUZM4n9Av97HUl5e2vBFPOLGO0+ThnBnmkOWUauBJLayBzxOf6VEfhBxHg== X-Google-Smtp-Source: AGHT+IFyLOb9dAGfeAqDgoANeSOsTWfP9bGuXqCGtM0AMwEQSjMepxtgmKBwH9cpGBCGUK23DHOS X-Received: by 2002:a05:622a:20b:b0:43a:c0c7:a218 with SMTP id d75a77b69052e-43ff366ddd7mr55752211cf.33.1717180764991; Fri, 31 May 2024 11:39:24 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff23abca3si21011341cf.156.2024.05.31.11.39.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 11:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=mSaUyunL; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-197306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6F8011C25350 for ; Fri, 31 May 2024 18:38:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5D0D1E498; Fri, 31 May 2024 18:38:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="mSaUyunL" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2061.outbound.protection.outlook.com [40.107.243.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DE8E7E575; Fri, 31 May 2024 18:38:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.61 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717180684; cv=fail; b=RsrmozFgF3ZsfU4ebaiCRzneY5PeDa3eORTxQDcPoUNjez5SdkKQodsBhCRN/CTeXtipMvqPglqNMJ8NO5MBeq9IK96jrc1dsucAydNQQW0pYFHwIqGtvvKZ/Ee7B5SoPAEyy48V/1Y9G7UxTH7wJd4E25Sx74oEDvjNNEbbKMg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717180684; c=relaxed/simple; bh=HGxPKZc0Tg+zgTnJhV7dcR0VKSblOSlvzfJl3dU1ggA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=tsX1NTu+mhsA/OvMpQZXm+aOVc+GRQ0BMIGOilLlMIFmHfCyU2iQozW6NUUHnYElY5x1YFD/c6SHejIFn3lOKhQb08bYW7AYIz7KNWvZI38j0uTxu1Sw0Y2S6KaK29gFnZRyQ+/Yvag5cRkCC+ZsmjgLa1X6uXaEvV3lqMYYpsU= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=mSaUyunL; arc=fail smtp.client-ip=40.107.243.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S4cagilTpL2tEEPAX/dwyTVlPprM1AgjsxD2PgE56DER7hs8xXBJZ9GzYRAVuyhbHMBjULlWH2eZnYs2t2DTIjEFcCznirDULu0DTlJ92rtz9wMa1G3GpWNknboa5o7NmqvR9NqPZEUhEKgbmUMS/di/1Olp+PFjEJIJWShUTXh7oLXOa0IU1783b7tVSgV9/SUDq0HtcRUfAyHVamCF4SZ+mb1Gt+gvKYoTpgkMTY6I/CQ4uycon001zwPCu5PG/PkRpzJyWl2OrfXtjOJPOxVKmAiMk7ROyymlS6mTEPM/JXmFf4Ziou0VS+5n5PWxhZ1g4lm/DkBl3s/KJOolCQ== 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=hiWQBaMWsgsNBBNOIIZ5jD0bN4oDf9RwnmnYQf0e6Uo=; b=Z8YNyYV25bVmX2M9RGSNyZFM3OyvJjuui+AnP+zQ/cOTxkdQVZCSfR9+kY90fdEbSO3PzkHjZ9rOO6KfY83k0Ydc12zJ4cs+D65E4d9Ctwh8R/YHGKvaVs30yxCoX1iJSVDaG5yEqKHdlI5HoqxdZZEI4paOkS+1ccspM8ub0R47bml0bL8OWOHGzwkOb4F5YL9k8ox4j3/xxvMUB0omkrid09cipLlnWTvuJz/pTaPCaFo0OWfEYJnMg6NuAZg1y2g+mw2GyShw0InNfe+1/5Q/D9sO8snsY0zN4Gv/zXVQBZlqHxdGEXS9IUaZMtERu54ZXV+47EdIArTegn7KTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hiWQBaMWsgsNBBNOIIZ5jD0bN4oDf9RwnmnYQf0e6Uo=; b=mSaUyunLHlqt/MBtybPPRrEsOdQT6RhmqSZhmP+FK5sC0qD9KVJVJ55PcJA/LqP9iGuRUdQ26BHAGc9WC2oWh9wY3yBMAdgib8nuWqnojvA7tUh+OTKYwoAsRq/Fwzx6DhNrG2OUsgaHvK7uDRfN4YUtBlhz14TzF/ILx6C+M2C5bk0O9DLs19o+JGtCpuesulQrL3Gaf1Z0heKKIuUD0Hqxjydnt+bQAD3PeZLCh/i8QhxK7JlXbIx6h+dEYJ7QvoG0uGxIWcpUK7iljtaiEGPnOGm8J3Z4raoPeCHZ9g2WspAXCGHBilhdKpkO6EUb+VxJ6Ws4AJn+/QShdxoj2w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by MN2PR12MB4207.namprd12.prod.outlook.com (2603:10b6:208:1d9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.24; Fri, 31 May 2024 18:37:56 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%4]) with mapi id 15.20.7633.021; Fri, 31 May 2024 18:37:56 +0000 From: John Hubbard To: Shuah Khan , Muhammad Usama Anjum Cc: Beau Belgrave , Steven Rostedt , Mark Brown , Naresh Kamboju , Nick Desaulniers , Justin Stitt , Bill Wendling , sunliming , Masami Hiramatsu , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, John Hubbard , Nathan Chancellor , Ryan Roberts Subject: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds Date: Fri, 31 May 2024 11:37:50 -0700 Message-ID: <20240531183751.100541-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531183751.100541-1-jhubbard@nvidia.com> References: <20240531183751.100541-1-jhubbard@nvidia.com> X-NVConfidentiality: public Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BY5PR17CA0014.namprd17.prod.outlook.com (2603:10b6:a03:1b8::27) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|MN2PR12MB4207:EE_ X-MS-Office365-Filtering-Correlation-Id: e3169be9-0ed1-4685-49f0-08dc81a0c9e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|7416005|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?QxeqJuwKzaDISDJtHml3Uro16Y499sW3cyfCpqeWp+ZsCxl3Y2nY0rYqX6rL?= =?us-ascii?Q?YeU4EjlNYB8ONX9myqesmmImRZHLeZpW0G9TDG9H2JyuGfNGKTKVXLeVA0sJ?= =?us-ascii?Q?vCmePTgOJoKSn/BPQDgmmtjoyrbsndhIEpA+jI/D7qDdfrn7qd5NorSpi715?= =?us-ascii?Q?q1hJHNciYI8bVVah5L5R3BkekVjRVUJ1H1Ts3i/gf/xsYFaV/NiU4lFOTc9f?=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XCIOmDS4CIkPaRihq?= =?us-ascii?Q?6igWrNXNW5aWuyHeFkANnFxg3vftTgbTxU2AGp5PtIs5HYe5Osto1RBTF7kl?= =?us-ascii?Q?E224L0cuUzjTG0iOUm5OvhHJSwszSK2uw1FBNN5ARj6iuZVW363J54mihBuu?= =?us-ascii?Q?6GTYtVX5s8hoo/hLinKwwheAJkD9ipVxXiCKHbhSnA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(7416005)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BD6ZdViKna9Jqhu1ZXvFu29rLpWONyG+kAza/r9eGssqvJlCcZzepH+YCnHM?= =?us-ascii?Q?/M2TrFIyi0Ycdm7Uvd3hYiyuXkLt7xKZh1CObi8jEECaX2i+y6/Z7RxxrJjo?= =?us-ascii?Q?k/Y5j0Zr2CF7rHQqgb6ehGgybj75Ik5nqhgXQ6m042XdmyAn6hJ7mcKOuiGo?= =?us-ascii?Q?xJVanB5G9PJX61lhR4b9PI8gAkQpCc0PlII9fPsDo0dZCHSA4ID1036WBieW?= =?us-ascii?Q?iXzcRh82uxLhLKcXfaJLWHahLWfIehOkJYN+PrtgKkpEfDYJq0/16b1KW0C4?= =?us-ascii?Q?GlMGgaoPUEP2ZlrEib3a5lkrm8Kqgx5j1zHLe4Pw+xwObFHBoExtoqIUJnEv?= =?us-ascii?Q?NaaP+Tph4wAeEMbcGyMzhUz5u5hR15rWNTB7khjYHQb3fzxBR3wAQ/pgNGww?= =?us-ascii?Q?Sah0BBKvHzspYXs52tCAo9hsStJMgea7wRhtW/wQYJFwiv0ByonfzLE1MdUc?= =?us-ascii?Q?xrStLa8kcqATkq+evMhmud7NhNIKCfc0o6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58B3CYMzVZP0evtMz8EgA/AwqmTCVRtuJ/QesloLxN?= =?us-ascii?Q?DIQNevjW8/Le3bE5MUikBAE74FJ1SB8Gek4uM/CUNZCu/+SSTgO/P4hLYqPo?= =?us-ascii?Q?GX/zxbUtDvwdGNHkvcKm/YBNjyM0Vx4TvWWx60GuiF8UhxAE0TAi+d8y0hZg?= =?us-ascii?Q?hOnpg6AOGo4PJu+N1qt1d4PBr+XHO/qq5KAy7pZ2?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3169be9-0ed1-4685-49f0-08dc81a0c9e4 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 18:37:56.2458 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QzxwAmJy6V8tu+GaZU/DLg5LdfIimLwr1nsNhB4ei307SZxD0puQ8ZHDqjtZ/NsmrKCAghlcbrX0TD1alw8etQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4207 The kselftests may be built in a couple different ways: make LLVM=1 make CC=clang In order to handle both cases, set LLVM=1 if CC=clang. That way,the rest of lib.mk, and any Makefiles that include lib.mk, can base decisions solely on whether or not LLVM is set. Cc: Nathan Chancellor Cc: Ryan Roberts Reviewed-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/lib.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 429535816dbd..2902787b89b2 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -1,5 +1,17 @@ # This mimics the top-level Makefile. We do it explicitly here so that this # Makefile can operate with or without the kbuild infrastructure. + +# The kselftests may be built in a couple different ways: +# make LLVM=1 +# make CC=clang +# +# In order to handle both cases, set LLVM=1 if CC=clang. That way,the rest of +# lib.mk, and any Makefiles that include lib.mk, can base decisions solely on +# whether or not LLVM is set. +ifeq ($(CC),clang) + LLVM := 1 +endif + ifneq ($(LLVM),) ifneq ($(filter %/,$(LLVM)),) LLVM_PREFIX := $(LLVM) -- 2.45.1