Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2848092ybb; Sun, 5 Apr 2020 18:41:10 -0700 (PDT) X-Google-Smtp-Source: APiQypIw8HoBKLHmN/uZ2j1y/zhNk/wjUDUbc/TWsros7XY1rNLEZVjupuJOblJuRfYRt18SEwTW X-Received: by 2002:aca:5454:: with SMTP id i81mr11475109oib.23.1586137269955; Sun, 05 Apr 2020 18:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586137269; cv=none; d=google.com; s=arc-20160816; b=YYftnvg9VeHS8OFu9lra00Th+S5oaWGXkoK9NuXFwYV38wAVLuTjWJwOf74ACThjzB /hX2MuKjitfhX3X9duVo50TPtG7D2D0qn9n0om8Zlt1iKOb2nPn58q32MWxOiN1rHmNa iLqEHtxsuoiUXWq4LEnjEHicG/lPipAsU2IYcmQBjwYERRt3a1W7p4uL+aHvIaTzHgZT InfvTg1D81uFyKYpUJSgZMBWiuWoR482akROQaMji63kSvkFG7A87/PCMvjkcLEJ2WXs WHt27dNIzyKurhKu1yI8EswwTXhgUQr9D2EFYoI7AQalw50rcQihCnNZ9rU5q+2nRNpE oBew== 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 :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=WggtXRihTH+Wz5QBc889jtnhJke76W/cxwCtqWHtd04=; b=nygMohItCTrBYIdfhJ+rwObm2+TKif3ZQoSlB7GVtFrLigrVCFu2g9eK0G+BDiu9tU 544QXakswNzAlH4IcL7WdBd25PeJ5k/4UTev9dKD3/FhsZkuRRjeSfbj8C8lMrdypO3q aPZngj+Zrf1om7cCuFq3i9ehV0fzV1+KwJoXhSzvtiZnvbpgFqvRFEHtClmSVuoB5KK3 3cApUzYHRQOLChJvitEBAfKNy9puwLoh6T0QlSJCHsG2d8t/RdBSXGDZGNucy7udkWuZ DDqGM3ZErYxu6ScAVWjn6vJpDVK+OdLx4RC64rONtLjSKjHzOkHD2jYZ1J+9uTqU5PEX MLrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=bMm9k1da; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h24si34217otk.62.2020.04.05.18.40.57; Sun, 05 Apr 2020 18:41:09 -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=@nifty.com header.s=dec2015msa header.b=bMm9k1da; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727905AbgDFBe3 (ORCPT + 99 others); Sun, 5 Apr 2020 21:34:29 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:16616 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbgDFBe3 (ORCPT ); Sun, 5 Apr 2020 21:34:29 -0400 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 0361YHe5027913; Mon, 6 Apr 2020 10:34:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 0361YHe5027913 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1586136858; bh=WggtXRihTH+Wz5QBc889jtnhJke76W/cxwCtqWHtd04=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bMm9k1daHMzkHhg5is8BX38kKAJ0WFkzJrfNeP7PlxYViVbSh9UoVN1GgB0CWjwMw rLDDLCR3SxHbP8ozgi+cCvc5mKLqPJYoz3LkgqTq6B6ZPVfL5nGBfDdIt2nIDarR19 7xi67pDvFe6z4VTK//Rej0c5xSMzp1HfrIs5YDFerlBrYM5Gi7VUWz8Qz6dZMjdfsj 0ZHLTqLKoNRbXj1hqWx0R6M5reDK7a2ozPZTfIjLhq+cDmebugCqKxyEo2k5zE4ibL z06lWpBcwMqkSEwIU2fUPXfGZVG6rKWzhxmoQw39Y52eUYkiPh2eZG008RhcFmDi32 7+L/HGdp/whPQ== X-Nifty-SrcIP: [209.85.222.43] Received: by mail-ua1-f43.google.com with SMTP id g10so4928788uae.5; Sun, 05 Apr 2020 18:34:17 -0700 (PDT) X-Gm-Message-State: AGi0PublqpKT37TTyTmIzrpjD7iCAb4EfKkT15zSBqrtN1n79zbAFrPL mTbwJXsZmr1Psg21gwTQb2zW0p4I9g12N496c+M= X-Received: by 2002:ab0:2790:: with SMTP id t16mr13453216uap.40.1586136856501; Sun, 05 Apr 2020 18:34:16 -0700 (PDT) MIME-Version: 1.0 References: <20200403051709.22407-1-masahiroy@kernel.org> <20200405235507.psjjhqa3cxw57xra@google.com> In-Reply-To: <20200405235507.psjjhqa3cxw57xra@google.com> From: Masahiro Yamada Date: Mon, 6 Apr 2020 10:33:40 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: support 'LLVM' to switch the default tools to Clang/LLVM To: Fangrui Song Cc: 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 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. -- Best Regards Masahiro Yamada