Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4917903pxv; Tue, 20 Jul 2021 14:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw56kJdB3HNmGHe7naX1ayM0Goy/TkSCQpr2XbIZSn9vYiKNvBZYa5VsITEfvBzwirivF5l X-Received: by 2002:a05:6638:41a7:: with SMTP id az39mr28243801jab.52.1626816730589; Tue, 20 Jul 2021 14:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626816730; cv=none; d=google.com; s=arc-20160816; b=dk+OwsLyehG6D7/HjCiey8KXT0T7mmD+C37F2LVgQAEYxWHSZAFyAeCIgiOzuqPhDo pgoRHODNtbT5Xk5SIJPzRFWZ/oAC7Venqo0YiAHTQH56bx1FpyKzICS1C099LTwnhmcp eJ9dFg5Pt/YeiRhWg77hjcVac1BEHuh0NOq6IKxrCazTc3DffWhB8LrVtkHDv9FCgxfX dFQpGavRrmXpPCBn+qFYXO6oKUaUEDHUvF03O6Bf9APY8/VfXuEyho+6EOnDTDwFcgLS YshCFMgYysqHBJZd23F/ofHXH9/9TBLctQ8SbcvZ4iZ0acnhWqg0I2UFqEEcevHPAeI4 K/Cg== 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=lD7MSr2tHShwP24PsDQ+AQ045DheEanjMiBeVzyowZM=; b=iNTZXW1z4ORUzWYhTHe1izZDZvDC7kE4IxNDoDB+dPjEUxlCMWvbOwxY4/+zAh6tRS Ivm5WClHVeuFF1GgOlfU5YR2lk4cwDRb0+ov/qJcEQ8cKUvbOXcybrZRIf9yuRaRYtn4 JVRGv2ivEtIm/b+5B1n9AT/+hra9ZnF+wfht6jdxX50IhJUUen/RjFKGe3Fgqo4Hyoi7 1g2QAZXY49QzryQRwm2LJrZ9wzoGSC9rqRU7Px5v6CQ4TaR3ZBi7epFBPnuBPA6sapm5 uiU3sEO5IGXdjl1edSLo8dfaUjeUaUub0Zth3NaEhB47d4uLUI9dJjca54ARg5Jkf8o/ +fFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=V1vQhpEk; 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 w5si15391203ilh.139.2021.07.20.14.31.57; Tue, 20 Jul 2021 14:32:10 -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=V1vQhpEk; 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 S231627AbhGTUtb (ORCPT + 99 others); Tue, 20 Jul 2021 16:49:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231467AbhGTUtN (ORCPT ); Tue, 20 Jul 2021 16:49:13 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA0E3C061762 for ; Tue, 20 Jul 2021 14:29:47 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id e14so249980ljo.7 for ; Tue, 20 Jul 2021 14:29:47 -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=lD7MSr2tHShwP24PsDQ+AQ045DheEanjMiBeVzyowZM=; b=V1vQhpEk0nUsfOn4JiW4a32yiqit8hnxNX8BpCSbJi8H1nLmRPdqpupHi3VLsfwDNq KC1UZap1tiEKAda3Lre4Ew+fUaQgN2M3Gp79qdhjjje2HPrUgZ/8i+6T40p6gkTjwftW CZudVHWWpuz3VjviDdQzffdJ+7DS5iB2Pjy09Kd3FRjKYJxE/+ecdC0L/N+hH3qTG4Ey mwOPbrvidz9LL8rCluTRyTTkfQLRfge6+FRY/0/jSFgaId0VJi0zqM3/SQeEvXFr6uDf EuwrKROyGHF1BFxtFUyEHgG54uHnQDud0pgFqVhPnWT/rXBA3f6i6HUa1+SY0fqCsSv4 TzDA== 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=lD7MSr2tHShwP24PsDQ+AQ045DheEanjMiBeVzyowZM=; b=QDbJbeedCs005nX6wqDOnYZfZMICuhyoUMsPUPPnzbYm3nMgUqxksl3cMtSeOZssyo xdEYuwwqPCblPYE50CQQj+82FZzmTYX2MecBSRUmLaw2Xc/f2751pjHMyZVJE+cJaYh/ X0eNFjDzeiQckkNuvj36IyXyce6/6WjtOdZCEvC9RImihLCQBV6aEFKFjs98N/Nve+AW zWCK9xuUf5ZmMbl3aC7/KVNXJS7Lz3UhvlGWTeL/tLhQ9xgqApM3G3Hfl4at0ouqxsks VBc5E2LZL2cyCFowW9TEF/tIkfVBGUvluxK+hPVjWmL3MwjTJsYgZSYn8tC3ighxg3rr I18w== X-Gm-Message-State: AOAM530+2SV6v6MDlar/We9ElyFQGXlx5xmzpP1TQGm5DiytS61A34R4 XYhZYaNbW1vaeI6wyPIJP+A5nLFyEuDwz+VULxMIHQ== X-Received: by 2002:a2e:a911:: with SMTP id j17mr28176107ljq.341.1626816585818; Tue, 20 Jul 2021 14:29:45 -0700 (PDT) MIME-Version: 1.0 References: <20210708232522.3118208-1-ndesaulniers@google.com> <20210708232522.3118208-3-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Tue, 20 Jul 2021 14:29:35 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] Makefile: infer CROSS_COMPILE from SRCARCH for LLVM=1 LLVM_IAS=1 To: Linus Torvalds Cc: Masahiro Yamada , Miguel Ojeda , Fangrui Song , Michal Marek , Arnd Bergmann , Linux Kernel Mailing List , Linux Kbuild mailing list , clang-built-linux , Geert Uytterhoeven , Christoph Hellwig , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 20, 2021 at 10:43 AM Linus Torvalds wrote: > > But clang has become a primary compiler for some kernel communities, > and I think it might be time to just re-visit that entirely. > > In particular, I think we should just make it a Kconfig option. I hate > the command flag stuff so much, that my clang tree literally has this > patch in it: > > -CC = $(CROSS_COMPILE)gcc > +CC = $(CROSS_COMPILE)clang > > so that I can just do the same "make -j128" in both my gcc tree and my > clang tree. > > But each build tree already has its own .config file, so it would be a > lot more convenient if that was how the compiler was chosen, and then > "make oldconfig" would just DTRT. > > We do most of the other heavy lifting in this area in Kconfig anyway, > why not add that compiler choice? > > Obviously it would be gated by the tests to see which compilers are > _installed_ (and that they are valid versions), so that it doesn't ask > stupid things ("do you want gcc or clang" when only one of them is > installed and/or viable). > > Hmm? So then any "LLVM=1" thing would be about the "make config" > stage, not the actual build stage. > > (It has annoyed me for years that if you want to cross-compile, you > first have to do "make ARCH=xyz config" and then remember to do "make > ARCH=xyz" for the build too, but I cross-compile so seldom that I've > never really cared). > > Let the flame wars^H^Hpolite discussions ensue.. I will concede that "why do I need to respecify all of my command line args/env vars to make when I already did so for a configure step?" is a reasonable question to ask, and may be worth pursuing. There's still some that we can eliminate for BOTH configure and actual build, like CROSS_COMPILE. :^) -- Thanks, ~Nick Desaulniers