From patchwork Fri May 31 18:37:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 800733 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="mSaUyunL" 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 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-kselftest@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: QxeqJuwKzaDISDJtHml3Uro16Y499sW3cyfCpqeWp+ZsCxl3Y2nY0rYqX6rLYeU4EjlNYB8ONX9myqesmmImRZHLeZpW0G9TDG9H2JyuGfNGKTKVXLeVA0sJvCmePTgOJoKSn/BPQDgmmtjoyrbsndhIEpA+jI/D7qDdfrn7qd5NorSpi715q1hJHNciYI8bVVah5L5R3BkekVjRVUJ1H1Ts3i/gf/xsYFaV/NiU4lFOTc9fst/sbtPH+CJN0vW56wcv3LmfDoXvwkOF+BvUw+IGgNmVok5BLcyqkpeEArIvh1NvS85Ga0+oEqVFjzw+Jqc/I0+ub01Q1EsXZB6e5o/jQxsOBbM/UeMCc1bzTVpvZZV2PWGrTh+4h75jeqMSDczBVITOPQyahKY4nkLIpR6UJdNkvBAdg2iFZFOBSHGQZtbglMj1qILpxW4sJBIXqGGDxSp8hapy6Bt/ET0hz44zdCz/dyZdoyF8ie/EC/flwjLcCk65E1505FA2kp+vG2HhPLGNmpdgE2GfHX4awadbQ5nDGyOnar2X54LLm0ddsMXvqSXhfo/zXDM9WfWNEMFYO25fI4Tud916M/4r1NU5uMlmnONunKpga+7Z3X7ZKOWSLwael8KhOzh1/diPgjkc2VZ45RrZ/qpM3azbNXJOYI8qGuOZp/gT6GB0J6B5sHd0mWc1ImmfPVy+kQp+ZOQFPGRYXDfY59rWxDJ6253pS3frfGoPDb2mZXB1m7ckYNy+rvZdIM+9MH0RLOE9TTZTEwE8ssaDnp9xH14J4NH386HMWVVPQGx0oadzoJF21OZD1xL5I94T8kaxpcknXf8n31s+R7htCQDj4Jph3DEXiwcIRr7lsnIcIsVnBlkS3JcxUrh8oUw1IijxOXgXJj1OVY5w94qc1yYcF/Q5MntaSA5NiO5tjgtptnzeDXKR45eKGI8FYFX1IHgeKnXSmh52/jAsr7ndhoustRNjUvhWeKlwurDpg38Tv5diukJkz+sfIAaumUKcmmzCgWhm3IzLQVEB5fQEKOeH0bGniLTUwwfWAzpWtrHEbqg35QGb8G4GFqo+kHU5fVBtjLP/vvJYKdegOMSspwWFbkqcaScQ+dbytivWxUAXCIOmDS4CIkPaRihq6igWrNXNW5aWuyHeFkANnFxg3vftTgbTxU2AGp5PtIs5HYe5Osto1RBTF7klE224L0cuUzjTG0iOUm5OvhHJSwszSK2uw1FBNN5ARj6iuZVW363J54mihBuu6GTYtVX5s8hoo/hLinKwwheAJkD9ipVxXiCKHbhSnA== 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: BD6ZdViKna9Jqhu1ZXvFu29rLpWONyG+kAza/r9eGssqvJlCcZzepH+YCnHM/M2TrFIyi0Ycdm7Uvd3hYiyuXkLt7xKZh1CObi8jEECaX2i+y6/Z7RxxrJjok/Y5j0Zr2CF7rHQqgb6ehGgybj75Ik5nqhgXQ6m042XdmyAn6hJ7mcKOuiGoxJVanB5G9PJX61lhR4b9PI8gAkQpCc0PlII9fPsDo0dZCHSA4ID1036WBieWiXzcRh82uxLhLKcXfaJLWHahLWfIehOkJYN+PrtgKkpEfDYJq0/16b1KW0C4GlMGgaoPUEP2ZlrEib3a5lkrm8Kqgx5j1zHLe4Pw+xwObFHBoExtoqIUJnEvNaaP+Tph4wAeEMbcGyMzhUz5u5hR15rWNTB7khjYHQb3fzxBR3wAQ/pgNGwwSah0BBKvHzspYXs52tCAo9hsStJMgea7wRhtW/wQYJFwiv0ByonfzLE1MdUcxrStLa8kcqATkq+evMhmud7NhNIKCfc0o6fQI9XiCwysXjJWAUyhipnePDpszcRlzzJ874JEDObySq2WkPQdxde96jEHQe3E2IEI5apSUr9I4AjLttaNCuIeOdpEzygn/N1kpCxXTVryesOD+Uv7fkCAmlstKdOQ4ptxwcpr4CCngaaC4A1gmJg+LQbjGTfQ2qjs0dD0f8tH93w52f3WiKP5oVHyFDP1/c1am73e5d23WtltiqpsmBnQf9PERqNtteCS2u9k+splXjLTYzAXbSmxSPJ6r9ndZtl9N7ec8Z/qTEv97jG+xo1nvZILQWdQyXphDoU2+/efml//o9/zEDoixlXax4mPT7mY2h546kVW4YvQe1wycCSbDr2qYJteGwh/RqwZasPFE6DSShBWbXviZT5C79kHt3YHo7Z55kzg05uHypH5QIkqkW9h7p1YMWGMpXrgBMMWk/me5Uj0x1rzgRWYYSLMgSe7JSuPc9xJi3gPgJzOzaktom7c0GVTWbrcRN17zRKz2k0SqCda7Hz+cmvw5QktV6g/aYDCcu3ln+nH7Txd8mkyhRw8fPzhMD8f1KtfmMb8PTRnrVrU71psSlEA8yrltBUNvWOBitkNALLSoqJ7OPFAQERst9RhHRLRBpGWn1HOy4h7jEtCaf6aEggYbaFhl7fUoXUYGFKxQBhr0fqc3K4/C+N8TMgyp0dRaxroIRbqr5bGiuNrfGozLlhQ6BxgBWWmNSvTx+IYBhIlO0reLqQxChepSqKJw2+NdweYFprkUiaS9Zee6e0B/rvRtyU+eipT/qg39PSqoZBDtlIoiuv5fK0YuJf8PZDRR0hQsYV3tR+xwqm11OHP5Y+LSf3itfq5y/A8w2U2pnXWE+hlx3QKxI0oZBTx0k3Z1wpFTf43U9aZSLl5wr58B3CYMzVZP0evtMz8EgA/AwqmTCVRtuJ/QesloLxNDIQNevjW8/Le3bE5MUikBAE74FJ1SB8Gek4uM/CUNZCu/+SSTgO/P4hLYqPoGX/zxbUtDvwdGNHkvcKm/YBNjyM0Vx4TvWWx60GuiF8UhxAE0TAi+d8y0hZghOnpg6AOGo4PJu+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) From patchwork Fri May 31 18:37:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 801017 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 D11EB17C23B; Fri, 31 May 2024 18:38:04 +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=1717180686; cv=fail; b=TOG7uFOQBuaFbcHhQkBpwj07LJIg2/EYoue+iajiC3FtenxngSzEwebqaVqe/E4R/g0xzLwYfPIPvSe8ndJQbY0VAu11Kvwc1MOKaasGhmYn3JREQvhoYw2f8yqJmfHvqrRjLmaCBZnUUWUVH8o99bEKLOBbXphlL3I/uqt+kDU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717180686; c=relaxed/simple; bh=DIhwsKVgYBpxueJvHkM+NRBBDTBGnoZiOvZeZ54nxaE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=djqmRyKP7dsp4eeYoHRs29SKXiCgXfi2/HzYiQYJfLh0VIY4PtephuQFDpeq37cIpKm4EsH7lyqo1yIk10a0WEtg9MaXULKN0f91z0uo+G2NVqZBE0mg615lYs4Oa8ec566ABJdEddzH0xOaSWONbp3uYNDcSqA62TcTTdOQ5Ug= 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=Ze6fU8bx; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Ze6fU8bx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NQp6FIT8wRwv7WOWkRuX/3UdCsQQ1+L678mPkPa+6e59m5jD8PW7rsN66TC9or6ZoKZutrxY7oTeX40cDQS99j1Mo5GDfZXz+KmeoHS3xsgEeGHLlNr727g6n0D2N1Tpm1tIrt/HQOhQsZHr3QysrAc/vp+nDq8MPTeqRSciA3aVTDvVkYJeGWXLCyGLye2PGm9uaRP5OCRfPF0bR/6J8CMA1vGa0r0WBrmLE4i6uEC9IN18d48ZspPX6+qGqdbWrIQxiF/1JWp4mmEFVbw4pCkTbTCKkfhOeLDPbCzGhGLTXXCIkyj1JRnUAajX9+d1MFIsVXz8YKWOpJWV0He5Yg== 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=8zq87mtnFUsXcFEG/fBM5MQrx+9iKtQ9bsuRba9PzrI=; b=KypHE6CJrC8MfIdjQTQFsNS0keYqQUg9TQWf/bEwPaa6v+J/DcCB+9f6m2cEYLkMucW5wa/Q3rseHeZB+KQIOcTH5UIgZsfsBDBswHN3ATAsDTkuPf3WHrjqaVNU2L+WGFCQyhOW+QRJ1BrSrC2RcgU3yMTTd6PsNuh4CeDsMOsk2qAZh9p8MtvfIIkDIBtEPw46B2/jB618dnypbEgCOh6y/Ehh4a2kvokd/Qpw8BZb8k9cGJR7978Ki8ejQXS7lX4s/0mGkA/EnLm8m8TFab+yOp7vaPEDTi3JQFOiC4kZpJqB35T/pLAP0ha3FU4CIre+DpuZJmvzg4cTk/Id0w== 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=8zq87mtnFUsXcFEG/fBM5MQrx+9iKtQ9bsuRba9PzrI=; b=Ze6fU8bxQhhQyd43zsmFVjp/kErPxNWg1TaacNFGtp25MBCVS8GnsyZi8A9WOjQgOIrdxLKigEWyXWAiGKmwzXArVs6FWBrUF84cbwAD/qH7dSk9Cf9f2/0t2Gn9UuF0y4XXgQ1UK9VXoctPapmYoip1tLwjnSZ4z+7dLIbHEF39UsknE7vJWKXoH6Schy8N3nzJzhZJ9T3YJMmLjED1xx6ocmS0NlXS2uCDvunVEIk0KeszoziOJvG+rccYSgS7NPJgpd/C3sVHsV93mEt7i4ZZdlhScInYs9MiZHsqHOSFBnUKi2puiRxoD76puuIP10p48NS2jkhVOkxV/3zBpA== 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:57 +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:57 +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 Subject: [PATCH v2 2/2] selftests/lib.mk: silence some clang warnings that gcc already ignores Date: Fri, 31 May 2024 11:37:51 -0700 Message-ID: <20240531183751.100541-3-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 X-ClientProxiedBy: BYAPR05CA0008.namprd05.prod.outlook.com (2603:10b6:a03:c0::21) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@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: 2cd71373-ff43-4076-b722-08dc81a0ca87 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: 3pRhIEG1CYfUUSAe8lHwAymgdIzUZYIpL0X91tFZ02USPoF7qKtf1WcXf4T2/x+y4juqMV6rdP7vgcXYP2BJFkyjZZq/23NvMViB14KhNPnmqbsasL/yBwTJFI19fb0O9EzNvTtBt8sZ558qlZ0cA20Uj4YP4hdVeNuxQQ5ZGko89/oM40/JhJNpZCcQuaVanysJ7LvjDXoiAChbASrJUUhXTMOpdWGWwuqyhXpT0LDTYl2odj05bqa087oI+JHzjqsca4XsGZm2K6rxKYwhjepWtO3p69RbWGmQWgjzuUA6Xrqf3nuWvH2vFKQPLpVhzinV/qctgEcbbFJ639EuaB+hSdZqyQvm0YLJO/WaeFoB5oPvBhCS3SUNEwPkx0IHncswaj+v+hLjQrE/ai+AFtgNIoV5tLNF2ODJM/7dBiDpUEMsdjAsVce6NcuEMwljbRN9By/ia0fbCFfqLwapb0APQThzLQDGsmCFgXjRM/yhrIl6itSn8W6odoKX9GQ34uavhLueg/sLT59BDHrYg/e6D+C7w3Gl8MVOXsEQmIDAxISI8VkMSwWzQ8J52qwksYmawrMuM/+IYIn1p/1F7Wxxj5+EDo6O2mcdtOn/3mDVZi7RajrOd3m8loJoPkG0Nbmzpcj16w0LvQoEStzu2elDwLj7CHJsrlbxRbKbCLe3DcslBpxO8LoB81IcuJ/qFTZBXeNOtRHybg8cGt4SIMSBccPsueIuJ0XiTuPKvOCndZeqwxTYCqh5haRIsti/GiEL3X0Vz26bNSNb9OV0cRw06C+Jz3v0v7qpi4BBw1gmbIOe/iSjj6ggGdbR8oBBRGIgA8QWBVrCHLeRRo17IhjMOw5NPuHepBiTXwigm+D+/p6AnGnmh2tvyHXG8r2cziXGcIWmdrhjHGi/+otTSFaq2+SnoVlU5hGHTcCcxoIQ7EBYB24/kLkGy0l2IPXJdVDT7JbTY1lIwB+Ae2aYXeFJzNFuieLSmzJreAYcbQrnEzVAfD4Ks9lUJMAF7mw/5iVFapJ7NQ3hh0MJvykQpSZYFiVQif6GEA05lohC9+wy9VSmhPBMThpk2jTk8xuVR9ODTabSwZUj+wp1vMw8lDfOPFcLGdJn5v3nb6Oilpzla/7uZxNXDHJH0RdLfUVSLZOjCW8fMQ7nX+XwifVR5z9u870JwRGcRhiJzQNM4PNqA+/NJCHfhVYH2Y6fLYneZYlAFHKpmyMeBXhSywYysrys4EwrPALSotXbWXbDfTqNhysUb2lppJCmGypsgGyN2ukVLo1VOtb9dJuJxxlqVw== 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: ojMyj70feVHdbB1/O4J/zwJyQStcR4otvioygq+UvgbYrxWz1RN69kz1pHvi6QSodPLBH3kvGlE2IDA5sOWoULImEPsFzqJ0ZxF9crffvQ7gjwffgweVHvcE1A09TmWGdWH/W+m+Hc6h5pzbX3FW41ZO0yQ3ugcRfrEPewod86a45aEIq5mtEPDbtDjbndoH7LkplrVWw2GvymM+SnkpSeFF0vRB5cJEeNvuul2PpAdwBQyHVRY3DBQQObMSwMfvfkVFp4x+X8yO5o4VW4S0WAkGoIySijJsyNlOlJnWrlCslJ/zG2iz1+jTAKFSBucu8AeqItpqVN77crNsPGSLuKu5xmlImicchDMVCgpX0lFb6cLhp6A0QPIDsmfPM+eSIrdMa4qerEjVSF8Z5ehgQLOnaxrkRMmq3Mtj3Mx71EjOb91zBmNjqNOxw/46ah4vZcgwMoyhH45aTfXS8yszwNDyLpv9yscW1n4ZrdDwwVFW5ZqPBaN7NCpPG88cfGGhHU8tOEJSZg71mRsvMUDDlsf1St6dW4z4MIlEup9StADhmoy3l9YRCE3/zsOG56GkavOW17goR2Mi9R7ugnh8ATiu54eNe8D8+gshZXLVa6JfWvUbqG2vcyanKyptjqO97qmu4bYNRaxpo+IweNj7kMUyAJeopdlz3NuASFYVJxdTvUip3Zi66V1yxNDHRadSpzuyvLAFHj4GQzgveOkUiovHGYV8ulQ5T/oVWk9indj+U8spdpr8bEKQKPnRS+ewZ3dNW2m8G5HL01gVhxEvPFxEpuOBqenljemlLuA+h3N0GBfQhcTKdNX69laZdp6nKWFjocZjPpRJM0u9J5Dx8jSfhcxdKnJzpUFMTfHqi8LrIiC2V6Uob/2nlvTWlvy8ng3vCJFw72A7VEbzOP7VVeUNd2786BnHltVDTxnOgjhIiBx2eKGaljbG34nbegMPjWGzs8BEerUk9Gfk1XcXEBAmfXLXEldrzqmDV9Gl0J3EOYe+8pC/qC48ppzqOMA+8PJ2S6O/hkP6YTbSA3RsMjsYx4YyUAr2BwJ4IYfEh3sBBLKe2+7J4d/Qb63FrYMI9W/BZyPvpK1Agah7hoG+faeHwjAOBw5/BSr2jj+GwZ7zz3iX8zetNt8lWvTwyJOtmv6OkesBLdwlQsWDFmKExxYwmLTpHVzwjM6v/Lw/xeU1Mzu2sfFqtAZcEXSDwW1ZWa/72lh7YAZm1Lt/HeTyuf4ZnlOomcmhzvqdf4wQlAD1lEwv0k8FVLkEYGmMf3pC3yVH5Mjkv9MxBmWxX8XHeOfTiLwZiUhhdhNvs+1nFg+TXHhiUdrWKBGCrPxwg3OIjI9Ekz03Wv9K1IvXNx3O2u2UOb0YMNR0wz8f2gZ/WgwFFUoEylC+2BMIS6gtdm67mQK3XRY4m2W/dw1sPpVucZLYztvJczSPLrzBMc5Ob2hv8+AFb5C8YY/MidrVPNQx06QYpl40T49ydELoFdZ4EM+Di9yrhf1/4uw9e1uQ/u3St2dHmQ3EcRZ5Mxh1POgdwF7Utk27KJi7pKToH4QH6+aAtRY/CtCiG3s27Pq3Y/vqCUp+jSt/TAKGyrMCtv2D X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cd71373-ff43-4076-b722-08dc81a0ca87 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:57.3203 (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: t7t0BUYoRnOnJOz86VuT07Zc6YwRWpgUNzEoW3ta9h3xJmdcGIAOPXECGkeH42sD7YJSCNBcL1TN+jQQY+PTEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4207 gcc defaults to silence (off) for the following warnings, but clang defaults to the opposite. The warnings are not useful for the kernel itself, which is why they have remained disabled in gcc for the main kernel build. And it is only due to including kernel data structures in the selftests, that we get the warnings from clang. -Waddress-of-packed-member -Wgnu-variable-sized-type-not-at-end In other words, the warnings are not unique to the selftests: there is nothing that the selftests' code does that triggers these warnings, other than the act of including the kernel's data structures. Therefore, silence them for the clang builds as well. This eliminates warnings for the net/ and user_events/ kselftest subsystems, in these files: ./net/af_unix/scm_rights.c ./net/timestamping.c ./net/ipsec.c ./user_events/perf_test.c Cc: Nathan Chancellor Signed-off-by: John Hubbard Acked-by: Nathan Chancellor --- tools/testing/selftests/lib.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 2902787b89b2..c179c02281e9 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -50,6 +50,14 @@ else CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) endif # CROSS_COMPILE +# gcc defaults to silence (off) for the following warnings, but clang defaults +# to the opposite. The warnings are not useful for the kernel itself, which is +# why they have remained disabled in gcc for the main kernel build. And it is +# only due to including kernel data structures in the selftests, that we get the +# warnings from clang. Therefore, disable the warnings for clang builds. +CFLAGS += -Wno-address-of-packed-member +CFLAGS += -Wno-gnu-variable-sized-type-not-at-end + CC := $(CLANG) $(CLANG_FLAGS) -fintegrated-as else CC := $(CROSS_COMPILE)gcc