Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp7025925pxv; Fri, 30 Jul 2021 08:17:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbfT692GFzZ3G+94dAlkD87fD5FX5N2meuTxdZqZls63+FQeJlK6O36gZ4iT0xJfljrK8x X-Received: by 2002:a05:6e02:50c:: with SMTP id d12mr1596909ils.256.1627658265307; Fri, 30 Jul 2021 08:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627658265; cv=none; d=google.com; s=arc-20160816; b=Pw8HoV/u9vrlEe0UWl80JdLD4f60G1iaV1mHMNL7zJo9mVBiWGzDihwC+lK5/pgjrp BqBcU2F2hGpDYV6Y+ltqVCBHlWuzyGpWDnyM4S4xUsSabgKLMsos+H+R1aGJfb2RC7pM faBwWRdb9lo3FE78EObyRjPsif+FJcH6GYY319TAEO6Lii5RNrAmKHt+GjETPkJBsv68 6tgJpAv54lbTRKLa+C3posw1i5TScl/pIHmgzHkAJNiYK/0WdkLFgogZgstkk3czAirF Se02bGxeLkll7sa+rSR/FeGULnHWUdhyKJSzEJ0HJvchd0rfLTntjyPVq70IEek7Clla YOzA== 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:dkim-filter; bh=rwXESo6Zwmg+wSRT6LqVZ2Q5mAY+xa2YCUP4gKaEPA0=; b=x/qRzbQKkE9DEbyYB1CloJYaCDx+tD9Xr6HtYk4xxr0Mn9FY+Mpb3OZdAxsR4ebVWe 2qNElxUrdA7ynTNp/OlsKSzTZ+avjDg3FOPA4IDIjnpxa4aNQ/FCuLVUr9zsIeZDByfo 0D4nGzWEMJDyKuSynAQWTN4gupRvVrIHabynW/+GzdLpvVGfl2T5CBWHwWbNwbJGgld8 +b/5xFDWm4bWj5+15m7IToA4R70UlPtIDxeIqjn5LzX5AK4gag3wsEYogjyKGf2q35ds vo3WffgrdGIvQDA679/L1vr6FI7cFFHligttXw94sdKE5+xqmVVsBa8IAoBp/oc+Ji+6 mG6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="t+XmJm/I"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si2290642iov.66.2021.07.30.08.17.31; Fri, 30 Jul 2021 08:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="t+XmJm/I"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239521AbhG3PQW (ORCPT + 99 others); Fri, 30 Jul 2021 11:16:22 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:34597 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239248AbhG3PQV (ORCPT ); Fri, 30 Jul 2021 11:16:21 -0400 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 16UFFxvG029442; Sat, 31 Jul 2021 00:16:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 16UFFxvG029442 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1627658160; bh=rwXESo6Zwmg+wSRT6LqVZ2Q5mAY+xa2YCUP4gKaEPA0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=t+XmJm/IJ7HTRTTYuc07Zz8yHH8uBUb85TrY/OcfMiLhbekNAni5sjb4KEbM6iRAE 86n06tGO1UJQFNtgLFQo5WdRiU+ZLSSBVvn1x6I1oMup+QA8FTvDa9OXMvCLNXsIFH g2GcX7qrMeE9ZgE3+y0oXEwQXohARUPIvWBv1HB4jRuQMlrMkJ86J8M9Souu3OegsN gpRsysAN/ofpWnhRcywOmNrh0uzgtyNFamthEV+lCXH3b/SvQo6MnfqansiTuwxZoa LA+AP+N6Y5/OpWW1EhtxNbjbOIcKWnn+Pcd38VoIsHr/dNGVvXqb1xCnb3EUm5ygSb 8bjrLxNgw6W7A== X-Nifty-SrcIP: [209.85.216.50] Received: by mail-pj1-f50.google.com with SMTP id q17-20020a17090a2e11b02901757deaf2c8so14924608pjd.0; Fri, 30 Jul 2021 08:16:00 -0700 (PDT) X-Gm-Message-State: AOAM530u5Q3KT+wGlPdTXeSzW6fX5XjXboaI2GpqGRKzfAA5UAC4eipF 1kSOg+s9+LV/9z1FZkchSwyro+SnMO88r/kOhTU= X-Received: by 2002:aa7:8593:0:b029:32b:c173:cd96 with SMTP id w19-20020aa785930000b029032bc173cd96mr3341045pfn.63.1627658159170; Fri, 30 Jul 2021 08:15:59 -0700 (PDT) MIME-Version: 1.0 References: <20210729165039.23896-1-ndesaulniers@google.com> <20210729165039.23896-3-ndesaulniers@google.com> <44117d0c-51b7-1f68-f752-ba53de503b14@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Sat, 31 Jul 2021 00:15:22 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/2] Makefile: infer CROSS_COMPILE from SRCARCH for CC=clang LLVM_IAS=1 To: Nick Desaulniers Cc: Nathan Chancellor , Miguel Ojeda , Fangrui Song , Michal Marek , Arnd Bergmann , Linux Kernel Mailing List , Linux Kbuild mailing list , clang-built-linux , Geert Uytterhoeven , Christoph Hellwig , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 30, 2021 at 9:19 AM Nick Desaulniers wrote: > > On Thu, Jul 29, 2021 at 2:00 PM Nathan Chancellor wrote: > > > > While I understand that the LLVM=1 LLVM_IAS=1 case works perfectly fine > > with this series, I am of the belief that making it work for CC=clang > > LLVM_IAS=1 is a mistake because there is no way for that configuration > > to work for cross compiling without CROSS_COMPILE. > > So with v3 of this change, rather than: > > $ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang -j72 > > If you wanted to omit CROSS_COMPILE, you'd need: > > $ ARCH=arm64 make CC=clang LLVM_IAS=1 LD=ld.lld OBJCOPY=llvm-objcopy > STRIP=llvm-strip > > or > > $ ARCH=arm64 make CC=clang LLVM_IAS=1 LD=aarch64-linux-gnu-ld > OBJCOPY=aarch64-linux-gnu-objcopy STRIP=aarch64-linux-gnu-strip or $ ARCH=arm64 make LLVM=1 LLVM_IAS=1 still works. > That's straight up worse IMO and defeats the purpose of "shortening > the command line," which should be the goal. Not "making CC=clang > maximally flexible." We don't want folks generally using CC=clang; > preferably they'd use LLVM=1. I need to rewrite our docs to make that > more explicit and straightforward. And if folks would prefer to use > CC=clang for whatever reason, let them explicitly state CROSS_COMPILE > then. > > So I agree with Nathan, and hope Masahiro will reconsider that perhaps > the v2 variant that required LLVM=1 maybe makes more sense. We can always infer the target triple from ARCH unless CROSS_COMPILE is given. Doing this all the time makes nothing wrong. "Whether CROSS_COMPILE is unneeded" is a different thing. > Either way, I need to fix the comment in the new script, commit > message, and docs, so v4 is necessary. > > I'm tempted to add a rewrite of our docs to say "just use LLVM=1" > front and center, then get into finer grain details below, moving this > second patch to be the third in a series. Let's see what Masahiro's > thoughts are though first. (I do appreciate them, even when I > disagree). I am not sure about that. LLVM=1 is a very strong all-or-nothing flag, but technically there is no reason to force it. (At least, target-tools and host-tools look independent to each other to me) When you send v4, one more request: Please drop LLVM_IAS=1 check as well. -- Best Regards Masahiro Yamada