Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp78723ybb; Thu, 9 Apr 2020 17:41:07 -0700 (PDT) X-Google-Smtp-Source: APiQypIfdYN9saU1ugLyZl/WCKWfRsltTrU4vMS94qIZ4WBenJSDf3Ej3S81mOiswpj0cMLa/jsz X-Received: by 2002:a37:9644:: with SMTP id y65mr1750318qkd.143.1586479267802; Thu, 09 Apr 2020 17:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586479267; cv=none; d=google.com; s=arc-20160816; b=bhfI4foXZzTfNDlySmnVVAUxCxojPJTAkw5ezZA3oQjsI2QReuV2V4eStY2/bmsBAG swQXeLxDfU0o8FqkOAwn+73eh94qQ8UkolcuCcO/OvF6qmqa5hna6D9aApgQUM7njZ2C bdxYjUIc8cECXe/IanO3QlKKUxlhNlud9gPtCx60bhMWz3JlK96Ha4Z3lXccXJQvX5sB /r6IILZqWZTHNQ20jmhtPedhi5IPfmnL+pCtLpDqJVKmI6nsp8k7AqOl4H5z0gWpwXC6 qbB2JWgA+Ed9u9aC6MPUtsw46IAPOa9FsAN1sav9cIMJIt7NBcDclLKEg1y8gg7kB8Si Dg+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JjCg+0ZKVUEU3m1mtuE7C2U4b9dMYk265cCmLvmPh20=; b=Br77r2Mq+d11vntxOAF4fu1VWUVgEkbQ830RSEFyQJqaUAJmWu+bKwLxGxbUH0s8jJ el5vbmhsFDdjJSaAr8DSIESxKqMpfzperh6FmkmmWy1kxP73Zg+djzoWbfs124WUwS6p 2S83GmceemWp0RS6C+k1zlinRFnFZElgAjAGltNLY4jXkke91TjAKFASvHcsebQvRue8 PGuTd0Vg8LvmAnZ7C/2irJE6Z1LvuBhTlTKdpJXYTZEoL0Hi+bdKFOy35vJz29k07zqd 4p1jANXdAfOsok2dF3yTl27atkr+YPZ8nFkEgLsJ5vPzt058nCgh6uhVVbsU6wgk3npg yDqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZRsrd9fo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si254890qtv.122.2020.04.09.17.40.50; Thu, 09 Apr 2020 17:41:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZRsrd9fo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726951AbgDJAMG (ORCPT + 99 others); Thu, 9 Apr 2020 20:12:06 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:40783 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgDJAMG (ORCPT ); Thu, 9 Apr 2020 20:12:06 -0400 Received: by mail-oi1-f193.google.com with SMTP id a7so157804oid.7 for ; Thu, 09 Apr 2020 17:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JjCg+0ZKVUEU3m1mtuE7C2U4b9dMYk265cCmLvmPh20=; b=ZRsrd9foGs0GWEd9amU602pwhj9SzLnjEnilwCYt8UiT2smbNEbJlYImi6QRkHncC8 AaS9xP6V3zjvdz1p8XPHlz+BL+on5msn1cCcROxTzceDs5y54LB6YEJxRJ6bYZNCQT1V SrS4DieBPjvUhoQnk6YbFcJf0LPyQw4d13Djak7JeOyYl/CUlfSqpZZFr4pQgp7TTHP8 umlC6iW+1U7zKs5p0/2D8Z/R6mO263qt1PvyDno367L24yUnOcLbk5EBLnHhUkh8xewV tpGCi6ZwJO8yqZfZ9nsskBfoG1zMklLNkGnH2+5bQdTeOY/021d+DsTPRx+2qGOIDiv5 zf1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JjCg+0ZKVUEU3m1mtuE7C2U4b9dMYk265cCmLvmPh20=; b=HBEJ+VZJmFR//yqGkBkBO7YXHF/yTt2GA47KV+jO/Tm7dXaVxXDFdvR/njVtUW8l4Z 0cnQGfuk8eBcmZj5HxC3yGCOjuG6ZhTkKG1pv4nGsxozT/J3PILF43K8BPKaD2R3QzKK Nb+BjMhbzUySrnldvfUsODTCCPyISoNVpT+uTvk5Q/MME3BBV4l9khMN7+9ukGo3iEFU /fIfd1oectWxW4xGJuspj6tjm0ArAqfFE/1I1fvMHNul/A8fKCEQRKY1sOkQdb6oKXI9 UQClq5kf/rVo6CownCXJM0iZBKFLQkQSY/s/AcDgqNXpqIN2wxGF9FAOsN6gQv2N6i1c GKxQ== X-Gm-Message-State: AGi0PuYSN8pqQ9+Aqccil3m2WleP6kLYPsnmj3898iZVPbUQaYJP338v uDhQAQ4rEb60JXH95EgurJc= X-Received: by 2002:aca:c311:: with SMTP id t17mr1528797oif.169.1586477524193; Thu, 09 Apr 2020 17:12:04 -0700 (PDT) Received: from ubuntu-s3-xlarge-x86 ([2604:1380:4111:8b00::3]) by smtp.gmail.com with ESMTPSA id 186sm307290ooi.30.2020.04.09.17.12.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Apr 2020 17:12:03 -0700 (PDT) Date: Thu, 9 Apr 2020 17:12:01 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Jian Cai , Masahiro Yamada , Manoj Gupta , Peter Smith , Stefan Agner , Sami Tolvanen , Ilie Halip , Jian Cai , Russell King , Arnd Bergmann , Linus Walleij , Andrew Morton , Mauro Carvalho Chehab , Doug Anderson , Benjamin Gaignard , Bartosz Golaszewski , Masami Hiramatsu , "Steven Rostedt (VMware)" , Greg Kroah-Hartman , Tejun Heo , "Joel Fernandes (Google)" , Patrick Bellasi , Krzysztof Kozlowski , Dan Williams , "Eric W. Biederman" , David Howells , Linux ARM , LKML , clang-built-linux Subject: Re: [PATCH] ARM: do not assemble iwmmxt.S with LLVM toolchain Message-ID: <20200410001201.GA15303@ubuntu-s3-xlarge-x86> References: <20200409232728.231527-1-caij2003@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 09, 2020 at 05:01:33PM -0700, 'Nick Desaulniers' via Clang Built Linux wrote: > On Thu, Apr 9, 2020 at 4:28 PM Jian Cai wrote: > > > > iwmmxt.S contains XScale instructions LLVM ARM backend does not support. > > Skip this file if LLVM integrated assemmbler or LLD is used to build ARM > > Hi Jian, thank you for the patch. It's pretty much spot on for what I > was looking for. Some notes below: > > s/assemmbler/assembler > > :set spell > > ;) > > Also, could use a link tag, ie. > > Link: https://github.com/ClangBuiltLinux/linux/issues/975 > > (Always include the link tag to help us track when and where patches land). > > Finally, I think the hunks for the two different files should be > split; the init/Kconfig change should be it's own dedicated change > that goes to Masahiro, the maintainer of the Kbuild tree. Then when > we have that, the dependent configs should go separately. Would you > mind splitting this patch in two, and re-sending just the Kbuild patch > for now? Since you used Sami's patch for inspiration > (https://github.com/ClangBuiltLinux/linux/issues/975#issuecomment-611694153, > https://github.com/samitolvanen/linux/commit/fe9786cb52a0100273c75117dcea8b8e07006fde), > it would be polite to Sami to add a tag like: > > Suggested-by: Sami Tolvanen > > or maybe better yet, take Sami's patch, add your signed off by tag > (maintaining him as the git author, see `git log --pretty=fuller`), > then rebase your AS_IS_CLANG hunk on top, make that a second patch, > then finally have the arm change as a third patch. > > This change is exactly what I'm looking for, so these are just process concerns. I think that they can be sent as a series that is picked up by Masahiro with an ack from an ARM maintainer. > > kernel. > > > > Signed-off-by: Jian Cai > > --- > > arch/arm/Kconfig | 2 +- > > init/Kconfig | 6 ++++++ > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > > index 66a04f6f4775..39de8fc64a73 100644 > > --- a/arch/arm/Kconfig > > +++ b/arch/arm/Kconfig > > @@ -804,7 +804,7 @@ source "arch/arm/mm/Kconfig" > > > > config IWMMXT > > bool "Enable iWMMXt support" > > - depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B > > + depends on !AS_IS_CLANG && !LD_IS_LLD && (CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B) > > default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 || CPU_PJ4B > > help > > Enable support for iWMMXt context switching at run time if > > diff --git a/init/Kconfig b/init/Kconfig > > index 1c12059e0f7e..b0ab3271e900 100644 > > --- a/init/Kconfig > > +++ b/init/Kconfig > > @@ -19,6 +19,12 @@ config GCC_VERSION > > config CC_IS_CLANG > > def_bool $(success,$(CC) --version | head -n 1 | grep -q clang) > > > > +config AS_IS_CLANG > > + def_bool $(success,$(AS) --version | head -n 1 | grep -q clang) $(AS) is being replaced with $(LLVM_IAS). That line should be: def_bool $(success,test $(LLVM_IAS) -eq 1) I think. That depends on a commit in Masahiro's for-next branch [1] so it should be based/tested against that. Otherwise, I agree with Nick's comment about being split into two patches (one for the init/Kconfig change and one for the ARM change) and adding the Link tag. I ran about 75 randconfigs with LD=ld.lld and LLVM_IAS=1 and I did not see any Kconfig warnings from this and CONFIG_IWMMXT was unset in every one. Should prevent the errors that you encountered. Feel free to apply the following tags to any follow up revisions. Tested-by: Nathan Chancellor # randconfig Reviewed-by: Nathan Chancellor [1]: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git > > +config LD_IS_LLD > > + def_bool $(success,$(LD) --version | head -n 1 | grep -q LLD) > > + > > config CLANG_VERSION > > int > > default $(shell,$(srctree)/scripts/clang-version.sh $(CC)) > > -- > > -- > Thanks, > ~Nick Desaulniers > Cheers, Nathan