From patchwork Fri Jun 14 23:31:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13699168 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) (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 ECB0518757B; Fri, 14 Jun 2024 23:31:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718407878; cv=fail; b=omAACZnC/sUb3kwfVmTa/xf0I+9IIGua1bPRFlkl9yi7ousrge47eoBTnlN930VOmmrsvZUupOVsd5j10wZAY6oQyhbArmYH5aOmJqJsoBCdaipi8JE2m7l8qGk4DXG0vleulUG4QpTp0KqcIqm/XeKEC+Dps+mYUrYgOPNwuTo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718407878; c=relaxed/simple; bh=fS0h2uo0gjsvRvhFJVYjz4AkAkxlJjbzDCaNBlB9SjM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=tuhHLmIQGSldsTuD9vBAQfaprF+z0et2afvlVzFM/HZNxCJtx7O5RDcMVrBWDx+OSGqosc1rByyXzG66jX5Etxdfo6oCNOOM3UL8/3MoaSME7QOcPrc2qYhidaTMhXzFFPvaL7jKKBDfup7wNC+p3ABSy4DfxG2NNyxALrQycb4= 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=ew/2LI59; arc=fail smtp.client-ip=40.107.244.78 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="ew/2LI59" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P3vDPfQ6eC+SDiFXNnPXS++O7++wjMiYD4B6xias1u92vjQ5wm7Ar6+vewZfek5T8dIDajFkbtyzCte7IKT+Zfj7uNhfU6tl0EkHYhrIc/U4zSydKY+s5lvr3uhksZVbucCvYZTsLO1cmiFMqJZrI4gk9PDTr+Gw/7FufDzsm2UDG4iyKD70YzJkARk1FrZnNHzHDWH1FnkUEtkjFl2/7zCOVjck8NzrnwSn8TgDC5izYz7tJA2vbIhQOLV+M8+vJ6BdL1qWUIEIMdC4b8LD9ojnAXTsqJQP7YhY4+mjZUzy8ak38sEWy5g7Z72wouWUsKd+JtxyhjrW4hqk6lErDQ== 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=qcsnsD1pNMQuFrOynC4BFElE2hN2iFDFASMwNJ9NSK4=; b=kT4LmnLLWHU6jjNjkLQ+RC9Io2TeAk9WxM3l9aLc4sCOtQeSIk/W271P/p98txOxVr00OfeHQIW/L5tNmbSTFJmcJg+urznklO3WyEkaeOV80WcXptaOrWmCRk8g6hB2hX0P2LrlNpyGeyw3FcuNQeHCz2Wz4zmp+T7nUFh/wGV1LeVbhGqhNKLR5Kghv31+pVsvPS19zqRlAn15XffQmyW1IL8q8/wwiounWIcu4LmTdq2rzHE5ECbYlDRAwt4ZXADtEfAVxzq1+0//PHvAVeolp2nRw/UIOEyzvB1FMgWg+89cKFOT+9NC8nwNeV/4ZMsNrXpt//GRVXXD8XJUvg== 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=qcsnsD1pNMQuFrOynC4BFElE2hN2iFDFASMwNJ9NSK4=; b=ew/2LI59jL6QMX8cnwkk2wTwInISBmS/t2aVRPbNpWSkV25MtfrVjgSlOJCzeRt/f7DVpiq0vhiOQ0LAyOLDAs8VzbnLMIaAZGLqq7MD7/67Krrds1a++R0Z8FPkYBkbL/LrbLiZ3e1ROozqhMFJ9+r/pUXToA//p4FYx+csRQbLFX3KOMPNUKmlrOw09+OvoUfjfuE1kHxNA8xh4tdqae+PGu9SMrbf01EAbhY+XGBh/BdGQjOGFsOw9bi8fwNO5k8M58LT4VmvlJ7M9iXkrOt640cfzNvm8SsSrx5erodzokVKjC4Y4ImkIkyEaYddyiXbdfdAsnHzxV797ch92A== 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 PH7PR12MB6953.namprd12.prod.outlook.com (2603:10b6:510:1ac::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25; Fri, 14 Jun 2024 23:31:07 +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.7677.024; Fri, 14 Jun 2024 23:31:07 +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 v3 1/3] selftests/vDSO: fix clang build errors and warnings Date: Fri, 14 Jun 2024 16:31:03 -0700 Message-ID: <20240614233105.265009-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614233105.265009-1-jhubbard@nvidia.com> References: <20240614233105.265009-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: BY5PR20CA0027.namprd20.prod.outlook.com (2603:10b6:a03:1f4::40) 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_|PH7PR12MB6953:EE_ X-MS-Office365-Filtering-Correlation-Id: 398c940d-ef75-4b33-cd45-08dc8cca10ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|7416011|376011; X-Microsoft-Antispam-Message-Info: LsggZN2oP82g04UXiC7EjT2jf49wjUfDEc8Jl5uI73BseraAZEC0qF4kcJPoFkmTl8yz1/I6QGGalefJVUPOut5/fMsiulGiaqdzp2HFXXGWWSzSK29KPqBlOmPGFxpCn3u+0gnLt1SBDr/bSc5cWgpQcFqIdXtgFbH53WZCgkL9L8+tJwGPt5/F74t+qDIFCWBKbn7eBBF0NVx8MPnnXe/qZlARTMl7iChFRD+vD2mQVdftUwJKA4JKLGb5AGSop9e65LwSp/59nG6mg15z5QXYXmrKsw2K+tCvoNVAIFkw9MzeYeYu67xhX9fv1qIOFKjAGT212gtU5fWsdKTTvhS+5odV1N0gAMa80amMQGKIiYxUy/XWBwij7tkc2kp3ZhlhmkZW4U6mhFIBOy98aYmeiZv1N4L4xRWvta1Fu6N3KyRT0FrAHOlf5Z4myAX1g2+X/unuKrP5NXBvE/M0Z2suqcXfJ8092puu7BiPZUquJdBsD+Jlchf/AdmifQ1sOqt6AbIdWNvX73xG0imCfEvqY5xzDL3Kss2PzItzjGdAGcjrC7rHasAkMxD6IGxtwz22sGslv5tvLAquelLSUZgCiyag2h92caJuFt6CYX2XAFtdX6x20giTMPCEIrdkWnEm4ryANuviaqkeeX7Q33lEs2nGWjF7jVqiAYPkKGqmZmJywDEPUXuyBdk9cNpMBPeWMJR6g4Da3twnB5ElkREZewatptdLV/AFGN1rWAUM8GVOArOKmvWm0EG7ug3Ll2x7evqst6X98y1OTd9nD1XUY3TyrQIUUyVz14xdKOsgouSuGaiBusgXj7Hll+NdqHm/438LoVBtxENGXA5qdO0XjEGl+Y671ZAS+w58UWDMSyFbUdL/ifFuf/90zOHakrjNkRQSjct1HLMv5OK6fuKLl+a7eEJg/viCmbg1AeyJrVvwy5v1eZVQA6/lSfCEL4QQT4gbWyHnIc7xjgykrKLrFhqtqNnbnntjBPnd8hLes+Iu4k/nONj3lUdO6XSnUzYMn1AbrEvL3KDuyIcZ1H/qZ2OIPSwAgnInh9rT0aov1a/ucGbAdFZO95Yv7v531N1RPdQB3bGhJqpX+ccTBmk+xNrtn4aiMsHiBfvMLZEWM8uU+cPBFA8r5d1srITL1LKG1SrRwcKOV+fbM3vFFxhopX1KNt0yXWJye9KrPmyZ+/U5E9uY9TGi63FbnwhOEukii9eG5Rqjz4AFAsde/BWVZ6VHiGhiqaLc3acx7DuVEcX+ttH275FC16GMbyaxEZlG41fxuvV/LvFAwb/jHRSbRrdahDiWJC9CY2pqJUkplOkmHCwrreCnvgWUQ0Qv 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:(13230037)(1800799021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/aRlfZlAtgvrj4haygw9wjdn3XykAehs09W6YsPHSfVsxcBTfXs7s4/kUfyWdfhnzPmicpJ06MGIEJ9iRn3XfRwXVLvHH3swJnWaKQ/uDOCxTgmDh+qrRj0QDjJye9nnQMoWLZAV9zS3t00tagI5Q/fS5Vvpwsgypar81Ssc/b438yY50DASrlHvKArAmR/pa1PLlbsdW8u3avWb0up75vm7/x5HbQhVHcwTYzmQaTf4YANqcF8QBS+rx9YVYkulYSYmrZO0kEerY0kNiE0q2G4kwuv2DcZ0ljIm13tGaXADIMsfqMZlwhHrZLa0D9gO8wesRF5lwBV0Va8Zi0KUExwDx3k31s/yln35N8hSJeWceJkpvMHf2lAC/BjpCF7YRwZM8cPBMGPXhxa81rVD5cfVqArsD3LJTSmrezFdwJ/Ngi32tMjJ6PiudxTIskvoe6V/mfIoYrlOMzV64Y3gjVgB2aPan7UrPy7CYO01Sy756K3ZnuS0wBcYk/FUL9DvGiCohEfVFqBNohT+/72Kk7nPaaKPbt2RceBwTbzzpaGV/4cokqjQ4b7gZE4F62cCDcX5mm7iwD6uwRpT4FjLu7kb86inb1zI52K1F4BvjAyMi5LhEOcm X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 398c940d-ef75-4b33-cd45-08dc8cca10ab X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 23:31:07.1430 (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: JWggBYASYUaaqwmMF6nlJeEEh+Cc5EwFNhbOy/aQgfDsSmEWFtziRCGQKNeYKoUHOFCWdDainNEZpF7Vo3rHNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6953 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 Jun 14 23:31:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13699166 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) (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 ABBA917FAA4; Fri, 14 Jun 2024 23:31:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718407875; cv=fail; b=pafsqa59sHNjRZDy76NrF3ljSmJnz4WeP3NInQ+uswa4cKi10qlQcn65dApIa2JsghqRi98/YTHwlEnSrB+nMBRMbQN0Zaggxc2frsF5t44W5j7YeBuStxY1hfvgMhlmesBBXlsKZs7AF+wp/N4WMGip9iPtOazXtAomV3MAHKk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718407875; c=relaxed/simple; bh=xz+IbFEVQi1i2+B3MIak2OoiRYbFH6kWotXqPDhvOEg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=QOfPyh3Lkx6RwgSSdU5px9InqqwGoq4+7feP54eA7h9s9iF+JkE92i8vkO+Vgm4gSBIVkV5lRF+VjR9Ef/lPHzLTsirUCByU9rwTUczmq9Y3fkuN2jY3nUI0Cmr38O8FZ30XcWdMxrQDgpa3VL1+XRdUz5RzcxidIexuYpt44io= 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=rlB/H1Np; arc=fail smtp.client-ip=40.107.244.78 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="rlB/H1Np" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WyK/bplJVgzsKX24krHQ3aQc5cfNcAECs5gtlVt1EHasUZlC8YBJtfeIun6x0jnnjwKUurtPo0AYS/YauWamsItCDflks0BRwwqfr/ynE3NzUQPwNNcSHFjLQMGJ54yCSh8bexXNcQU9tcOXPgpvQ7V+5/o0/5VUItkrTL9VfWuRJqJoUoSp4C1+LB3hpnWI5G85nNhzEQJXxAojdZlpywdX4AuPSLiaXBfxcTm0vUScxz/6l4M38NUB8MIBlMnVs79WH8/Dl06C57/GXENui00eAuitQPQ4xTnVqHAlWKBmbxkC1hDqAta8cXD4is3ZcvarY5U100Vx29h5lGwAPg== 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=4L7Mdw7LkQKm8VHtcpcip7zoUkVQc9BeISjiGBJ6DUM=; b=m0Ftwto9lxNLiK3b1GrwQEhcttjuG1bM6kcpubavoGffk3sI7j8uDqqWkikhXidEgWtuyYSqkytSCfzfHCY0DU8YpteTVCHG7yClnj/rz5MwPq3TQRltzY1GmgZfO8i2Ns9/1VwObxwtd8vsmznrzHSnM0Oe3lDoJY4Cz2+QwKj4//clh8HXMidLOBooVzECwBIXuiALUYZ57omfnFppGMhV2dyN42OPTsHirYV/MtmJyurUrafFL+FoAzWLcvdFQ1s8jRHVZ/6qQQ7vYQfhwEIRE/qqNMGQBAV6MXIJgcYw99P2NjlD9bHKW0uKW9rGc+ShVXysyHzxk7bxtmkpYQ== 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=4L7Mdw7LkQKm8VHtcpcip7zoUkVQc9BeISjiGBJ6DUM=; b=rlB/H1NpkuLxtKEF/n6mJTpELQydvEkA+mh48WH8Rtd+QwvJjYs5sbYiqKWyAgFIrH2pjYBNxxr6miQ4Hp/8aUbhesWLmoJsHUaCXGlmcyA8M2eZZbdjrTmU571fIHO1Gga0WI3XXPwRgPBAyX99Bl4eWekL2dqdJQjXwXyInoX6ZLjmI6k2ujwOXBG96T+llWiZP6KeU6mkbuojSKVYJFsqMlsThl+M4DVDaDrwLW7Sf1/PGV1kSem0ePoL9WptP4YN24dayzBZeLmgNhQjWaSfp1qWP0cRbKMFyqNJe89BASmS2jY9npKTfxbnD5icLEkjfIcmj7g4vwPQC6lAGQ== 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 PH7PR12MB6953.namprd12.prod.outlook.com (2603:10b6:510:1ac::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25; Fri, 14 Jun 2024 23:31:07 +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.7677.024; Fri, 14 Jun 2024 23:31:07 +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 v3 2/3] selftests/mm: remove partially duplicated "all:" target in Makefile Date: Fri, 14 Jun 2024 16:31:04 -0700 Message-ID: <20240614233105.265009-3-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614233105.265009-1-jhubbard@nvidia.com> References: <20240614233105.265009-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR03CA0282.namprd03.prod.outlook.com (2603:10b6:a03:39e::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_|PH7PR12MB6953:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a34855d-9056-4223-c9fb-08dc8cca1105 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800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pzF4TJNU5C6QBZPewtUv67lmXw0Cvm3a7PZWd5ry71idsmWApwYlVAOcBG6nE1wEQIDxeZ+3+Ro/Jn53C1I1l2x6SJPjMHiZuNBEiO5thqhArxU9jLtZ3zc14rO9kwpnrIs09NpcLaLcd7+1EOHH1HCzrGZK3CRKWlyGqcnjo94lHNTg04OryzE6hKug3bT6To2nbC33hkBwDRUTpO5PCWFvOdHOov65dbDTGFRV2AihpSwsKBolP2dI2Kd3l50bGxPJlMvXw+P/JZT74BslMasIa2J+fuLF449S7gmzxHc 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:(13230037)(1800799021)(366013)(7416011)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eDDVPcwiq/oR00eGeHIoq8dxpYTeIdgPfMs4LBpl88i/thFNeeQSpFBCkvV+1j4PmqJT6hF0TpIuyn/EqmE62hYvfxyi4zEJNRLwWie6OnbNzBvKPP6/ZxtdIfHwiM2oTpNzrPgRHuI5L3cAIyPCPlwhYzYuDEeZJIRk/XutbSgilPZmfiOhcUGqUEcETpeqkGiPCSXCfp893S331m7WkEUL3QkdhaUZW3N2qS3bXJyYlJA5yKUuG0jNdahCuJMfeAvp5rTSnsNJcvtJRJeS2otmwWNy2jrwbrDlEIuP01nHk7owzHaAOMoSp3tWcQpRbwQEqeifI47g4uBpBFj+Wm/Jtyj0Tewmy74B0PZY6m6SbNTURn+4zwRpD3+ChZIVf7SfzxjkA58+tXBYC1KsvRyXhdPT9b02vDJKtl5m/Tz1z6kdu5gUJ13ovk+r6JE/v8WmayysRg5tsDCKcIFMwyMupeVh+yjNefG3jo74DKNPLGrX5XGieU1+huOOmSqd6Bt612TeKRldKsCDblPcbR03dvuky4cxhxQTh0Dzr/kIim5YdepygtcIOTi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-9056-4223-c9fb-08dc8cca1105 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 23:31:07.7245 (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: pnUUirwW6o2j7jIOgU22pfmB/IocOXlZ//fyNFKYxZGaVqAjMtSGHNpCqPqu44BiMUMVcTwtTLPFBUzAQ6/jdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6953 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. 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 Jun 14 23:31:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13699165 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) (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 E66CA19D8AF; Fri, 14 Jun 2024 23:31:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718407873; cv=fail; b=V4TYLTN0dBhXudEvMI6+yiHXJ9wrkG8CJmZaA+aDZMKzPCfY8wbtzi2quxfYAd1IPnlypTjOHqSkZbU/OlKuZUM2T2s5ziWV8DH/Jk5VA1MC13UgCLMwFpznkxoh0eVLZagYDwkVdDhSS/2Ifs+C2IptwSVFm4Hf/1PpGZaAois= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718407873; c=relaxed/simple; bh=lK58vpBfcZSQv3JcPh24mTbHXlmDL5Zm8gqKEelHQvI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=I0x0gWTcPCE8cd11eZmfGPEDuJQDupsTrZelqdZ6ad9oWg7OTwiB6n2JPVH+oV9IxqD8NIuwgZmVqbv8oGAZjM1TYncDSaD4wLxLaZPMIAlAIuv051z44pPXS28S1SnGb8CACWf4AcBrhtFHJR9gxxDuDK6ieIHmHpuJmAPTYWA= 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=sZTnMhak; arc=fail smtp.client-ip=40.107.244.78 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="sZTnMhak" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L78ZkqmYhGGODzGdKgcbCvWMfA0TESxz7QuXNW+lSM9JbOpIr7Kq7U8deybtRXiQ4fFupXnPtyRKnZFXyb4MH7PK+MAdG9542pXyK7GlRForPtP5b902D7/BEh1zFTznEMqLTCAI//GBJ0LZqHhTiWZCpttQGSP3ILza0m47WfMGr+4Ry8S4Y0WcI3DU8Ar5wyS1zeDXX/xN3qwrnYjOAd29g77BDY+PdYF2B4Q8UNXkswebHQpGp+cY5tES1LCN9a7nJl9KHqNx2PxFuDiQHC7w1JshaK5rblJ6iCLnDAnRzqF5+7zuxh4FGvyaRWxNxpq9IZjG25LxF4n6d8xBGw== 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=5xmOt1V+qeM2fjYdwMfL4nhE84hrotY5xIDTqf3ElEA=; b=kIxdThfPF0AVP9+r16J+Ye/XNERPDvM5xjC9RQBQA+NTbziNui8MvhhtooiyIQj7cxGb/nOsWzLn22kykqYj6X2e31eCpVmVQ56KhsC0QjL2UTZnct8vh5ccWOvq1UbcSyuEjYG1ugRxeeb1IHDwjyYt38OHzuUQ/ogg8wHQZ9hgBfPDhvH7bbqUA9+8RviBT0Tw47Zh47g0vRMDCl6ZAI3D8ewph7fMZ7GTJjsxahhDpgHY58tyidOrZgMSpCRhcCl1mX4UK4pkoRHfpGwWSiBtiJypkWv6gdi+GQRxfIYAH/8x4pxedZ8/DTrMWjdfc6F++t+QYHTrZeLEzNIwGg== 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=5xmOt1V+qeM2fjYdwMfL4nhE84hrotY5xIDTqf3ElEA=; b=sZTnMhakgjGBftFF8/0p54Eocp7ysi9kwP2VPAjS2NaiX8WS3kZvln8965cLEw4xvlPlL5MNcGEpVyeQqxN2k54aTTFzqtyx98LhinIVylSZ1F/JOMAbuBSBsNwPFrnzh5nPEChH4LWMlmSv9w1bSmapQVSVRpdpIZqX/dFP80ch2KxHBpaXQrrKMsg1rVVLAzg7Cdztn/SrppsmhG7H66cy2WPPX/l2aSJxNaYty32w4w5eHF4YzL8e475P8sxSHiwC/MDTLAsazhMsyDJDnNLsgIXa6dUBoj75sKuuLQ4aaIumN/8xUvEwZpVP9hHpvqVeGVIh3Kl206wzkzQ4Bw== 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 PH7PR12MB6953.namprd12.prod.outlook.com (2603:10b6:510:1ac::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25; Fri, 14 Jun 2024 23:31:08 +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.7677.024; Fri, 14 Jun 2024 23:31:08 +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 v3 3/3] selftests/vDSO: remove duplicate compiler invocations from Makefile Date: Fri, 14 Jun 2024 16:31:05 -0700 Message-ID: <20240614233105.265009-4-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614233105.265009-1-jhubbard@nvidia.com> References: <20240614233105.265009-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: BYAPR04CA0005.namprd04.prod.outlook.com (2603:10b6:a03:40::18) 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_|PH7PR12MB6953:EE_ X-MS-Office365-Filtering-Correlation-Id: aac556d2-4411-442f-84c0-08dc8cca113c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|7416011|376011; X-Microsoft-Antispam-Message-Info: yI8Mbe7fditXJKPrE4YkzPUtTLfPqxydVZu1nwz2e1czeiBed1yTRDUlviXutf4FNra5wv7LClFWSaT/prV4V93omwtw3iYWHoaCVtavTYUPBH114GWwHqT73655uRfhvXr20+SAD6M6mxL+h2Gc2rUKbgSWpdwQ/mqDD0n844YKYA2F2crSmsSh5kyVnHTDKFefLAfKjhhED3MG0JmP2Aw2Fo+48k14LxJ4fq4R8xGaksAFs5kLtEXVESjDJQGPTKO6RDtSuLJ7XD83PNlyn6ZZpY5kfFa/uNCrUcOWrkOp8QEZuzrhhIGOHKIWQnKxHag4hFA2frwzzxycglxafYlu07gqP0zMpHL79xGZ2g2ro7GroyBwjpXOCyhtpRVkxxHqqKMAG35S0ti2GEMyQX6dPDt1EUWRQ8IJL3WLL2oEpB1AwKPOSy9ekC9012XK09bpQEtw5lsWq6Muw9hgAwlBjrLNekhY0LhfcH8flmMp8sdGySzf28LuaPjqLpcKIkqIHEmre18Dc+h6e7skriABruKdGyCcbGyzCQzC46v1YVGshuYsGhU/XxeJb0LYSm/C5tdziuWDj9XwoDYhItSOsrHDA2/LovDnxeVxz+zwDLjTPo5NF8wrq2hUnLQhbO2pIM2pofyPs2wg+x936zpT/qtZ3oKQXL+9d7dtSFIS6QQymSmMtqECqULEW1POwmyc9LnunIUu3YId539YHNxpq40LTj7WYIDGheSpk1YnqnacK6GuBWLtzWThnBmPCRRkTURFT+Dd7Clx6j5hWbie66oKv3blXhn4vGnk/WQ45//cG0NjDx7eZvB12AaH5rgUiMCYsyi5NctIRh37eDaYhkgeppQ+uUgsD6CnxCo86bKKcOXd0tTvKY6JDXYZrRDlcErUjI9JI0e40L4ePo+YglkwYG/gJ3ALtBEBnxGUwHBUGJTPmfzSQngtvxhaNsq6DaS7q1tE/Zb4Y8bnmRUyVWKK9zV8c2FK0l/QsRNcLFDnk9V1WswCPfRmLiJpPArtAk4HOC+viE8q4Uut6uoL7ADSCkWq4XUdbgG30wQa2RnHQoUHDqKwUt5CCpbbuT9MwfSsmKYRWNMObC3o9zX4igv66TT7wNpSk3Owfa+Jkp+I9S3fHlR8SmP9OgeDZ4lCfqarVbaHhXRZQdCTHsmpWbFZFFaFuZKOK8yhOZKQ6YLVeMnhri5+0R5P20i9Eisan4ycNYdrNbG3p4nQ8Pnx7JoYHRVIOTKQw8Kemx+UizZZ3Dur4DdWG3FIntLEmcnFQ+YzWlp7Oa6whmJOAFLe6cQNhM2/E5JaxIpVTsUWtceYTqHFnL7/+1X5waXX 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:(13230037)(1800799021)(366013)(7416011)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3Lx6prSk/fXx71xnxpzV2zXr+f8xAmm1bJRUOswVVAZUawdlfNW2CfNphMy2gYQCxuVFu9clVZnQbRadpb5bnhiGgRMfJ2LC6ucffU0fpQYx2cUabMAWcho3GSIoA12wWMD9BzGJfpqibFjnhCNAS9wKvqfVykyCYl8RbiLuw9Vn0AXPTvPjdFgUPxUy3qWZaBtA/Qh+f24onrzqwwmqkg48sSBHrlr2R/ziow/J5wHheWxFwQxjNjChha2DCPzKt4HT0QywnU9Tg9JYOwwAP3+twAaBEvFon4HghjEhabVgpklsY/I3bKy/124mYX6r127uuFd0txZns6HXm4Lr3RzV8PVxr08lTNBX+oYTivpAIJnCO/IZgO2YS4TTC9RBgG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lYkClit8sSfmBcZgDzFVRf3bLYa6XE3pQVI4psxHWEZQYRcmTd3gIO8NCfc5lWZfz8dEVlLABbE2yNFzcJJoqo8NFqKt6jsbcuiSVKjGUzeyhVsMRdE4KWeMjh8hayHgI9xrVrf X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: aac556d2-4411-442f-84c0-08dc8cca113c X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 23:31:08.0859 (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: gjBL79TXJx4EFgeG6hy8B07oilDh6gJvI0NVg12AkmKjqA/34Oy8zxEqFWWg7rNY4qMEJE/ry1KhpGtJNC/R5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6953 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