Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6522962pxv; Thu, 29 Jul 2021 17:22:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUBpjR2Hks3b7hHT5TU33cEL1sMY4phlStqSekyxlUj/8fvRkUk+GIYpxZKn7MnU8jJT/J X-Received: by 2002:a92:7f0f:: with SMTP id a15mr5568950ild.245.1627604533258; Thu, 29 Jul 2021 17:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627604533; cv=none; d=google.com; s=arc-20160816; b=rwSuylJ0ELV32cvoJAokPcwKzAyADoUYCstBESemECxBkA7gmdLIo5Be+Pbb6VOXq4 L/qikagtITseUHuVJGLFXSNKWWEwbv/LdStUeqMInUhBzU3nORpmd79S1klK255XiyqV LipCS9//tY2SbkjtZBHvLyfO6BqFiOxPqaI5Zx3AThYrlqwUKgVM+W/Z3fhKVx7yA+WS 0S1tYpcNmhAnQANESS+c9dP45vCgBnJfrUVnivj2pFU9HyOQPHVbD6jBEFzt4sgt1Z/7 79hm56S/aSc7unEwy9ZrjuUgvzicHsP0SAXHVbHrS+mh0/LiZhFT2PQgvKFETejoHHEQ GC0g== 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=sdWfDCJ/BnpSi88/sBE0t81V5bfAq7zpAMM0ZeL7bXw=; b=pxZDDy/Q7gORX/F6GbClPRhdqLJeBrvmIBMshlD+CYNrn4RBEXunmm0m2XFs9jsvhz cWLIN0npkptI8xJmXd7gs5oSALOOnzM42JsRaAQviODiiWdHubeab9JZo8+gxpwKCYA5 JbPNaxLKTvu4OKwwPBag8baVtf+wUQJa3TRHrQRfKgnan949AqLRFMuV71qIQ1x6YHvY GW40kNB9TnXaA+sSc0xdUsB1X2jj1ts/dLu7EqA/hhySbUfdA4UcuTHY63oQJvGoyCvL xeslUFwDi5fGkzqUmtVl0lcQOFEexG5deEIMlhPlYFIKvoE0xkViD0uRJVaPJGkAWrkj iWwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BALfDfaI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si5852129ilu.13.2021.07.29.17.21.59; Thu, 29 Jul 2021 17:22:13 -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=@google.com header.s=20161025 header.b=BALfDfaI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235214AbhG3ATW (ORCPT + 99 others); Thu, 29 Jul 2021 20:19:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235353AbhG3ATV (ORCPT ); Thu, 29 Jul 2021 20:19:21 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB442C0613C1 for ; Thu, 29 Jul 2021 17:19:16 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id b21so9795134ljo.13 for ; Thu, 29 Jul 2021 17:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sdWfDCJ/BnpSi88/sBE0t81V5bfAq7zpAMM0ZeL7bXw=; b=BALfDfaIU52dOkdhgi3958ygiyewSiZd/p8RdUrdIdjC7JUVLSCp9mAqns3CxtyQy2 5/3UMJlV79lCh6/AmihvIf0trZeBHtj0u1ZY/h/U7moLru0kPv1zQx0Y31kegPyqyAqL ufFEsb5tdT9yxFSQe7zP5D4pZ21JcFyXueEyrL637FX1N2n6E5boqpbioyyaNljfbFxM 7T6NbO2kcddZnJwbfeUfO4ooO6V2BSP9Wy/ilwC8qzfVklYMYIkaxzjVJfHQrmkhOdN2 4lf0lgsHQUCsgdReykUspUj9qS/jnLx39Fh/71sZM7S/8F9l3xrtYnFYAIYk9oetEiYe vdEw== 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:from:date :message-id:subject:to:cc; bh=sdWfDCJ/BnpSi88/sBE0t81V5bfAq7zpAMM0ZeL7bXw=; b=ZbqBneG4TQ3/QSRzvcZ5nzDyRGDGKT7G00n+NsDCHGKuIrbT2YKVI5QZQB4ngG1ZGZ A5IhkHAwhoj38FYhUqGmwanKrNri9g7N8G3n1nJFFQPs5hoBF1KpoM4RWkmtv0goM35K AyPltGth5RPUfmyi+pbtHlDraz02P5eQViAUxjZryLyTQXk1DZ/lHV7le3zMmZ3nkEdS NPefDgVFhodTG1e5O6kzjZBHuRS9v0bdNaPWdaWUDHedXa/HDcmEADHmxCTmhjDdnj8r MTxOp/mzcZV8SGElpjkQxQ/4xws6eqUj6PH5I3vqV8DfBfPqPMxwVGFiqqO11R1NvgO2 kImA== X-Gm-Message-State: AOAM53283SV2NerREBdmoKbDAlgoRcJxB+tVy83ss/iCxEkKcaN/02pw JJ4EEhySOxqVNSoEd5R76RFP0lJ53HOYZmaJ4JVYgQ== X-Received: by 2002:a05:651c:329:: with SMTP id b9mr4549340ljp.116.1627604354847; Thu, 29 Jul 2021 17:19:14 -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: <44117d0c-51b7-1f68-f752-ba53de503b14@kernel.org> From: Nick Desaulniers Date: Thu, 29 Jul 2021 17:19:03 -0700 Message-ID: Subject: Re: [PATCH v3 2/2] Makefile: infer CROSS_COMPILE from SRCARCH for CC=clang LLVM_IAS=1 To: Nathan Chancellor Cc: Masahiro Yamada , Miguel Ojeda , Fangrui Song , Michal Marek , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, 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 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 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. 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). -- Thanks, ~Nick Desaulniers