From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EB20C4320A for ; Fri, 30 Jul 2021 00:19:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A9A560FE7 for ; Fri, 30 Jul 2021 00:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235411AbhG3ATX (ORCPT ); Thu, 29 Jul 2021 20:19:23 -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-Google-Smtp-Source: ABdhPJwWmH5ArkOIqPVwVZuQtBaUrWYJbCFYb7NadmZtZmLpwGWzD5SzE0Mjkl/u0ZFGg6RB4CGp6ZdoGY6dQ1gaIvU= 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