Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1996074pxb; Mon, 8 Mar 2021 11:13:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyq8bJ0/bNhX9Mc1BpcY6Ss6lk/8SoE5iV1exfm5ry0fRu/eNSwBA70wyfWP6bxGXVaoZTg X-Received: by 2002:a05:6402:1855:: with SMTP id v21mr97588edy.310.1615230803318; Mon, 08 Mar 2021 11:13:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615230803; cv=none; d=google.com; s=arc-20160816; b=Fl/wr8yBlye9SjdfXJWsdpcX8VM+vf7ujniBDcoZtQ5F4IYFH9gIOyqLwxHYntlUeZ JMOX+HfY9zHFY4a7YH/YwWalBsMnnCyWnP+rHzN3/Ivgtmjy8v5K8JcnknSWbFS03pUF 38l/GT2tMN/bUTzhjfOGEZ8Itozf4+VuwNQGNtlx2p/8hOJLlZ9D7KQF9r8NmHM2fZb1 rW0j67scyG3PUDjTo4pYZ0XMTm8OvMOeqO3Nt1EVq5e6leEnm6KSiOU8XtHTEDsnHYpD /vjqYwFXmx9b4cE9rl+yDS1Gafa5ePYvnKMlI9UCAr+PzMOfbwpVyYLz1w0R+nwCAA6z JkTg== 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=i+YqN6/BonSiVeAMXE6BrX07AcSfEu2bZuI4K6dyeGs=; b=Kx45sCW2H+pzOQE8kQTbs6GcUkHIzRv1zTKMkaBzu+SkrS9n7eJO8F406vnxTLF5gG 3sOeUaTLTfVtEbYJCho4/dt6EFVbroAUrsuICfjBI2xszK4JNhZgXas7UdQGWGrT3FRU Muz92vKahvBGBTi9puTqi0aaGweF1/iTKnkli09eP+wYDd7cUlwr27oHMkUMI6m8F7zu hOmMunGV1+J+bBilxSZjxhJGJiMWJiz7JE6q3jIXjaObuFc2uY1zcYF1ZW6ictTyr76a pbQ6EwAXeJeaLyn1f0vdbSLJd7zx7vSNXD9pTtH0eemJstowqT+j3g4FwRE+hNfUCcLZ dwyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tFRWlYBz; 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 x18si7303857ejo.233.2021.03.08.11.12.53; Mon, 08 Mar 2021 11:13:23 -0800 (PST) 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=tFRWlYBz; 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 S231156AbhCHTLr (ORCPT + 99 others); Mon, 8 Mar 2021 14:11:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230327AbhCHTLk (ORCPT ); Mon, 8 Mar 2021 14:11:40 -0500 Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68AE4C06174A for ; Mon, 8 Mar 2021 11:11:40 -0800 (PST) Received: by mail-vs1-xe33.google.com with SMTP id s8so5441730vsc.8 for ; Mon, 08 Mar 2021 11:11:40 -0800 (PST) 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=i+YqN6/BonSiVeAMXE6BrX07AcSfEu2bZuI4K6dyeGs=; b=tFRWlYBz4jdkgSvYUFFKinpnZ3qnIXEvIzqUU35H9pO1jXTOZwk8RP5RrRgFBeNEJv sAO470V+mT9+QqFSC8x2BZq9U5lR+ZlXRHRQv/rJEPEJvZzj7ZIuTTkddFZccZY9wQwy KXH8ouKYfrsPaZOTXgc/oMGxcefX66NNvbDBOdS5nbsoX0VjAKwPuLErSGCfumOb/u4M cysthcPnmqyBN+WGFLMu7IAkPecQZdLoHC8IW1Wk2WqNuuETiFuJW6HuewYBashgATr2 zJwMK7I52szFFGyrNJnEbIxKE0dlyepaDoWOiKIAhgmNk7ZOrM+Cmapbz7Rv7WGCsJNd blpw== 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=i+YqN6/BonSiVeAMXE6BrX07AcSfEu2bZuI4K6dyeGs=; b=Tfxk4xZDVQ7weWNReDshFodkPAz6SFTn3QEDwDNP81+EzLQiGQ6/prLcnqoElrOg71 3/EayYGFtf66w6fszrvryLIc+j/W00nh/eniYTi+iRuzAzNUFSJMU51Sl/Wo+/U5zOb+ CDlwkIhyLyhNNabNyYQpCsBzNaA/GWOKMNUTSgMsBmnQzf/3ynDOPvFqCa7aTB52InuA dGHXl0pWYABPaL4fpxB+n4io6UftAV0TNsdgsxT9eht2z2+ImR7kge7LoNlr9rqRTcMx 4029GNjlstX8Lx+GNUYao0cShje9otlwZyehIRefN3oZuMGtGFuVFmuAImy7tYgivOpu E5VA== X-Gm-Message-State: AOAM5321L06Rqo1CjuSl9i5Ce8IMINDLfeTX7b+qr/3zB50mcLLy9Pjl 7IFGxKFEyjiuwujaJKesLC24kasgk0Xw8wFljl8Dag== X-Received: by 2002:a67:5ec1:: with SMTP id s184mr13870317vsb.36.1615230699312; Mon, 08 Mar 2021 11:11:39 -0800 (PST) MIME-Version: 1.0 References: <20210303183333.46543-1-masahiroy@kernel.org> In-Reply-To: From: Sami Tolvanen Date: Mon, 8 Mar 2021 11:11:28 -0800 Message-ID: Subject: Re: [PATCH 1/4] kbuild: remove LLVM=1 test from HAS_LTO_CLANG To: Nick Desaulniers Cc: Masahiro Yamada , Linux Kbuild mailing list , clang-built-linux , Nathan Chancellor , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 3, 2021 at 12:47 PM Nick Desaulniers wrote: > > + Sami > > On Wed, Mar 3, 2021 at 10:34 AM Masahiro Yamada wrote: > > > > This guarding is wrong. As Documentation/kbuild/llvm.rst notes, LLVM=1 > > switches the default of tools, but you can still override CC, LD, etc. > > individually. > > > > BTW, LLVM is not 1/0 flag. If LLVM is not passed in, it is empty. > > Do we have the same problem with LLVM_IAS? LGTM otherwise, but wanted > to check that before signing off. > > (Also, the rest of the patches in this series seem more related to > DWARFv5 cleanups; this patch seems orthogonal while those are a > visible progression). > > > > > Non-zero return code is all treated as failure anyway. > > > > So, $(success,test $(LLVM) -eq 1) and $(success,test "$(LLVM)" = 1) > > works equivalently in the sense that both are expanded to 'n' if LLVM > > is not given. The difference is that the former internally fails due > > to syntax error. > > > > $ test ${LLVM} -eq 1 > > bash: test: -eq: unary operator expected > > $ echo $? > > 2 > > > > $ test "${LLVM}" -eq 1 > > bash: test: : integer expression expected > > $ echo $? > > 2 > > > > $ test "${LLVM}" = 1 > > echo $? > > 1 > > > > $ test -n "${LLVM}" > > $ echo $? > > 1 > > > > Signed-off-by: Masahiro Yamada > > --- > > > > arch/Kconfig | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/arch/Kconfig b/arch/Kconfig > > index 2bb30673d8e6..2af10ebe5ed0 100644 > > --- a/arch/Kconfig > > +++ b/arch/Kconfig > > @@ -632,7 +632,6 @@ config HAS_LTO_CLANG > > def_bool y > > # Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510 > > depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD > > - depends on $(success,test $(LLVM) -eq 1) > > IIRC, we needed some other LLVM utilities like llvm-nm and llvm-ar, > which are checked below. So I guess we can still support CC=clang > AR=llvm-ar NM=llvm-nm, and this check is redundant. I'm fine with removing the check, but the idea here was to just make it slightly harder for people to accidentally use a mismatched toolchain, even though checking for LLVM=1 doesn't stop them from doing so anyway. But yes, the only LLVM tools required in addition to the compiler and the linker are llvm-ar and llvm-nm. Sami