Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1638891pxb; Thu, 28 Oct 2021 07:25:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY7UfIiznPzxXD2HumBHbTK9CyTNNTUofXmhrOgndSTCINxYvjsesLVbdao3gSNDD3YCJz X-Received: by 2002:a05:6a00:a10:b0:412:448c:89c7 with SMTP id p16-20020a056a000a1000b00412448c89c7mr4590487pfh.83.1635431123670; Thu, 28 Oct 2021 07:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635431123; cv=none; d=google.com; s=arc-20160816; b=nqcSOzQ0KO8p+IzF0PNrOCZ4luvjioK6NQDyDSCGFuKYOMydiTeYdPHU7SsbvHLA5E ail/G5un5ShJQEZhjganbmVt8aEtVVAJMlG68efAJi+cwymqjsfxG8ES91HXsJzwHln8 RpX9VzjIETLdTwNtq6mPOzDi0ScCnZyu/IvNJ32uJMiVBj771vt/o+oppHsCoSTY90td Ba25ifA4Wh9BgJSS2ikw6xrnmtG4gyjcWkoUDUfWSwcpOJ83ny61SKcKEdEAvnCR3VLv 1u5ubcvbGnWdjc6wtEvcRvz4sFtu/xyi0YtgqTfW+bdAg4C+sNmDF4EUqnYFa0KsRi/E U0TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PPSmLuVzoHR88dVTU6Qg/HVOwGDGjDCbEwYUDZUaDlA=; b=R4pPP77PPBlDfSIuAZWJt77F5NB1Asb6xEvbgIzQzU4yTM4acoxIc6+R7O/Ew9eq3a ZEIF4dHr71jep6fZLJwDHYaHXm5+YcI/Xn/tSoWxzGpVHVv1bd9SH2XkTNgs+w4Kf09x 2KKC8srr2Wo6u35veAsxrsHRs+WrzwGuK79ASa/OrY9Jx8pYuwMpF6Z8aLYKinJ0kvsB LUhS/KsA5/4JjjZ+bxK50oiydlzlkAaCNiQsSZIbgak6zqWMTD/hFfpQLxUK/FJRdCBC mctV7wK1XcFwOGOwDju/4AXzhRFs5dRHU/1k7WYu4/ttzBSkoaoiJPsmY2a92LPIUg/g H5kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=EWmPWlMi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a24si3752944pls.254.2021.10.28.07.24.35; Thu, 28 Oct 2021 07:25:23 -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=@infradead.org header.s=desiato.20200630 header.b=EWmPWlMi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbhJ1OY4 (ORCPT + 99 others); Thu, 28 Oct 2021 10:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230265AbhJ1OY4 (ORCPT ); Thu, 28 Oct 2021 10:24:56 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4CD0C061570; Thu, 28 Oct 2021 07:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PPSmLuVzoHR88dVTU6Qg/HVOwGDGjDCbEwYUDZUaDlA=; b=EWmPWlMidK03/7dQpQxxc/qwdO QFoMaBSAyisgewIWeK58BjR12d/WSMKA1wwas528IOZsZX4b4com9WvWzq8Lg1jB+DhXn/KcO2czD DFiHfPluAaQnFr/0Unq0KXCP2T0p4qbz8r/uAyD3nfS/9JuaJemHXeLl3STIYEM1CZK5jJvzsxkuN HAl42zEMLvV9cNIPvsZI21dFrBY0Xhche5A3moxcI9Pc5rd+487f2PPXYLQQt+4JnCmZuRzlX5iv0 zjpbw8XSdI2BWODjnWpUg8Kd44B4wLlr7HGZjI79eWfFiO9YxkUsXCs8yJTFPdWkuGCDTGUwEBUxS qeP0TeXw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg6IR-00Cokj-0q; Thu, 28 Oct 2021 14:22:23 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A5B533001BF; Thu, 28 Oct 2021 16:22:22 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8961E203BE477; Thu, 28 Oct 2021 16:22:22 +0200 (CEST) Date: Thu, 28 Oct 2021 16:22:22 +0200 From: Peter Zijlstra To: Masahiro Yamada Cc: Nathan Chancellor , Nick Desaulniers , Michal Marek , X86 ML , Linux Kernel Mailing List , Linux Kbuild mailing list , llvm@lists.linux.dev Subject: Re: [PATCH] kbuild: Support clang-$ver builds Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 28, 2021 at 04:15:02PM +0200, Peter Zijlstra wrote: > On Thu, Oct 28, 2021 at 11:07:40PM +0900, Masahiro Yamada wrote: > > On Thu, Oct 28, 2021 at 10:44 PM Peter Zijlstra wrote: > > > > > > Hi, > > > > > > Debian (and derived) distros ship their compilers as -$ver suffixed > > > binaries. For gcc it is sufficent to use: > > > > > > $ make CC=gcc-12 > > > > > > However, clang builds (esp. clang-lto) need a whole array of tools to be > > > exactly right, leading to unweildy stuff like: > > > > > > $ make CC=clang-13 LD=ld.lld=14 AR=llvm-ar-13 NM=llvm-nm-13 OBJCOPY=llvm-objcopy-13 OBJDUMP=llvm-objdump-13 READELF=llvm-readelf-13 STRIP=llvm-strip-13 LLVM=1 > > > > > > which is, quite franktly, totally insane and unusable. Instead use the > > > already mandatory LLVM variable to convey this, enabling one such as > > > myself to use: > > > > > > $ make LLVM=-13 > > > > > > This also lets one quickly test different clang versions. > > > > > > Please read the commit log of > > a0d1c951ef08ed24f35129267e3595d86f57f5d3 > > That's yuck, I like LLVM=-13 or LLVM=-12 much better to select between > compilers. Means I don't have to remember wth they live and or wreck > PATH. Even better, why not do something like: if test "${CC:0:5}" == "clang" then LLVM=1 LLVM_SFX=${CC:5} fi Then we can simply use: make CC=clang-12 and have it all just work.