Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3109422ybb; Mon, 6 Apr 2020 02:12:56 -0700 (PDT) X-Google-Smtp-Source: APiQypKvoDVNFwDoqX+gqXrZajA+tHWGR9BXWoTe3IZoQV3t+XwdDjMHBjhd9euwQlxliQU07p3m X-Received: by 2002:a9d:8e4:: with SMTP id 91mr17694084otf.130.1586164376770; Mon, 06 Apr 2020 02:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586164376; cv=none; d=google.com; s=arc-20160816; b=eQVwpwyjw1pmJV15kygo3acOgRYNPGb5e1ZWWK9tZWUtAMrCTR7i946k38Yr2M2evW qkiW5NZzV5zzE6RmbbXVsOSQ/8CuPAPh0fpRDVYeeFsBQE7nBnhYMtwpD/5S+LliwKJ7 3sON/UnzJmLJqhW8PyY29JO9e068HNsjRoowFVv0qyp8ztpttLjNkGBTGPQPn8cihKxK CZoDFSn8KKBbcMrdu0lpk22CuKUfFxqG8Ux1Si/3fWyZswT8dYBINjSOPfhhfQKmev5P 6MTQJzgn3NOtEhOcTWgMUGoe/ia46TQra7DeM5j3rU+AOM1+MYdPsPdLQpIWpRcieebd jSWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=glkaDM5M1FoM2GQRJ0fDDMF/MejHXymIl6X4UtEi45w=; b=he7ikzstItM8I6IDzwSnkYAdm4PVB6/4VWKu9SlBG5bqUV0he6wbKpzS76qagaTRZb rZw5gK7owzO8WXajAQrXtxtMZWskfx6PC+PL4/q3te/XK4QlBrMFPlsEWmi+ANAl6Ms0 Z2PRi45rJH7Zf9NGcgqaGM+XOwVmO9gybkbsRjZNCODg2h6MzxejQhTh33r/JvRg/3dY 9nKRQ5t5d4988wobJDjCMCbcbvpmnOTx1gYE/hpzV0CNSul+fWBxJw5Ni3H3h9ck4VMh r4UUUSv+T+aphQbcVRs/C7oOX4Luc6D+E8WetnR7PsJ7DzwQrmPG1YyhZp4jOE4/xegW 3l2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="hUr0f/B6"; 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 t11si7582908otp.314.2020.04.06.02.12.44; Mon, 06 Apr 2020 02:12:56 -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="hUr0f/B6"; 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 S1726861AbgDFJMW (ORCPT + 99 others); Mon, 6 Apr 2020 05:12:22 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39205 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbgDFJMW (ORCPT ); Mon, 6 Apr 2020 05:12:22 -0400 Received: by mail-wr1-f67.google.com with SMTP id p10so16476230wrt.6; Mon, 06 Apr 2020 02:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=glkaDM5M1FoM2GQRJ0fDDMF/MejHXymIl6X4UtEi45w=; b=hUr0f/B6PpAktI3a6eoaU1zTcfOcHxV89tvP0kcd8jZBbI7WT++ehVaWsh9HeIrZtG xuu1c3/b6aKj7y4S7ruK7DQjOBZcGxwIgUJkDaydRCD4JgcMvW7pfjXw4s3Oz2Eq68vi D+4DwMwsW86NI/dHuQZd5+25ZWJZ+ixQhGqrxnoHHCe1f50CodifbOg5k/bRpOry19D+ UD54aw4U8pfdtQ9v+19UqvUIuiwE/k9t9yJf+y1TCqQ9raRJdYvMS8YLvj/yGs6K0ATk OUbnPJUY3mkDGNK0zDUt1BEQfxs5pFBDHSN553zkHXpVfbgg8WuxYWP3DL4Q0sCfiNbo LfLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=glkaDM5M1FoM2GQRJ0fDDMF/MejHXymIl6X4UtEi45w=; b=fEPDOkpH585NibyKzLkQsQMM79nWQSLMvou6xqkcrtULgpgPqBkRWcp15ACi7g+W+P Qklbv+BvfY62XdBY+pDWfRV/gbX/diU9LpsCh/K5dmnMnGrV4POKcuKHVd7APqAWC7+4 GtbioIomSl99vXGnSQ4nhefMTrwrNEY18FGcR0H8taonLRXBC+J+J3vX8mk6UdM2ud5m gg3AlaqzLW2h4fFhjmZRPxa4gKjWpOV7qr5Ry46LVN5tNzfsUJoT2hqjFtGxD4DZkH0e ryUwZjB8R8hi5e1wR/WM5Z0P1K25LZm6dqZA8rSgrzmIafz1baOMK8+3ov54XYND+30M IMuQ== X-Gm-Message-State: AGi0PuZMXfmCWAPQ75I85tVflTsQvBI/K9p7P09wyq8vK3AfzHJ3c+ed 5cBni40z5OzEPi3HXdzEbRKyckXvmEf59DNoECU= X-Received: by 2002:adf:b64f:: with SMTP id i15mr3772042wre.351.1586164339736; Mon, 06 Apr 2020 02:12:19 -0700 (PDT) MIME-Version: 1.0 References: <20200403051709.22407-1-masahiroy@kernel.org> <20200405235507.psjjhqa3cxw57xra@google.com> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Mon, 6 Apr 2020 11:12:39 +0200 Message-ID: Subject: Re: [PATCH] kbuild: support 'LLVM' to switch the default tools to Clang/LLVM To: Masahiro Yamada Cc: Fangrui Song , Nick Desaulniers , Linux Kbuild mailing list , Nathan Chancellor , clang-built-linux , Jonathan Corbet , Michal Marek , Linux Doc Mailing List , LKML , =?UTF-8?Q?Matthias_M=C3=A4nnich?= , Sandeep Patil Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 6, 2020 at 3:34 AM Masahiro Yamada wrote: > > On Mon, Apr 6, 2020 at 8:55 AM 'Fangrui Song' via Clang Built Linux > wrote: > > > > On 2020-04-06, Masahiro Yamada wrote: > > >On Sat, Apr 4, 2020 at 3:24 AM Nick Desaulniers wrote: > > >> > > >> On Thu, Apr 2, 2020 at 10:17 PM Masahiro Yamada wrote: > > >> > > > >> > As Documentation/kbuild/llvm.rst implies, building the kernel with a > > >> > full set of LLVM tools gets very verbose and unwieldy. > > >> > > > >> > Provide a single switch 'LLVM' to use Clang and LLVM tools instead of > > >> > GCC and Binutils. You can pass LLVM=1 from the command line or as an > > >> > environment variable. Then, Kbuild will use LLVM toolchains in your > > >> > PATH environment. > > >> > > > >> > Please note LLVM=1 does not turn on the LLVM integrated assembler. > > >> > You need to explicitly pass AS=clang to use it. When the upstream > > >> > kernel is ready for the integrated assembler, I think we can make > > >> > it default. > > >> > > >> Having this behavior change over time may be surprising. I'd rather > > >> that if you want to not use the integrated assembler, you explicitly > > >> negate it, or just don't use the LLVM=1 syntax, ie. `make CC=clang > > >> LD=ld.lld ...`. > > >> > > >> We could modify how `-no-integrated-as` is chosen when LLVM=1. > > >> > > >> make LLVM=1 LLVMIA=0 ... # add `-no-integrated-as` > > >> # what the flag is doesn't really matter to me, something shorter might be nice. > > >> make LLVM=1 # use all LLVM tools > > >> > > >> Since we got rid of $(AS), it would be appropriate to remove/change it > > >> there, since no one really relies on AS=clang right now. (We do have 1 > > >> of our 60+ CI targets using it, but we can also change that trivially. > > >> So I think we have a lot of freedom to change how `-no-integrated-as` > > >> is set. > > >> > > >> This could even be independent of this patch. > > > > > > > > >I also thought a boolean flag is preferred. > > > > > >AS=clang will not live long anyway, and > > >I hesitated to break the compatibility > > >for the short-term workaround. > > > > > >But, if this is not a big deal, I can > > >replace AS=clang with LLVMIA=1. > > > > My mere complaint is that it may be difficult to infer the intention (integrated > > assembler) from the abbreviation "IA" in "LLVMIA" :/ > > > > Something with "AS" in the name may be easier for a user to understand, > > e.g. CLANG_AS or LLVM_AS. > > > > > I see 'llvm-as' in my PATH, > but it is a different kind of tool, right? > (converter from LLVM assembler *.ll to LLVM bit code *.bc) > > So, I thought "LLVM_AS" might be confusing. > Indeed LLVM_AS is confusing as llvm-as is different to Clang's integrated assembler. So CLANG_AS might be a better choice. - sed@ -