From patchwork Fri Jul 5 19:57:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13725499 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) (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 BAE8D16F0DB; Fri, 5 Jul 2024 19:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720209477; cv=fail; b=m+2LRsa6eCsTMn6tHa2T7CrUIo/dygXwPX8eO+ItMqA7VoINncLuxb7Iz0H3ukGvu/gveczjoGlSGGVP/FX3O4E6lH0pBEPClR5nl9cka5zY5oOwV+lAKQbmZEzfHBb9D7NNcuEd5sq8ZQSddSk7pwh2ZQqTLE64zf5Hx95bM+w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720209477; c=relaxed/simple; bh=l4Qayl59V/s7Q9mn9YD+B18jKgdDP2BoP9T4RlmbXco=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=An+syd97CJUKBZFNAwBeSgN9nYkZ1A3oft7JOOcFj96NZJEV4WosMuInXqzvd+xXuCm6+aoLKC2tvYO+ia4Y3/RNh5smhyYJzq9G236SFa+X/VvtYqzXB4PzYkfnS6lFuDWC5zd55h6ZTnQY8LV52PRlLO9k9iR+Dmi39rociXA= 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=Rl3trHOW; arc=fail smtp.client-ip=40.107.237.85 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="Rl3trHOW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VG7B24GkWhDdk+KjSwC9wiHD5KUr3aX4vt0a4i03bIdLeIuHJfaYvyj23HYEK42dPNHpF1IARN1JhRSLeoL0NfWSUw6zvdrxvw2B1XCpjDiDqOiEGRvZDaMH27tTX3Kkh0GHl7c/4/HntWFVGT6ImRfPAhU8GjNCDUYXBSYRVLFtiQFpPCkdNRiGhSedUaFqxHKt1wMrOrtF6yAsV8S4m3ORJ7T3L7HUEwUXFHsWxzDEw+RGypIh+/BxlwIDDqk5HiCSKU5OcXZWUS8XTi86MJ6vLfxag6VzK0Zud9O83TBhiRXKq3a5Igks2vEX6MfQtDFf40W/hKCZIbEYCm6EIg== 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=7oGgTKmR12kMPn7/W03CqVjSGfJLsOUVM96PrbZRhQU=; b=OuOlknib12wUcNbOb9cZCmouEerN9jI2enP4zfgWl1y7jWuY4PmkfZK/DACKZ1zReBFZWRZayJzGxIQ3eAwLtWkghh3WJR6lUyjO7cIjFgbZpOxl2L9Qcwf6nvxF3FF7UO2Sk5T28myCUexSDpCvsWJYoGXK4NyMatqsyC9loEM5EUMg4hlIQQwYtOWE8OPHPptfyy307g2ZubdE9PWa95YWDsmNO7c2bQh6037RKhxeimiiapSQjOBE+bGtKwAcsZOauDgzdQFtXwi/lnWH+mvzlXPmdifn3Z2KxMeNcyKtSTCCzBwpKwT2bfVTa+NeCtZPmR5AgUI/svly0Q2ZQQ== 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=7oGgTKmR12kMPn7/W03CqVjSGfJLsOUVM96PrbZRhQU=; b=Rl3trHOWEiahMo3OJT8cpLgVjtzardaKwMldPSK8nV87z4PTX8iOTK3Kj3JkrcXslwIBnPGW/q0YUNdBMHQG9LQKzWiNzm/rHRWFbrEW6FbscsVSijrRdJwCC0ugaBD2//c8lQvKUHxBi0YBQGBCLJ2GNK99ZWNfgAQBFtl3IwaNbgT8vVpi+L1lNR2xDDuwxh2/vKgdWXUm4+2OzGZ5BIEt0a5bDhmhCY7AR1w5Ns8UITHfsU6Jfv29bWMCcXeUQ4MGCdK791U+744GfUdhsejmO5OFe9d5zkML1BdpTvAsSUR1GvzGm4zPBG9veWuASU7q+To9oa/mrks6bRltWg== 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 SJ0PR12MB6877.namprd12.prod.outlook.com (2603:10b6:a03:47f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.23; Fri, 5 Jul 2024 19:57:52 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%6]) with mapi id 15.20.7741.017; Fri, 5 Jul 2024 19:57:52 +0000 From: John Hubbard To: Shuah Khan Cc: "Jason A . Donenfeld" , Andy Lutomirski , Mark Brown , Vincenzo Frascino , Colin Ian King , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, John Hubbard Subject: [PATCH v5 3/3] selftests/vDSO: remove duplicate compiler invocations from Makefile Date: Fri, 5 Jul 2024 09:57:36 -1000 Message-Id: <20240705195736.34039-4-jhubbard@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240705195736.34039-1-jhubbard@nvidia.com> References: <20240705195736.34039-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0P220CA0008.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::17) 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_|SJ0PR12MB6877:EE_ X-MS-Office365-Filtering-Correlation-Id: fea32154-2c6f-4202-9934-08dc9d2cc12d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|7416014|366016; X-Microsoft-Antispam-Message-Info: zOSU+B0M+6I4fIcSmp+UyzZJuYoDrGCi18r/1AcdkxfAleuKUJKoG+Kxoa5rpNOgwgCyeH12XlnoeOm8LBRYZTV/Eo4wimsNKCDyl+HNOpFuGRK7EEepbWXGhUwF2tuPWFz6nX3nJ+Ar/GYUTsGJUammpMi1Gs22a+2kuMBwXOKVSaDwe7cPc1loWd9xvwd1C2za778OrALJImB7tushiulISML1VrVCMsNXe/KM8unL66Y1mcbOcdqNC9uGEfb3cIVm/gZbARVVWz6PbUfCe9PrMMSAf7q9Iq3HzxcozZTyL21aJ2Ie5DUskOVMiGKlDp2LL7pk8kDkutkXd6giW50JLt3mu1RsYgKoxZO1bH3QFqho1KYkufZfqwECtKlVFND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CAT:NONE;SFS:(13230040)(376014)(1800799024)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ygTaqa7SRl0GQQnafTdPKyFB7MTxcjBO0htGZF/NMPcP9HKSTiMXt3M+rNnEbQ5nuP0BVbYWBGiVQjwTyL1AS7+TuHkpUp99UdBoMNKE8EVRLzrXmyuCS2sUKf5PoEmpACF83W0uxpdp4es72DfTm81KR7wq+O0iTsNO4SoFUR6ulHyaPhgsv4aWTH7joki/X1c5/uf0cypxNkpIzhOhZznC+82x32WrzV0PT8oB7EjkkQo7+CbooSdE8yt2YhaPGcTR694vmrDjJyy9nJQjuhSrKppyz/hQzdXJVM4jDhLh0j0FaK2366rG5Am270f4lWIVj8oFULK19oRHE2Wnw+0r+vBS6P8uWFdEWMpI+h08gH5yl3PgG/PGkbzCPG+d6iQyWmLs8EMeUsHkIM+2iuPQ/lKSK0uYRyNFA7VFhYyWo1+6hyWgj3jD80Fs4BWCtY0GS0XH3KDeCZqOMIwZXQR9nrzs+YiYth6neIT94X9KJTCp2QOiztLCpkoVpiYb9pb5fcy+LNJwcvQhs2aBBbV90983RU9J824K+CFyScZV8DaRKkwKwsITleJey4Pe3O+y3Izz5pXd6cAqZRzz/fE8BkMGxV2ySyXkxltjET9MNATHo6c7weo+B75fYL+hPWKh6Pqt0yyN7iebjDezDdtM1TzErtYrOixR8imxngCgRhBaMFQ0WYWtmewhFWxAb6U0EMNBeZ9HEg5ynnLsBk1UcvpqYZSqNso2OfwsXqI5MQy/Mu1OQbh/ONkR2agJSVL0AjBQ9/b6aoIL+uAWewsfDlV5xEcu2Ce+jjkB1XIazutpXtzdiHHlcBQ/TKUSMul9x8AH+4ZMjATT+RuD/ew83V83RThzxBp3DWsD2tgPy/pWAGcXujMk0Ta/tkpRkgtuaTf5oZpaGx+bx92IJzcdykxONh3+vDg2Ib0X5TO3LPmxEZPckB9sarVfkEWH5wwv/WBTSzcVueoz1yFJgb4GQ6p2FnWTKcjx2icfQGTEsQrmV5TFgHrdptHMgYGNpbk5fm+KbaUeoBLzMBmBhnTiyQr43k/oL6llD2G4DcLbdvVahgvecKjsflU+ie8yDU8V5taIsI18wCb/pk6BiIAbi+rkAjnTVEu1J4TCnjX0BGDbwDyknV2knI96KUXGfEAOjzKLOtUrJ02eCtp1fSfo8LPvhBbAuRoRSuVo6X1104911dH2rYhZC2lFcUl3uefM9JbzLfkVY2NHWPdYjNnAJwy49RlFsXcS18qFmG470W5qsnMj6ZyvImrjyBLFTQfxm//2PVKPNGvEpyBLZ3qae9MQIIhvvaD+CjOq5tEmMk2XiLQudD41V0cLwb1LiORMt7hBlma7YKJLYUWJzLfAaYTvp+KwS7gCcmEUha+pIs7APQ06QOURPtqAL36EMVJAuQSyuCudajvJXon5HBlB8LtUoKd+hJlphSrWzcapmXiK9aIEcMIoWFTObHJwO58RXIu6pC3z514HjwsnMmcnPK0gDyBtEIbL0878ECKJkshBQK5qQestny6/TcLYy99MAl7Nv5R34n2BfCbeRoxmwoazjssZHytDjyaEJrnOx3XnAh4sJqCEo1mqW6Rb X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: fea32154-2c6f-4202-9934-08dc9d2cc12d X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 19:57:52.5763 (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: rw4mOf2IiDDSXToEaF97K1h1WcMxqKSRdpJIpvuRVDGa4LjnKFpN9u/RESr0xAIOa8hYmQkLkVMVplls7CISDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6877 The Makefile open-codes compiler invocations that ../lib.mk already provides. Avoid this by using a Make feature that allows setting per-target variables, which in this case are: CFLAGS and LDFLAGS. This approach generates the exact same compiler invocations as before, but removes all of the code duplication, along with the quirky mangled variable names. So now the Makefile is smaller, less unusual, and easier to read. The new dependencies are listed after including lib.mk, in order to let lib.mk provide the first target ("all:"), and are grouped together with their respective source file dependencies, for visual clarity. Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/Makefile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile index 209ede5de208..98d8ba2afa00 100644 --- a/tools/testing/selftests/vDSO/Makefile +++ b/tools/testing/selftests/vDSO/Makefile @@ -12,8 +12,7 @@ endif TEST_GEN_PROGS += vdso_test_correctness CFLAGS := -std=gnu99 -CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector -LDFLAGS_vdso_test_correctness := -ldl + ifeq ($(CONFIG_X86_32),y) LDLIBS += -lgcc_s endif @@ -23,12 +22,9 @@ $(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c $(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c $(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c $(OUTPUT)/vdso_test_clock_getres: vdso_test_clock_getres.c + $(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c - $(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \ - vdso_standalone_test_x86.c parse_vdso.c \ - -o $@ +$(OUTPUT)/vdso_standalone_test_x86: CFLAGS +=-nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector + $(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c - $(CC) $(CFLAGS) \ - vdso_test_correctness.c \ - -o $@ \ - $(LDFLAGS_vdso_test_correctness) +$(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl