Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1185849lqt; Fri, 7 Jun 2024 10:15:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKrWm0fzNES0l+saq1V67x12s2Yq//AvHib4Xix2MymNPoal35ctaaEJ9IJ2LYciT15fW0ukbfzOmYS+4JPE0RyufbmmWv0BD0ny2Tdg== X-Google-Smtp-Source: AGHT+IEs4eIkXTTYO27r9YXa4cYiEoI79BL8cmtKPzxQimtQ45IPX4DQ/jkGG7N0SrRF1o9Pu5Um X-Received: by 2002:a05:6a21:33a9:b0:1b4:da55:e1bc with SMTP id adf61e73a8af0-1b4da55e35bmr816587637.3.1717780547326; Fri, 07 Jun 2024 10:15:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717780547; cv=pass; d=google.com; s=arc-20160816; b=wC+5CebthC8QI9acUpYjaMMeFRhuY9VIlKsHrOr9SXTAwjqu6YdfRjoCpEYErLTkDR MbQk6+LRQ6obtaLb4sZIQ8ZXoUSJhwg9QcGpJdEGGLQC7hHo0Mgz8XrTbuaxcVuA7Eh6 GNif3uNI81yqleE/7y1htvlIhaXd3vP5b60gbrB6qPuJ6Mizy4R39PbEk0e0s3SaHy5L TIiZKYGymg/cWNYcZYQZqWRp/H7jAowtSmKuEGtRWoLxvH954CyHeiW50C4J4Wm8YXqU nTcx7ngreC/qM0Tghy2eRWBPJpzmnr/JN/qdBXLTMItXCj9fZ1LqLBdxoJN6/j5j45Fk s9Ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1IeyYlfN1INjl4WNxCc6NR0j3/dukyGk8Wj2WYez+Bo=; fh=rTszWSbnhBJ1iPxzQw6heqZyhT7YZ7Xw7dKJWTaZ65c=; b=H0m13+xg0e6FkkLhMhin3A+ooYbFXOdPn/N9ByVUCHWtCNMxmnNxZV5MEf+FwbhNls 0tvgqihAqeJvyWR89Y7xDg/CZ9AdeH471e56/KoETFikhcgLzfQafi2g39Rz3G/WaBra 82GcL5OgX/+aKNUizxN43L9LzQMFQkt9fnlF/UnBTy2x7BZMqeIqly1Mlh/9MYFZIMm0 lAyoxDHSinXTbO8dWWVX6luwsiN7HhjM2JKn5PtKkWixZ/Z3ke1HfUpCEd8QmdKqFlaH 4xqk1wEvBBvsZiSxEbjg6ze0VtcS8sZr+eB1jimb8tCscAtGhubF0TQF7uK6uwW90p/O zRnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fM8NZo7Q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd390409si3329796b3a.66.2024.06.07.10.15.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 10:15:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fM8NZo7Q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 C193628723A for ; Fri, 7 Jun 2024 17:15:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 034A719ADA8; Fri, 7 Jun 2024 17:15:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fM8NZo7Q" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1F7FD199EBB; Fri, 7 Jun 2024 17:15:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717780537; cv=none; b=g0K7xWJSP9VKUOPNRZ/2X60TZBLEFnbg3Ly8/60pXRhWLIiGCklJewcMEnFsqOlWI5OEzsZbFXvyKGmdDgGnGV+191pauyWE69dQ82H882DIK5SK29ZyMb5CWSy14jucKB9i9xyCodV75Uvd253JfmEE/SL5N3j13TlguRz0VK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717780537; c=relaxed/simple; bh=+1C+CfkaqQH+43CNlS0hRJijJsoUJkiaCU9L0PzDf6Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RCHwS0EOFcmY7gm/PTIN974tuGbsCG4c4+S9F2/WRZ6X+6E6ZftpKYVaVcBSnsXzCZGL7LriFKBYMgYAA/ppTo4q2xU4f7LKJlwb8rIpINgmISb5sORKv5NCLomgrHGOshIxry43MDj4ypkm+ihiTcBOGJuMDx1hE88kks/swHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fM8NZo7Q; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95CA0C2BBFC; Fri, 7 Jun 2024 17:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717780536; bh=+1C+CfkaqQH+43CNlS0hRJijJsoUJkiaCU9L0PzDf6Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fM8NZo7QiMbiOjncaSHQmkLJcdUUvEjs7fAgxeEAEARDTOCBwcXIckBlzncP7EjUx UZ+Bbz06enLZ/mz/hq3naYTZsM/3p45Sec3xumZ+RCS7O4ZIxE0l5Exglb9+K/JFCZ TJhmBS+xUrpvhQMMxa2Au/rTd1im+oYbDZxLohejJbj53UBEs1wFhpMZMhDIKtvCH+ iM5RvUOD8s0UjbH/LU/TJrebaFV9fUpf3F2GFm5NysD7+6zQzc0qWL+dXpvOInnM4G 9mnMhpeVCTayhdwqPnTIqxzA7XY3W7pwR/fJkuphGrzWukf34BXjshkq2AQ2idH26p xbLQK98LGFaKg== Date: Fri, 7 Jun 2024 10:15:33 -0700 From: Nathan Chancellor To: Ryan Roberts Cc: John Hubbard , Mark Brown , Shuah Khan , Muhammad Usama Anjum , Beau Belgrave , Steven Rostedt , Naresh Kamboju , Nick Desaulniers , Justin Stitt , Bill Wendling , sunliming , Masami Hiramatsu , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev Subject: Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds Message-ID: <20240607171533.GA2636750@thelio-3990X> References: <20240531183751.100541-1-jhubbard@nvidia.com> <20240531183751.100541-2-jhubbard@nvidia.com> <306eebf8-bb5d-4e1a-9fa3-ad3f4ea11b9c@sirena.org.uk> <20240603224706.GA245774@thelio-3990X> <2c57be33-77b8-419b-a708-e99aa9b44395@nvidia.com> <0d3fd536-5036-40e7-9783-80533914e32d@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0d3fd536-5036-40e7-9783-80533914e32d@arm.com> On Fri, Jun 07, 2024 at 12:12:19PM +0100, Ryan Roberts wrote: > On 04/06/2024 05:55, John Hubbard wrote: > > On 6/3/24 3:47 PM, Nathan Chancellor wrote: > >> Does CC=clang even work for the selftests? lib.mk here uses 'CC :=' so > >> won't CC=clang get overridden to CC=$(CROSS_COMPILE)gcc? > >> > > > > I received a report that someone (I forget who or what) was definitely > > attempting to just set CC=clang. But yes, it definitely doesn't work > > properly for CROSS_COMPILE. > > This history as I recall, is that I got a bug report [1] stating that: > > # tools/testing/selftests/fchmodat2$ make CC=clang > > and > > # tools/testing/selftests/openat2$ make CC=clang > > were both failing due to the -static-libsan / -static-libasan difference between > gcc and clang. I attempted to fix that with [2], which used cc-option to > determine which variant to use. That never got picked up, and John > coincidentally did a similar fix, but relying on LLVM=1 instead. > > If we are concluding that CC=clang is an invalid way to do this, then I guess we > should report that back to [1]? > > [1] https://lore.kernel.org/all/202404141807.LgsqXPY5-lkp@intel.com/ > [2] > https://lore.kernel.org/linux-kselftest/20240417160740.2019530-1-ryan.roberts@arm.com/ I can only speak from the perspective of the main kernel build, as I don't really know much if anything about the selftests, but I think CC=clang and LLVM=1 should both be valid. Ideally, they would behave as they do for the main kernel build (i.e., CC=clang just uses clang for the compiler and LLVM=1 uses the entire LLVM tools). I realize that for the selftests, there is probably little use for tools other than the compiler, assembler, and linker but I think consistency is desirable here. I am not at all familiar with the selftests build system, which is completely different from Kbuild, but I would ack a patch that does that. Otherwise, I think having a different meaning or handling of CC=clang or LLVM=1 is the end of the world, but I do think that it should be documented. Cheers, Nathan