From patchwork Fri Jul 5 19:57:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 811034 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2081.outbound.protection.outlook.com [40.107.237.81]) (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 D418E16E863; Fri, 5 Jul 2024 19:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720209470; cv=fail; b=k5EFTwzD2Zmyg+bfa/iaY+0H+2luUHDtQUqBlUOnSoEuN3iu0cckUARfG/JzScWF4fewaNUdGQ4lIGuaKva6lN3ylIBXAukJXoKBwzpOm12X9ohLDvtiiXXf/PPTNRSHyl73lTFgQ4Xvw5aZRSxEXoeb9oaEd4yu1pVuouKy0Ks= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720209470; c=relaxed/simple; bh=MgHmNWKEluy7o11yRU54f+76oQvqaqzKi+q0CMeRRs0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=YbCwJ0oXFWfc7Tm4FliF3Yd/C5c4rv9idPVBmsbnyzljlB8Kkcq6wm4i/r0snNlv//8OA0UZVpGqJ1U44pEc3Qi7zSXrtQaer/Snpamuj8NOWu4RQ+sbsw3n9WU0tQAvXUEfR+xL6MLeat77SKfHgSOsmlQvn3dqp7xR1ZMqcgY= 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=YqoXSdAD; arc=fail smtp.client-ip=40.107.237.81 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="YqoXSdAD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BNEthakfs4v2hsuKFQJvtQCn80m7RxYrMQV+x9z6SDyZ8JTI+CFpRj6bc5p8moIOnJtNbt9cgH8X1aYb//OD6OtObq6kPWiiNeCMqffUvG57uNEJxI1+2+67jeUSCc84NJn7WAr9bsoNVKrzBuRvxr9yfBT+rN0MYr1UPoFf+7yT/gqT9Baj9EUBPi7tegnQVnUmwmfKSW7tR4ELlm4+PpzWtH3FrLCeBDDbfTKzRwYEtPFAMKMs6KvCyuspv662Pzd5is1hkZ5FOKhs79nj/Oos7JKuMgyV/javbMIawlFTgOHttyX+a8PFlgBvrZf3ernETG9tQrFD9vwgXyrxnw== 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=gVye0FQABQG+xEBFmxIGedfhZGdtStZvWVFuBSLoVkw=; b=GQOJcBVcIOI+bgWulBClVFfTt94H/IWWY9tWk+FIVIuRixDcRpXx+Y5Lxjj46RySRmj6a8D/7c7axeGr2sHZqSVLsWfAx3gI/f9tXhJELNK87Q1kvw78wPzaV/Rq/ORzS51TrRM4GzBvo/Y7b484NGS6dTMDo4sJb0tlxDg0u4p3uCwQgopnApWxCzSAhJR2NMGm/DQuykfSvC9geq+ooe6LZT23iDsuhk3sfW/9grhJn09HA39BsaWig4qJ0KvdpZbv5OSGntZnZ/UEFotMoZHbYUb3XzeRja0hJmsWmOdMu82XjlWnmZgjeiCUy8MfkCWSEdedE9oFMu0oiqOGVw== 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=gVye0FQABQG+xEBFmxIGedfhZGdtStZvWVFuBSLoVkw=; b=YqoXSdADwGL/9snSCMkUh5+eXP2bYcG0ycxjJ+H8NVIyseImJfQxbfbUbhT5HZD+FDHE6k1eJqKylk0Fv/zkg0OF+8CUworWDyHQniuKRA8/77NmwDPKCUs0ult4RDRnt+ka9JyThzAwzOev1CO/A0PrQ0YvJB+6+eIhO/FpErT63RuXgmVZrPbB4DWvPS39Dya/19bUg0k71NHQktIXdTOsShi+EtMSUwGbgB+lCxhx9P8G695nk3FhdL0OHoXVhRy5Q1DWFme7bdDTQNtLtOmC7+WJWUCRQuBrSX8Gw4v3oejDMbg6MHZC/goiyLIAwvH7xbxrfXX4PurxONdlaw== 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:46 +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:46 +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 , Carlos Llamas , Edward Liaw , Muhammad Usama Anjum Subject: [PATCH v5 1/3] selftests/vDSO: fix clang build errors and warnings Date: Fri, 5 Jul 2024 09:57:34 -1000 Message-Id: <20240705195736.34039-2-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: SJ0P220CA0025.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::16) 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: 6e42adbd-45f7-4a1d-429a-08dc9d2cbd59 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: ZQeRkymZrz0tYeh8+6Y+82beno1ZL4YXLWAoFiq5r+/CyPdsQziHxKWGtEMu/NpF1pZrAcqgTNYnskdtWcpV5/TRYgb5W880GMEAI6N30IySC0Z3RxSOW0ONb0lCG4OL4H/QsnfJxd8xFLIA9/9Uo7sFef53GuRAmAsJ+qNz5bCd8vk3A/roGeZ7+OQvxkCci96C5qzdslk/ExvCNWdRCUXT1iY6QRL3nnDZBdSWL3YUqGTmWFBGNsVRJLe094Ge/sgpAhzLaN191wF1OzFzz8R1aVIGPsXHjd4Hy8awffYsRVH6YRLKVqb1vKAfGc+vf54J3zrBRYTkQUiYDY4cCtbXLHK31dZDHhcrjCWt4Giz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5PR12MB4130.namprd12.prod.outlook.com; PTR:; 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: LQCkuSjdrTKAwrkjgOMQCzvyMKHbaaUf7oAWWqd1nGhBenTHPvzsv0h93AVjBBZmH7GkaKKsE3aqGNRk2Z9XseWzFuf27aSMe2IhsFbFkZJxYNbsbpdyueMIjKIAg5W68cEmzLCL9rBXfWrBpkH9iEeYGEPpXMskbipwWxwaJrHN2JHQWQigARFr7wQwq3thYRcaFCMp6VJQg/ohUgugiv4RVxwd71uglLI//2m7krzf8q15sjL5qYLX7CbkvN5F9LbNINJYKuxgO0jKHP7lO1IikTurvHGyvwShWUcH+mmLKd8QRllcKoeHwRnDRYMl/rpeHbPB8woKkYO3TVdaBIkTlFADkuW+65zIksotE4cZqa3O3bHmsYvTm5YzNBwl1+to7m2bAl06D1RIemo39XmYSvtgwQ+u28FgH1lEqC+o+lf8mKLcRfkfBkX7u84+gu1OWBx0CKISYl8ExI7Y++AfDY4jSSPv+lvMnNWbi1DcBi3PnzOyNisW/SzFkWCBYPgW+jm9MtR0yMHmPhfzP9TGYWmPndiPQK0OAW1/CIc3KflUwWDkknnkmdiNgjGNIkZpMvhWDlG90RTBjC75Pq7Xpn6qftc/3FQ1UtmowlimLaj7Dvmpe5V4lhagb9MCzs8W5gOY8Bhrcj82SNkWzaTpG5lzgBSqeIWDcFphZxdOPw5zRdLfjbn7ohQfuloR2fXJMNUtKgd3aNrDLBg3NNL95fbebPU10ZocqwUsIUiidjrzYd4o+lCLVXcBVfdBHsoBnIbFhenAcrSBEep3WO7UM5qBYyOLzvuAv4mvOSq/bKoA9OAo4+esCHB6cf9LTD4BTDUc+gUlobGSCBAH+iwYVUK0jBVuu1k8HSMTz+t4lOJ9n0IyxC4jgEd5V9m8N2vNwFCI/mVPNQptVlqXqud6D1hGURszC1XQC6AtpfV+2uxwCdWrkQ9GVVM60HD84ynOROd3Y+HeDY91P3iuUZR9+yOiUrEgti45TNFPBekJKEpIQMhqtP8Yktm6mSy43D/c6ulo5UJ0n4jI4Z4kEQIW2VRuGjWeukt3Me93znK6sVDwzcu6qHOFu6RTavY6OUmt5hEVmqrqyCT/EBXeAFrTtP9iL1zvWaMdK1aETiS9x9DCfWBWstcIwmgNFPCxM7tUPIQ0alGxg0U4A32QhAIV9Evqp6o+aLmR6ZWXJqj5O6KrlHCw4tShrkzo83p+Qsu7SPmHp30UD6OXE5d2cX2G9Lv9kDAM0m1A6wThk/hQRi+1m8ZG6skIL28i4MYhpDzAcNKGWndtuUMh3Y/LNlWJSTiNkYw3tJEyabrq4fjaDKOgr29Md9K3zyRNALQ/OkHPkLI1OBruofEa0RUZ2LZ8nlWkZzl5NuWvdKxA7usL8amobeRuzChksfs83e6XWiTTbFWzrRKdUUSe+9tK9zRQvppisJbcI5K4gDbLaU+y/g9Bq8y0zPyI2LAVRhl8/F2kREHRMSINSvTqH5nU5aMX99t79k17u9mHe2ZIz6YRFptUfmmUc0JI4HroGFtaGIL2o5hc4hAMCH7rBD9QzaXN1KYJWkrHQ834182zbGNHQDsAvH47kJ+u1pCMgIH3 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e42adbd-45f7-4a1d-429a-08dc9d2cbd59 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:46.2672 (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: 44i+/lD/m9SNjx3i8Q6R9hL2O78ShnLtxLcP7w3S7mfC35U03e4yX/5UesaBQoey18DVuAoLYyt4GhT+rhWxDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6877 When building with clang, via: make LLVM=1 -C tools/testing/selftests ...there are several warnings, and an error. This fixes all of those and allows these tests to run and pass. 1. Fix linker error (undefined reference to memcpy) by providing a local version of memcpy. 2. clang complains about using this form: if (g = h & 0xf0000000) ...so factor out the assignment into a separate step. 3. The code is passing a signed const char* to elf_hash(), which expects a const unsigned char *. There are several callers, so fix this at the source by allowing the function to accept a signed argument, and then converting to unsigned operations, once inside the function. 4. clang doesn't have __attribute__((externally_visible)) and generates a warning to that effect. Fortunately, gcc 12 and gcc 13 do not seem to require that attribute in order to build, run and pass tests here, so remove it. Reviewed-by: Carlos Llamas Reviewed-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/parse_vdso.c | 16 +++++++++++----- .../selftests/vDSO/vdso_standalone_test_x86.c | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c index 413f75620a35..4ae417372e9e 100644 --- a/tools/testing/selftests/vDSO/parse_vdso.c +++ b/tools/testing/selftests/vDSO/parse_vdso.c @@ -55,14 +55,20 @@ static struct vdso_info ELF(Verdef) *verdef; } vdso_info; -/* Straight from the ELF specification. */ -static unsigned long elf_hash(const unsigned char *name) +/* + * Straight from the ELF specification...and then tweaked slightly, in order to + * avoid a few clang warnings. + */ +static unsigned long elf_hash(const char *name) { unsigned long h = 0, g; - while (*name) + const unsigned char *uch_name = (const unsigned char *)name; + + while (*uch_name) { - h = (h << 4) + *name++; - if (g = h & 0xf0000000) + h = (h << 4) + *uch_name++; + g = h & 0xf0000000; + if (g) h ^= g >> 24; h &= ~g; } diff --git a/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c b/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c index 8a44ff973ee1..27f6fdf11969 100644 --- a/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c +++ b/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c @@ -18,7 +18,7 @@ #include "parse_vdso.h" -/* We need a libc functions... */ +/* We need some libc functions... */ int strcmp(const char *a, const char *b) { /* This implementation is buggy: it never returns -1. */ @@ -34,6 +34,20 @@ int strcmp(const char *a, const char *b) return 0; } +/* + * The clang build needs this, although gcc does not. + * Stolen from lib/string.c. + */ +void *memcpy(void *dest, const void *src, size_t count) +{ + char *tmp = dest; + const char *s = src; + + while (count--) + *tmp++ = *s++; + return dest; +} + /* ...and two syscalls. This is x86-specific. */ static inline long x86_syscall3(long nr, long a0, long a1, long a2) { @@ -70,7 +84,7 @@ void to_base10(char *lastdig, time_t n) } } -__attribute__((externally_visible)) void c_main(void **stack) +void c_main(void **stack) { /* Parse the stack */ long argc = (long)*stack; From patchwork Fri Jul 5 19:57:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 810514 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2074.outbound.protection.outlook.com [40.107.244.74]) (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 EAFCA176AAC; Fri, 5 Jul 2024 19:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720209473; cv=fail; b=ViNkrb0k+8gsFgrvkjcfZzxtX7jumIksiR/U7Q2YX4bN0BWzhXS/NJzXJPtEIy3iQsdOB7nTH1Ko6kqiPdgNKSNkE/R/1QbbNywhvJL6qWRB9gJMQ0lpVcoSWkqX1fidRT3cIt45J33JxAOFBYdai0kV3X1KFf7xnglZNUYtXYs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720209473; c=relaxed/simple; bh=KgOM7gYWdvykwtpnFzEWnvL7HJnkby8RThmqgqTn9qE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=RVxeFfV+GkgitI91zQCd4HFG1v0YVxp2mS86Y7T01VHpZeCYKhr+7eX+tim82lX028AlKsPmzyhFMcUyr2EDwzj6ZbbI3hJz97K4/ZapJELChx5nlns6IKHWvbTPaO9yaQv2zMhv8nID7/58lSvaNo2GzgCHurGuxpTJozSpvRM= 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=U/GWGnaf; arc=fail smtp.client-ip=40.107.244.74 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="U/GWGnaf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jh8pSckblvCmiJewPVSp6lTZXxUyxDsCnMBvmg4oMTsh+n+jbegBvftbh/1HXlgIt9Kr1vACTcx7xvTK2cnNLphS4Bgg12Fe57E4JQad0wTXG4IA2KkqUytUbyhCvSDaDZ9kCZdwU6+jqD/4t16K2lqjm7kK5CbwCUtw3h09JXXCSyLhMsF5Wk8zLaCEINJw+ecEaB1bncheXuMHU9chSrMreBZLvHuFD1H11j0KYaiJCfjp58sxy1jc6M5lN8n6Wv70U4N8qWFCyeCKwvpHq2Svo7I3rJ4yhxN6E19M4UMSC9u9mKixj6HdE6MykWtvhUntbiv0/22503fT5vqc9A== 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=7uy3HvZstF6narTciXqOd0rXy7Fy5qz6rGmUEyvSVGc=; b=LvEIU/egW600f7PNkeUlt4bMKYHCgkEAyBIQMYWcGfYmxco18WD1LgwWyqgcil/TidDtbikn5F+JOAwtbjPWbzjUjgiBzCmjVZESud2D+bAHIZWihLA1+3b0jH/F/hqYszDelAvKLN0K8zl0zpKGKGDhEbvuMRZyC3CnuMiPHhAwD1TkIJClyjRnvJTfWw29d3IoQIBirT83Fdj7I3QaiXWh8sKpogC9Nexnf8TacqbG8YGQBL888kirTjL0gww/dQwlxokVDRKl4Qh//NPs1IRZMGFUQZ6fnuM4ahAvLzC+VNsnzyyvqnB4QAeg36U9eS/F5Y7qnX20qESy09/cLQ== 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=7uy3HvZstF6narTciXqOd0rXy7Fy5qz6rGmUEyvSVGc=; b=U/GWGnafAmT6cOPmUOF9EWJTWO3ak7e2m+mY4/D5T5LxKI/9qQzIComDJWWKJcXOwPGI0y5PDHXw1jB5JyPZTXZbOEwID8j/vuP4VamL5indORxBsrr8qNj/aMRZXvrjNsSovU421YTPx71+I/C8RahgfhUzeM2NJxBk1T7deiuUGktlXQ2y1ER8D8cbUBriyqfcWA290CaW/saI+mKjlXNdjVcSDkNYMOFWCq1iJ2uxcbRoTDfzOhH+44V8RRCDTO3b2X51CTxwfSiZVk0pLrLX2KiADYjHz4YIzwPPbML4BF/R3GknmCwNKA1jH3HZgZSwzo+s+EvDuOYCN0cnDQ== 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:49 +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:49 +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 , Muhammad Usama Anjum Subject: [PATCH v5 2/3] selftests/vDSO: remove partially duplicated "all:" target in Makefile Date: Fri, 5 Jul 2024 09:57:35 -1000 Message-Id: <20240705195736.34039-3-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: BY5PR16CA0009.namprd16.prod.outlook.com (2603:10b6:a03:1a0::22) 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: 240d07c8-ab23-4736-d0e4-08dc9d2cbf4b 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: dMciZYzQl/7NSSFQoGTul3pzu4gxJleyfKQ76gKBgc+V3jLlNOq0g7jeDJad//f7LJGjslfoOWoOuRfSMvVDwvK423oFGT1dRm0uqlHc6qNZtEXNh6xYnNh/Es87WdsDcXhLmtQTOP8ANqF84E5GgaevMJ67j7NQkJlazg8kT8UoWal1u1ZY8yi1Ymdzp/XX6MMrO/MmXg1z+aJ7EQ/xrm+Xe6qw/dsy53L7s5TKx2xwo5cpG+L7BdbFtDSLzO5UyOqACdUZBxAe2oM6udPA7Rl3jQKs99oSWFCphYU4ARxyAu3xVc/U1i4S8N1o0k6581RtkT5ZFMET0WSUjKwXYgF7mOKfoxYmhi0Mr/Jc5xyjKZf5VtkSvonLbjRmQiMIb5AklWCL87czxcEFOy7Uxq0CYS1gUw9qoZF3dlaPf1CiOS8VQ12rCRMpllpXX8ELzDvCRygc5+NryFKxJzG/3ABcTPdDXKm7BQZehMIord/82P9ggIepfn0lk04C8DWKOHXXamUSMRxBhOk3M3M8hUpbkqsXTuUhxl37HrM65ywcZZ/XZBFiZQXLUfqhfIJWfWWZW0HkHG7zUWrNbNZUzkR3haSKIAosjWNg91YZI2FNGi7N+M5KD8hBpqfUqtUitdDr35GHirASYuOe8qZ4ebocRU0nsZeWYVrd2FYCa/jMScWIfkjPW20hg7u1vSVOG6p+QejA9bucSG7g4C0KhhxuLNxh5o348az1/ABzPiM99O9ZzTBzSdP9EyShqG/c4G7XwiiSKGRruaJTsZPql53vC+t+vgkmvAdRq4jZUe6xWm2b2PMr5Tjk4uCFdutqTdlKAlfcOqGu0bu4HKb9Dqumpn/H4AHPv7jJHryI781jdvJifxXB9qFfsR8F5XFxeG0m5kniAVcTU+jqFJ7LWclhbQIW+77T4nMHKO0EWzZ8JuMbFTpRkEmeCr2F/05LR2yDTMEL2IwTI4KJXkoeSda1MWq6JRQm6WbJphUleuQYpRXWU2egweYJljpiOAICvJ+LYqF0Wjyt+EZuYcFlaepOjQR9GXXxOWQfMjp5aSK0lcF0yFdMh70lic33/4j1KbRN3qhP8VomcYiHKKDzMpabn2TKwfc6797l1+t/+osEm12T5+AM80Z+0SAaJ9xlVVpiQU32CAquTfaIlSQj0RqUTBITeJZJYIsQVTukE3lQYYRfRSKKhafDYfdeaz1xoMIHwCW1Ovdr9+Pt/HJVctqCDnGBYX3YyKcEYFapQpLj6nFMP8ZBcgidgB3Z7HsuRbGV549kMf5hPD3vyBk8PRuwIuHntzZqa6RIk/4ezNl0ZsVlU7hISheCLa8vjcF4gmgbSg7oPgx39t8hGSUB9g== 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:(13230040)(376014)(1800799024)(7416014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5B1ZSCwbKSuUp9AYA8BI171SLXFaJgfEnOF3FXYwojAAEaFmJyx3i2QQem7hsJnUR/GFh+RTvU4m1WaESLjujNS/yfrMhOBijldl/LgaQGUjFEi0kX0y/PHaFrrOyYIFpqL9Y3J5wuTa050sXcSXnFX93AlptuXNuqYp2xc2jP3iGVLTvfPb1PaJRl0gO84+2eZkHctI5KpzPUmxpiN6TI/3C1hLxoO5dMcucpvDIHEw0o6ITsol1ORQdiC+Drz1jup3Mqb21HzptCV2ovnFuVZhaPNriT9c0haH1PbLKX43C+xSYRyqlp8CortRHURT/FqJ2G3EGCEpxPqmcDyQCJ2Hye0giFLJiR7IfknZkKVTsLfl1WJuxsJqqUWpxPGWwcTlUjdsUkKg/pgCa1CAm0/97OiE9rwAXg1CJsCP3kHgeqiryGtF52qEydQoeNpo9VonmsLYxTiWlJrkJ96d26bl0speuhjCm/apOOq7h2U7T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ydsnW9wCWbGafvjl39XszuMq9YGBfU6k0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 240d07c8-ab23-4736-d0e4-08dc9d2cbf4b 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:49.4188 (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: LWTjGRe5+agOQ9hr+Rz1eebJRZBRnuJpXhBsojujKzZ8hlSZPrM6pZxMh4WvEbanHxPJXmuTvDjTq1r/i42gew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6877 There were a couple of errors here: 1. TEST_GEN_PROGS was incorrectly prepending $(OUTPUT) to each program to be built. However, lib.mk already does that because it assumes "bare" program names are passed in, so this ended up creating $(OUTPUT)/$(OUTPUT)/file.c, which of course won't work as intended. 2. lib.mk was included before TEST_GEN_PROGS was set, which led to lib.mk's "all:" target not seeing anything to rebuild. So nothing worked, which caused the author to force things by creating an "all:" target locally--while still including ../lib.mk. Fix all of this by including ../lib.mk at the right place, and removing the $(OUTPUT) prefix to the programs to be built, and removing the duplicate "all:" target. Reviewed-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile index d53a4d8008f9..209ede5de208 100644 --- a/tools/testing/selftests/vDSO/Makefile +++ b/tools/testing/selftests/vDSO/Makefile @@ -1,16 +1,15 @@ # SPDX-License-Identifier: GPL-2.0 -include ../lib.mk - uname_M := $(shell uname -m 2>/dev/null || echo not) ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) -TEST_GEN_PROGS := $(OUTPUT)/vdso_test_gettimeofday $(OUTPUT)/vdso_test_getcpu -TEST_GEN_PROGS += $(OUTPUT)/vdso_test_abi -TEST_GEN_PROGS += $(OUTPUT)/vdso_test_clock_getres +TEST_GEN_PROGS := vdso_test_gettimeofday +TEST_GEN_PROGS += vdso_test_getcpu +TEST_GEN_PROGS += vdso_test_abi +TEST_GEN_PROGS += vdso_test_clock_getres ifeq ($(ARCH),$(filter $(ARCH),x86 x86_64)) -TEST_GEN_PROGS += $(OUTPUT)/vdso_standalone_test_x86 +TEST_GEN_PROGS += vdso_standalone_test_x86 endif -TEST_GEN_PROGS += $(OUTPUT)/vdso_test_correctness +TEST_GEN_PROGS += vdso_test_correctness CFLAGS := -std=gnu99 CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector @@ -19,7 +18,7 @@ ifeq ($(CONFIG_X86_32),y) LDLIBS += -lgcc_s endif -all: $(TEST_GEN_PROGS) +include ../lib.mk $(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 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: 811033 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/gZbARVVWz6PbUfCe9PrMMSAf7q9Iq3HzxcozZTyL21aJ2Ie5DUskOVMiGKlDp2LL7pk8kDkutkXd6giW50JLt3mu1RsYgKoxZO1bH3QFqho1KYkufZfqwECtKlVFND5HDnyVVc+gniGNIH0Wjg/Uff7oYDTCSKsae4mlPXX3U5EKY+n8sJkJduvj/KxkkDdRVa9ALvfnv+PPwXT7voFol37zirNH7Y2Vd1w5K9G1zaGkSSQ+4b4E8PLCuodfLLvWFXYWvyiwpGTDsVMQT/hj7/0SJrX4AW60K63US0567z8x8upiCFF74/EZVx+nbGN7gDXE+isZaZG9ut0ke8WOHdfhSFh2kcKqWcTgbIvPNDVwQneMLXCZDOKZXAmcfuPRL26wpUpbNFkSmGflzuIGwif1FAHddYQvSg95GM/Vp5SPTxIb/rCk0YdL0+t5+5D727lxyrQa9mwBWc/iNPCK/rejza3FkHj/TmrkKaWbqcICfXrNJixvlBihisVZSUe66X3t6jEFuaaLEQykq9ItNk/61W+fRz+XFaM1hMyKEJxDISznYWK+T5JmXqSShkZdYF/NwrMFvjTBYA3w3+HBKMDk+PFoLWUSDpsdg7CSTT2ni8nV5c98KZuIVSFNV1KJIFK6Adk/Hmq+3pnNjFXEUsMry2Q0xKzjdkICNAWSxQzxP10E+Vx92yLvQh9dy8X3xrq3ui+2RKhnmQQfLW7XTXYZOtHDFj00ZscBI9yVLC2RQlTGRiidqWQLCD9ZV7mAOcxWyttvNnPypcmD78QJ5we1ekT15KgF3pj9ntn8zLDybC3GRUPrTmxuLC54tO4KoogSE29o5cCt1NPJ1lPuWI33yarOd9tNIlggjBJUIoXLss2guaHBgwhH22aOAc1f1wiiPt/qkd2HnCAqwuRyMnuHfkkCwOonj/QRLAmPldzzsoxydTqvN+1KhhlcZhD3Ae7c+e4xNSipGt3fVBDYHspzsduXnYGhnemAJdQGLa74Akj7zOoIizl9kYKFpV2aVJ+rpTlUdvrxfkuCSst0R1KoIfSzMTCwF0j/Hyfx/2oc2CKp8GZaV7GmU/33+1TPmhUaO/bTG/u7V4EKw== 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:(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+82x32WrzV0PT8oB7EjkkQo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Mk2XiLQudD41V0cLwb1LiORMt7hBlma7YKJLYUWJzLfAaYTvp+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