Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp961549lqt; Fri, 7 Jun 2024 04:14:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6QfuZyI26N/BqO6qWSWfPZ00KZkxViz9pnFNQj2A84uPJpN4sGAKuqhSQMZPBQhmVSdKiSWKnEKHFP6Jj5Vizz4pK6FELrzLxuVujMg== X-Google-Smtp-Source: AGHT+IFBnZcbGqMpQs8tkjd82LUfPnRQxEfMnQgVCrTCMerP9BAIlaVoWD7k/p42VDK6BkXzOK5j X-Received: by 2002:a17:903:244b:b0:1f6:7209:52d0 with SMTP id d9443c01a7336-1f6d02f3f8amr23525925ad.29.1717758887883; Fri, 07 Jun 2024 04:14:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717758887; cv=pass; d=google.com; s=arc-20160816; b=ShU2/1aYrB+ksbq951qB/INVQ1yL/cKE7JF0qIL+KGwZMX2i50jTjB0OXYtljCF8Zc qxCtD9D3wdaVa7NrJZx+TtOZ4vtiN+7soITh2WE5Ea+L67xoL8LDB++9r3xG/7+99G72 QCpYkiZe4XNNyLRhKERqXWjdhhbPmMk+Ic5CiJA6wdaGasrnHbQEOgtoc1fcPw3SMcIb sZCjS5RdhE+Du10VmRqaM7qm9r2GG16r4CH1ns74uVXHy4LGz1LHV/O0gIe9xp6nATO2 Pi+viC4yGm70JPTQV4Dm7A3PyDTj38YvzCbUFdnojAlHIoAAMT0fWEZuzFwuUjKoz77d njcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=/Q4Ie8yVFufZOwIJKgZYk5iZPj5rUM4lAk8X290H2ew=; fh=wfS8GG5XQWexxMsJnoCJptKoGPJZV3QB+cwJA9JQBus=; b=VXRmeOOJumOkORBaMweSSCdv2ke/j4l26NrASmpD+ANBeSbEA2p7JwpVJUZC77rcaR Jj2GroxvPym3TwUuNPF10LOOlLNIFjoFOgxeiKOpbwG43Fc00iVEj6UebWWT78615Ne/ r/WQe6rOL+vm9fonnxjXmOCT6JUbhQLKiwByse3OOwcHKjnx9rAfm0K9txFgL8D8xYYF awHwVgWgevVPag0doXdqKopRujTMDCxH+IJT6FqdtGzSwY3NccchfkpThaalrDbfXG1m 30EeMPx58CHYVkZtT911CQQaFDWY3GwyWYbWHWKIr+hGz9hQUEwckN9cAVI4Ul8ylGWE 83xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-205878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd820414si21641305ad.569.2024.06.07.04.14.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 04:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-205878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0CD14B24740 for ; Fri, 7 Jun 2024 11:12:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B496D187357; Fri, 7 Jun 2024 11:12:25 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2D2C18629A; Fri, 7 Jun 2024 11:12:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717758745; cv=none; b=FOdrGysYKudOG2nDQNuoeYeyZRiMH8T81IYl7uK/Ufc7rdtKrUFMSFyXzaT0r3a6Np27sc8Wf+WVbOjdzwHTJ45mmhgeY2hsyuFPNvrRwlCLz14RKib2rgPu246UkqSKzUkU9kLpMyAsoe6OFOYswAmw8DXs/vyuTRIlb8npOwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717758745; c=relaxed/simple; bh=P2jinpvI+6JXnXr8CK7Na6QsQa8Mhn7gjzzH7d2TdqU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Le5Jc8G0m1cUMkMt4esb0+z9glYT/1D2A3o1a33d2KveR5L02I5ZvVKz8rhvfmB5KAI9jfN4ewng1Miu8QMImsXlohD99V0ngZMHc4YtdQQeo6cqOgPPoufR9mXbu3tAiq8oJexvsqXKkFTAXhxd1MuV3rxPDDB4KG2cyYTm63Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 817092F4; Fri, 7 Jun 2024 04:12:47 -0700 (PDT) Received: from [10.57.70.246] (unknown [10.57.70.246]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D24123F762; Fri, 7 Jun 2024 04:12:20 -0700 (PDT) Message-ID: <0d3fd536-5036-40e7-9783-80533914e32d@arm.com> Date: Fri, 7 Jun 2024 12:12:19 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds Content-Language: en-GB To: John Hubbard , Nathan Chancellor , Mark Brown Cc: 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 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> From: Ryan Roberts In-Reply-To: <2c57be33-77b8-419b-a708-e99aa9b44395@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 04/06/2024 05:55, John Hubbard wrote: > On 6/3/24 3:47 PM, Nathan Chancellor wrote: >> On Mon, Jun 03, 2024 at 04:32:30PM +0100, Mark Brown wrote: >>> On Fri, May 31, 2024 at 11:37:50AM -0700, John Hubbard wrote: >>>> The kselftests may be built in a couple different ways: >>>>      make LLVM=1 >>>>      make CC=clang >>>> >>>> In order to handle both cases, set LLVM=1 if CC=clang. That way,the rest >>>> of lib.mk, and any Makefiles that include lib.mk, can base decisions >>>> solely on whether or not LLVM is set. >>> >>> ICBW but I believe there are still some architectures with clang but not >>> lld support where there's a use case for using CC=clang. >> >> 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/ Thanks, Ryan > > And the more we talk it through, the less I like this direction that > I went off on. Let's just drop this patch and instead consider moving > kselftest builds closer to kbuild, instead of making it more different. > > > thanks,