Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2731843pxp; Tue, 8 Mar 2022 00:09:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKz07m3O+mMp9U0fMEJTDxzW/maF8dRCu5zUrHup4mbUF6oKZysy0uMoosiklRfCRzveWH X-Received: by 2002:a17:902:b94c:b0:151:cd93:ec85 with SMTP id h12-20020a170902b94c00b00151cd93ec85mr16319549pls.76.1646726986370; Tue, 08 Mar 2022 00:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646726986; cv=none; d=google.com; s=arc-20160816; b=EImTctrCjZjCeOwl6V/EVwAI73Vsr7FLiwIad0GB89Kk4U8J9ow+dSvx8uuFtQOYvm ekOyLoLsJo8P4Zk62RHpuLG3LMxn6vsTx6L/xOoFCBKkbGsA+0XlOhHjDFS1arvfvoFd xMQp6DjkvyodN5kRcBFSx+7H2oCadegFmz7hN4vG1GiraAvoZ9gzmn3LF6PW0c87Iitz RPrlQT+KT2uPN/OlMA/wbfIGceSkIbmb5aKf/b3egBMCkQVYXRhhGnwbrrOosPDWJ5Kc AOnDP7hZVLWCYiipeJnsbxoQlo33Ps4xCQ72UuFFCGbsg9fWWHYNYqokSoEdWVIZkbAR YDqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lqdFcj/W3ROtaaLGNZJbzsf9vyM2NVPkSBm3INx+BLs=; b=mVW7VIrye/2uaFN7ztGN1qJ5m/VP8X+fYoDNEEZNW5COm5BPlnTBYI6TWBeJWrGgDB CPYjVgvAjR2j+h2JnadRIzR2vgceQIjl8wo6lZg2dkjNj+y4vQQ+tiw4JTD46qitydlE E6wqjHrsTw+7sjOved86yBXJb4cxlLRhWIDggBXUnnJoBW93PAW2RHiOHDKBNxPWp1HS eDHBYlsR/axLpKhNsFDpBZvtvS8kXhY5kBFgRoy7a5NO/vgau67nconkx/mALs7WjPIE 1Mn1P/Fi1uV3cEo+WbRCddme+0HPFgYaRcADV+41FInRjOPGWR5aipn6dxHyZHMKwys0 ENsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rfR0JcG6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a63c114000000b00373cc1ad7ebsi15475813pgf.546.2022.03.08.00.09.32; Tue, 08 Mar 2022 00:09:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rfR0JcG6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243291AbiCGTJn (ORCPT + 99 others); Mon, 7 Mar 2022 14:09:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238048AbiCGTJk (ORCPT ); Mon, 7 Mar 2022 14:09:40 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B72BE1AF1F for ; Mon, 7 Mar 2022 11:08:44 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id 25so8315035ljv.10 for ; Mon, 07 Mar 2022 11:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lqdFcj/W3ROtaaLGNZJbzsf9vyM2NVPkSBm3INx+BLs=; b=rfR0JcG6nuRaVIkXXgGAegektp5HSFDVUF91VlM0HcyOauIq6tLbs7wauxENXC0btb p8y1dXe10FP3m4bn7GIwnpvC6FX6LCWi8n0s3OsVBh5zR2vtqauwBqooPEyXFXPwsIXI 62bdrmK25fNTgDZg8wJzs40LnOGNLG1en3+O2YHwTaLzbIVSg/0cJQFsDDU6mwqDgdRq 8VIfwpxBj8u6NEY7gT9YpRSH4XlxawGUuOk2T4WsVMqRa405CTVD4rzPmUfb9jJIWnOH v5czkolhWUGk6Kk7sv9Vye1CuebzWG4LHHYshIxfssyFSMc2MP+BlO+5ww1BiNEr34zx gkKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lqdFcj/W3ROtaaLGNZJbzsf9vyM2NVPkSBm3INx+BLs=; b=57TkGAHQQ8XD6B2DOPG0lhyG3ltDeZ13nov0gh8pI+8Subp5EkCUn1awIgIP/gA6wd SnYCmUlrI2CrZs+bpAhE0POhZu/dQfinfRmOPLShh+IuFPpihL8T6GPm9++EkA8ThcOu +1WdlQe1QoW0feezFbIGjNnpsuaFLArPdByjYXhGrZw164LYrNe0Xh66bB1zCIN7UP4z M+oTM6HIeLLGY220gHDhTeH1Eh98GsfORNqoGs0U5vkPGLaxKQUsAKJIw18w+eW6hBYD RvDom5HIr/e9wllHIZASZMVXjeAI2oszPW5yGuFQFcwhkJsXyWYzT1eGDYmV6fUDaE1l sO8Q== X-Gm-Message-State: AOAM530biQGDhQMWwzjwL2L1BuYOXro7rw6i7ztY4tkv5n+PAk+U0lB5 x8dpfkumN5n6YmSlSJNFxaPcrSkG4+ucIyaH12ydpQ== X-Received: by 2002:a05:651c:1542:b0:233:8ff5:eb80 with SMTP id y2-20020a05651c154200b002338ff5eb80mr8416360ljp.352.1646680120998; Mon, 07 Mar 2022 11:08:40 -0800 (PST) MIME-Version: 1.0 References: <20220304170813.1689186-1-nathan@kernel.org> In-Reply-To: <20220304170813.1689186-1-nathan@kernel.org> From: Nick Desaulniers Date: Mon, 7 Mar 2022 11:08:29 -0800 Message-ID: Subject: Re: [PATCH v2] kbuild: Make $(LLVM) more flexible To: Nathan Chancellor , Masahiro Yamada Cc: Kees Cook , Shuah Khan , llvm@lists.linux.dev, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Peter Zijlstra Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 4, 2022 at 9:14 AM Nathan Chancellor wrote: > > diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst > index d32616891dcf..68b74416ec48 100644 > --- a/Documentation/kbuild/llvm.rst > +++ b/Documentation/kbuild/llvm.rst > @@ -49,17 +49,36 @@ example: :: > LLVM Utilities > -------------- > > -LLVM has substitutes for GNU binutils utilities. Kbuild supports ``LLVM=1`` > -to enable them. :: > - > - make LLVM=1 > - > -They can be enabled individually. The full list of the parameters: :: > +LLVM has substitutes for GNU binutils utilities. They can be enabled individually. > +The full list of supported make variables: :: > > make CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \ > OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf \ > HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar HOSTLD=ld.lld > > +To simplify the above command, Kbuild supports the ``LLVM`` variable: :: > + > + make LLVM=1 > + > +If your LLVM tools are not available in your PATH, you can supply their > +location using the LLVM variable with a trailing slash: :: > + > + make LLVM=/path/to/llvm/ > + > +which will use ``/path/to/llvm/clang``, ``/path/to/llvm/ld.lld``, etc. I don't think we should do this; `PATH=/path/to/llvm/ make LLVM=1` works and (my interpretation of what) Masahiro said "if anyone asks for this, here's how we could do that." I don't think I've seen an explicit ask for that. I'd rather LLVM= have 2 behaviors than 3, but I won't hold this patch up over that. Either way: Reviewed-by: Nick Desaulniers > + > +If your LLVM tools have a version suffix and you want to test with that > +explicit version rather than the unsuffixed executables like ``LLVM=1``, you > +can pass the suffix using the ``LLVM`` variable: :: > + > + make LLVM=-14 > + > +which will use ``clang-14``, ``ld.lld-14``, etc. > + > +``LLVM=0`` is not the same as omitting ``LLVM`` altogether, it will behave like > +``LLVM=1``. Hmm... I can see someone's build wrappers setting LLVM=1, then them being surprised that appending LLVM=0 doesn't disable LLVM=1 as they might expect. But Masahiro says let's fix this later which is fine. -- Thanks, ~Nick Desaulniers