Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp227837lqh; Fri, 3 May 2024 21:44:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9rokiVkWymij8Lmg2/ys1OsMTgzArLOcwg7bVVwEgOE8k8djOaPCGZQW30jzBLerZ1m4TOY9UlT9fnTU90Ed/hulTixuU1ugQgBlZuA== X-Google-Smtp-Source: AGHT+IHhI47QYqmqeRnqU3VGK0PP6OXjgaNAUlEeaVgYX6w3nDYUOKtbPXACHzbVsJdhD5wVYKPQ X-Received: by 2002:a05:6871:288:b0:23e:5cd0:faaa with SMTP id i8-20020a056871028800b0023e5cd0faaamr4134278oae.55.1714797852839; Fri, 03 May 2024 21:44:12 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 37-20020a631965000000b005d8bed5ec84si3595799pgz.258.2024.05.03.21.44.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 21:44:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168517-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=bXeHdCjE; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-168517-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 484832848AB for ; Sat, 4 May 2024 04:44:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9686512E4A; Sat, 4 May 2024 04:43:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="bXeHdCjE" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2046.outbound.protection.outlook.com [40.107.93.46]) (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 B445D4689; Sat, 4 May 2024 04:43:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.46 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714797831; cv=fail; b=IhtJyAUJ5S0BwSShey33yyGdzf0h5S0ceSEBsRs0tKDCUn+bHLMro+GTrSx1N1PEQJH9NVDjDuy75rMYKLOiInv0YkH37oRa66aoPEcKwStdO7N6gq1JZihrSCbGKPlxN7FVgtCTouILGKv8q00yAmcopfRQvIPREtkI6FWPpr8= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714797831; c=relaxed/simple; bh=n/Ajp/0hjQqBBCMxBAfGACJin6cjhP/AyWeVR3mM0iU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=TjW9oIm+2oKd4ZSgow25eyImxwFE4NlWZLpeMk+FIzSG24G7pFHl5GCQoX2UHmIbxnOWhZvVz5BgtbG8Myg/QpGiiiLp4wuTcq1bUGsDMaQC6sLnJyYKGpUVGKJBtgv/US00b5Whyy3HfBp4yA0Zd57Ysh2gp9DLfZI/dXwgbjA= 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=bXeHdCjE; arc=fail smtp.client-ip=40.107.93.46 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MB/eBRgMYdo3N6QOgnLHXTZxtp7JGnTPa1FCdp/I8oFQM4rrgkqQ/V8aQz9BiuzcwXTSQD8LzDS3CIEznZRm9299b5Dg0xFZmxzwm3vzTch5p717UJgofKlz3fszb87NditkSlVEUDCRHAoobOtVaz0M34RmLllqwIEL/BYWVREKDjG+06IBYzu7KmS5zNiybXPoms/2jOd6A/mcS1vM0YP2LkO3WFc9LL17S7RRyMv5r5kTgT/u8Q7J2oRppwSh6wxpi2J4iphUcQ7OWjjpcs1aFzMRetwBYMLej56S0rMoH3jrBPkvyELv9L0jL3ODiS7nYczFi8TVLpWbACAGiA== 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=m6LDn73ldiE+0JGGZAa2eVXiYtx60RVOPrO7dE22V+c=; b=KPCwgZQxrpqIkR1y+v5vzFC1WLzKlGkNidh0FidRV4FDHgYgt1s+2UrSxkUt6B+WU86j8s0XuVdRip2GkBcm/1GVw0unPeyv9juvVQm4p7YYvLBPhFGNbQfBAMUiqGcE2pr3IgfpfEoMyGKSo9RL+9BO1Foy7Tms94yZAm0teZwoTD8+FnF7YY6lMJAxtbNardknsIsd2+1nzuujCAuzG5dnxUzySAR4WZIxlNVgg8PrT6uAEQdr7IdOjx53uXsIAw5DUrOYJIltZ//M37wSIXYaS4xi3Dfaz2wHV4ihnMd5dkCeTpjDO+6h6s92jXPiyY4j/83dOLPSIzkljersYg== 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=m6LDn73ldiE+0JGGZAa2eVXiYtx60RVOPrO7dE22V+c=; b=bXeHdCjEzQEND57J+sre36KAEcGn6pyzDpETBIZbMAtuX3LOm4VrvUdKn++KlDehkG6Y3sV/5gN9GOq/DWe2cOHsVLUXr9BKIQSCrDs8uiMavAyLlIXodC0tTQar/IUehmhu9JWqR9E29rKFym3Jq2ZGz1UTE2jGrS+fjmhHqsIMM7H9GKX5mRJ+IUleQ1iW5Da2zLFSRPd3k3l7hqtHiODJUvrF8giHQpe2OtevTTUAjd9CDdB4qpLJ8tDebrb/aFxAYmSwb0ma7pE0P16dOHtZPM9sWBRAV7e+kVm4AMn5v7nlB0PPKXTHODOVA6wYewqfO6grnsUe4ZoVQXINeA== 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 SA1PR12MB7174.namprd12.prod.outlook.com (2603:10b6:806:2b1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.30; Sat, 4 May 2024 04:43:43 +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.7544.029; Sat, 4 May 2024 04:43:43 +0000 From: John Hubbard To: Shuah Khan Cc: Andrew Morton , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Maciej Wieczor-Retman , Ryan Roberts , Christian Brauner , Muhammad Usama Anjum , Alexey Gladkov , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, John Hubbard Subject: [PATCH 2/2] selftests/fchmodat2: fix clang build failure due to -static-libasan Date: Fri, 3 May 2024 21:43:36 -0700 Message-ID: <20240504044336.14411-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240504044336.14411-1-jhubbard@nvidia.com> References: <20240504044336.14411-1-jhubbard@nvidia.com> X-NVConfidentiality: public Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0268.namprd03.prod.outlook.com (2603:10b6:a03:3a0::33) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|SA1PR12MB7174:EE_ X-MS-Office365-Filtering-Correlation-Id: d37e3e15-e43b-4cde-d60f-08dc6bf4c694 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|366007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?G/K0b2M45P+cWHoY2Rbvk84gOduP30h2ypGNR9obHQfOGERNBoqsd306+cRd?= =?us-ascii?Q?JQMRJwdLur0PBc3kWSbkWEwRws/6Fs+cYtV20Q9RY+qfMb+cXwtRjoFAJdY6?= =?us-ascii?Q?mXyR3Wi4uq/WpNiKpz55ean/wNlPT526iyecnEFmw4DYCzqT+vuJ1ikrwUUR?= =?us-ascii?Q?WbEkshjyuWhzdYZSNaPQg1kcbHDa0ffUhhaw1YDazsh7xJFUfWruVMGpCP0B?= =?us-ascii?Q?IpxoPUqzYt9BLaSbzHK8IPgopAIunbHB1uEYMDdZxEItFnCHy5sZ5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YP0TGz2lWPGIx9+xeStLbFzNt6iPbc3XqZq2fHd?= =?us-ascii?Q?M+3iGUngSc6/FzQhJabQJq3/xiub1sfzn8cMVmEkGtjMV5uCcGKhieGelUBh?= =?us-ascii?Q?PUPxQVOXKdG2IhWAXKGJ5YylUs1f3I+ruf9sTp49eg=3D=3D?= 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)(376005)(7416005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?FZ5LBJMztS/m9wBDuEPzOsPTLoyS8whH+pqSa9B8V7nd/U35HVw/zVy+omlk?= =?us-ascii?Q?CtV5ak5+TsKMOANhj5u0oafq94xYJGV0OlKFqTtvSa3YKFipDsFtpA9kXPmg?= =?us-ascii?Q?mj+778JMGhIQ5saIIbpkPL8pRI9lgZast0R92qB8DAskyUUSA6QFesHHOkoN?= =?us-ascii?Q?ermmH+PIPB15zLqhnUVpip4QUM8O20MeQheqr8Wry5R7YS1VMnNiVJY3bYW9?= =?us-ascii?Q?A/BNGUtHrheMFL8b6RgF9kaIyyBtYhq1mHs6yuT9mV/RA2LOPrhKTIddgcmg?= =?us-ascii?Q?K2jvgmxmrkVhy1afHkLB7B+AOnHsYbTE4TWJfSNmX3zbQWfdHVqVSC5GQ/uo?= =?us-ascii?Q?l4G7ACiFmww6gPMlOoNEF653wr0xYXiiQARbfs4s9Ne18k/inwpizB92Laes?= =?us-ascii?Q?DrIedpv3qUxH/VK10mb8aM8gCbcW6vbPuGunNQjM90xErxPDUprtM4h6UD/4?= =?us-ascii?Q?EMDd4k8aZaNTsC/Yl/5xgB2R5DG01behZnAc+ew1KiKiG3rl1ZhLcgNOhcZn?= =?us-ascii?Q?1d8bnEA/X/TSH13jlCU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lZsDlL?= =?us-ascii?Q?6psAnB6l2giwVlRl7hu+BQb/jfO5R939NtqxkUY9kool/qbwlNTn33MPqiEH?= =?us-ascii?Q?EtxDa8hpJfIjlHOsH/+7VCoV4eb/lV/K4bJbPRjoPpoRoRiQdCLDRHPy7KH6?= =?us-ascii?Q?PhQ3uAqTpBvNA90xOtDfUsf6KNev8eu0q5z1p4H2?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d37e3e15-e43b-4cde-d60f-08dc6bf4c694 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2024 04:43:42.8512 (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: GpFuGi1ghOS0c9rE/2E7wX6NkZQkpx/ViWpl+3JsNLDDzf/QUhWVQ/AOw9pmH1dVS0SBnZJ73ol9PZ6AxoZnDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7174 gcc requires -static-libasan in order to ensure that Address Sanitizer's library is the first one loaded. However, this leads to build failures on clang, when building via: make LLVM=1 -C tools/testing/selftests However, clang already does the right thing by default: it statically links the Address Sanitizer if -fsanitize is specified. Therefore, simply omit -static-libasan for clang builds. And leave behind a comment, because the whole reason for static linking might not be obvious. Cc: Ryan Roberts Signed-off-by: John Hubbard --- tools/testing/selftests/fchmodat2/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/fchmodat2/Makefile b/tools/testing/selftests/fchmodat2/Makefile index 71ec34bf1501..4373cea79b79 100644 --- a/tools/testing/selftests/fchmodat2/Makefile +++ b/tools/testing/selftests/fchmodat2/Makefile @@ -1,6 +1,15 @@ # SPDX-License-Identifier: GPL-2.0-or-later -CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan $(KHDR_INCLUDES) +CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined $(KHDR_INCLUDES) + +# gcc requires -static-libasan in order to ensure that Address Sanitizer's +# library is the first one loaded. However, clang already statically links the +# Address Sanitizer if -fsanitize is specified. Therefore, simply omit +# -static-libasan for clang builds. +ifeq ($(LLVM),) + CFLAGS += -static-libasan +endif + TEST_GEN_PROGS := fchmodat2_test include ../lib.mk -- 2.45.0