From patchwork Fri May 3 03:02:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 794527 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2089.outbound.protection.outlook.com [40.107.236.89]) (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 2D98118B1A; Fri, 3 May 2024 03:02:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714705354; cv=fail; b=cXErEhcBqcXLKvPqOK3bRaetAFgcw9K3q9W+olEmxiSN5vAXcQ81QdBF4GOwyTJ71VK5+iSkdHD1dzVoHxIVlj3k4r8mi+C6z4aSburZKO76hl923ENC0wvMlfPreMsDm0nFj81OuHkFMrEw7Mzo5NLM3fbPNRv4UXX1R7WNkLs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714705354; c=relaxed/simple; bh=A8b+aEnZnKsHaceJ92fSVC8AA3iiS+E8E92LAo0tiK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=jZavVWRG6DgPevCtgt//xaxMB7Ke+cXb3EwA0BEHLY2KevFMAmAyq9rOiFpoTpFAeu99L6KvMmMlfR9qCDepqroQ7l33/sSe+3EZaz0Sf+EqKbKEQljSuyMdcsRA6FNHczkjIIojw3BUphsBS/BgaeE8ylNN4M29EpUeUJ8lheQ= 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=ZitUjLd9; arc=fail smtp.client-ip=40.107.236.89 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="ZitUjLd9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S1EcJcw1/6tGVOeXY2mBxXE1sQjgVcpFt5QIGGEPMegHTCl8pAf68YeaSMtg5+cYVXYFI/E+lWsQxHjHkYuJlZqXxqpWy37NU68s0k2qWZzCMpdbt7d3kC2vwbcwSA6SI3v7d6+TFKW//vAxC5pcI5XN+q2ZMmWpmviXdOxKl8PrNWh7rCuVAz1OT5Hn1YhYeCo+YGZXMg9JYO3PZ2sYthvUGfLyYvG27ws5VrPzGk1uzqprTs/vn7ZnNuUEuoSEL0LWx44CvlvF0l+6Dh//fN3Q7rW/j77Kgx/RuZFY0UUCL9v+XJ1fKYK3g/sF/ombjqACgLrlbLqmQnxQ8qWhNQ== 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=jcVxyQncfHX1ly+thnXuHYz+bhZTN2O+XYhizqACyJI=; b=ZSnXdkKGL3aySbwJuI1g2s5eJdWjodTGT4w1IUEOr74VDhFKH3n6WmJt2aZvC+o/BOxTELWDsYBlZTRIHml5si1jISIdjkGyMWCZo9KSC2gZSiEsLNAAZtw9ULNq0OL6GBROuJaTr1lYJxKgV3DMIsB0JYWk5DcXX7yw2CXC8AtMdcSNGu0+wgLEbvhmg2yelDc1Eqqqf2MMDmd2X86KbSvYDQGqAOgFEjbu9ZjXzMD2odmjtMUzCFoHKNIInoTJGvppA1/lydg7ski2KxscNayK4pqkFPL0ejYXsS+lOAoSFJu/XuJLmaXWRdGs6TadJERCNLn6HTPUXjzQ/h2E3w== 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=jcVxyQncfHX1ly+thnXuHYz+bhZTN2O+XYhizqACyJI=; b=ZitUjLd9QStkrrDJn8Z0uzKcfrnOvSePAsJa8tUJFvjIwd67fNUHi64ioZHWrzioVUZAQialcv+k8Cc0fFtE6kGNJcCzmFesTdof/to/ZckglET2sMPil6TCp4ceSfAEr2EP1pwhgIGgaBUyt4TLxYFLnsl4drmRPATv9BHjgwGHHTNHe7+kV5SQGRFf+bMYRDSNw9Z4Upkj7Gx94f+LwVb6oj0yp/2WvIs6hiVNHNJCiFSTdDK4FP1OqaoqN8+9GJ+5ot2S/yuhtRVWcDN66+aiSNHDnVojqqarNbbDBKUu5RtBNDmItN41qijlxG1zwG/2xw4C+4GdYLikWlf+1A== 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 LV8PR12MB9109.namprd12.prod.outlook.com (2603:10b6:408:18a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.28; Fri, 3 May 2024 03:02:20 +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.7519.035; Fri, 3 May 2024 03:02:20 +0000 From: John Hubbard To: Shuah Khan Cc: angquan yu , "Kirill A . Shutemov" , Ingo Molnar , Binbin Wu , Alexey Dobriyan , Rick Edgecombe , Sohil Mehta , Yu-cheng Yu , Dave Hansen , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, x86@kernel.org, John Hubbard Subject: [PATCH 5/7] selftests/x86: avoid -no-pie warnings from clang during compilation Date: Thu, 2 May 2024 20:02:12 -0700 Message-ID: <20240503030214.86681-6-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240503030214.86681-1-jhubbard@nvidia.com> References: <20240503030214.86681-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: BY3PR10CA0027.namprd10.prod.outlook.com (2603:10b6:a03:255::32) 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_|LV8PR12MB9109:EE_ X-MS-Office365-Filtering-Correlation-Id: 54edd36c-7d95-4a20-6292-08dc6b1d7291 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: oU53Df12L+VGd4N5t3vrE3IH4yVJzbK/COQiLvZnXC1i5hrVs/02okECwbnRb6IhbHuDppAlGqGA1KpV+zekQneyLQRmaorEMAbpG1b78md5z50VsFCxiJJTXZ7GllVXphwYqiHIZjtIQKMuesBZ67CfEI+YWRCFrV++c+4a4gICiTHTd92OJkAp19ZF7zGlLNtjXijTu3tPiklkDSk2CyJKPg9SdThDRlZaf+rnrJWkiXblJFtYZCdh7ghbZKwzmPVqjRgUQAELoslGrqWw5LpW6OGzFZAYDcwNqN7Df+pUA+mmLzqyefNrHLidXehIwERqDeNoNAFCOYJGUpu2lDQenWpyxE3QcaOb+zfn1m0WR9S472TWGSv0qE57WodvgVGLQ64I6bwSv5W2TxIDxkavSIHUKO1551I99TJ0YB0p9p/Ttqe8HqZ8Xfkdepx26yUjSUMe25DyGDBYo6LPsNxje2iPacq0gn3ngWn7pJP2N+xFIGds4DT9qjn8Ny7OW9Ja33gRc2173IQUdkQUvmYqbrWtVuiEKpcgSEGkbbXqqLuv+Oi2HmpfyqLRFLNh0gkG9IKk9xA84Kg220dPJ8CZD90Kv1DnaAd/Gn2CXXmNBq33dxy5QqzsY5u6+ko27pfoaceHoBpDmLqrlQIJmeZ6xxvkSA6JkZ8i2ZyS5jK9epoaI3I+3E3o5B9aXyQMUjvwT6K2E6OfUIxD4kublXXj2g7ZrhsiRugIhkB0GAAakYsrUQbQsY/xf2OkSJPWzBgMmD70iIUUXsxW9aUGGK9ITd2/Do0klBQa47PVS2OsmAuZn1DVVYFVfONZtWI+Op1dj6WWGm5kcnbVFGWjWVfk9XJrZ8nQYA6nZ65S9y4Q1uW+vusCjF5o5gzO7IZFKQej0LvRy0dgMVyvDnpF7Io6zuabujYIzIT16uNqqwQxIyhXPxyHHZNf6OMNrlrucwhhdGM4zjc5vP5rfV+82hmuA17VLJFUwIDz/aQYW3KtK2vF1qTp+BHdg1EuBQojP5aQ3xd9M/zQlvw5TZObEiXKZPNN5XsJHFJ446uSy1B9/M5eu7hE8XLllmpKU7IktJCiN78d/6xNuRut9hPeeG4E5rtgwWhzGRQDezU3irRlrgJZU8OTvmU+g6pjaZUpj5ULQYq12yhmagY8a676D6KVeaaoC4d4skVGjcaZ56fcm+uLPib8Uo28NdrDQA1kAW/Rk/2ySj0pFQHZDnFPwTxAEOEdpRMhc/FqC5kBUnTJLi1b7KlZA1qJbHtum/9rBnwG/ehR3bmJAHiGpdy8HA== 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)(7416005)(376005)(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sK/5kcuCIUUMA2lkpIwbFGZ40V2hQjXw/qslnIgZUCKuZtVLngGzHI6oay8dlU6E8D2fpFnwGBMu5gGr8ovKxIYDnc7TyDF9bvRdbltbAULVVmXYWSVT2Z4S6szXSNIwa5+T0drf4cgcL0PKg6UHZHx3S3rDzWdPu+DOB1rRJp0SdC7UOo+GmxrltxFlkvkOaxnI2azZVM/bV54iIrgirq4vaAZrFRs1H10/ZCjRg4duuzMAlDNnpbXUBF+ohey5fIBOMaSR59dTm1z1VuuEfzQiymlWZXDYoIKqKkS5DGNUcTaM0BfkjLV36cm3fEBHy50oFaF3epIQHWCXck7Gt1stQvPTPFoUyQGE4jjmJAVUhDbJIbYwofeBwcc3nRDR3CMfqImcch3RgF3xqCQ6nPTFRhL1ib3gijABsxBl8WZDfUpkvjtw6S2fWAIlVU9N+/Dv56m4HKJZC2iiZXctOcn1mUauEKBOSPbE24nohuxI9BTdN3nYGNL2VHZzPl3zro4RQ+DMDohBwLsAar7FLwdeDfQJ//EYs1A96cRLKqEyxc4VKeUn4EC1WCTlTL2rrAUUXtz/19Sz4BWPPCqTPbdBQKdLZR X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54edd36c-7d95-4a20-6292-08dc6b1d7291 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2024 03:02:20.1419 (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: nRPNV3CIrgTzexZy7mzerO7Xic41JALfevEoEcLsS1THoxocQLHgLy4uN51gDEJfVAkRcr0awIImR6HLFgmjfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9109 First of all, in order to build with clang at all, one must first apply Valentin Obst's build fix for LLVM [1]. Once that is done, then when building with clang, via: make LLVM=1 -C tools/testing/selftests ...clang warns that -no-pie is "unused during compilation". This occurs because clang only wants to see -no-pie during linking. Here, we don't have a separate linking stage, so a compiler warning is unavoidable without (wastefully) restructuring the Makefile. Avoid the warning by simply disabling that warning, for clang builds. [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index d0bb32bd5538..5c8757a25998 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -40,6 +40,13 @@ CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES) # call32_from_64 in thunks.S uses absolute addresses. ifeq ($(CAN_BUILD_WITH_NOPIE),1) CFLAGS += -no-pie + +ifneq ($(LLVM),) +# clang only wants to see -no-pie during linking. Here, we don't have a separate +# linking stage, so a compiler warning is unavoidable without (wastefully) +# restructuring the Makefile. Avoid this by simply disabling that warning. +CFLAGS += -Wno-unused-command-line-argument +endif endif define gen-target-rule-32