Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp798842pxt; Thu, 5 Aug 2021 11:59:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUCv4SBQjbRIvIqKQ006OmzhcgrsilO4Q+8JM55P+uxKVI2TpTJ6l+Go/xJ+7f9z3TAFtu X-Received: by 2002:a17:906:bc5a:: with SMTP id s26mr6290444ejv.11.1628189943515; Thu, 05 Aug 2021 11:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628189943; cv=none; d=google.com; s=arc-20160816; b=oYrj0RZ5okxmKPWgQKDzYtIAKoTMWnKBAMNQEuIDYutxHFrgSsfulHIgbBFC7KMUIg XlsnyLz1zGCMvq7iZKX3Ox4VzIwJ5QmMOFnGbKbLcuTt4E7VBzEQYkWfN8x/2ONagPL0 RaMSfYJVNlnw1v4D6ob4lQ4+Ic9Tvc03wXCTJMjzbLAyDBYqcV1QKIP3LgO/XptYPbuG AnjRtfiL4PCfb9z1+7U14aJZKUN5EyQxhkzoQf+4NPLT/lxXOB018Qt4tno1qEhYqXBI f0lHurWzjr2YjJ4IudH33OL3YQg0OILhYathgdFqMNg46eeCcXmJ1d4cyVqAb+YtMKKu 7b/Q== 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=yDxgi4QuDiLFwBjP43H0Okt4+DMON7aEHD6wSYhjwNE=; b=ILfgYi8xzGktIxi35plNZv6OrKXlylOcxY2J1AOd275t6hSrTScxWkYe5+bIEX4hgX ReC8O+5gCEWli6NBpMCENIHOgpWbS+tjPQ5yGQoJnObzE8hmu99JuouPfmsRUM+uQpO5 6/a9f+c0+jgaUgzmwRwlsRj6dplEtxjvq3A1y3hPHyadxm5TBXaGGzBgzrTHciHsKgJ1 pO0PdDoeK6fF3ZYkcngrg765PT6whl0x5ZUKJ0Jbytmy9lFPkvlr4iRZBn81bYtFdfdr r+iTljYgDnOGWC8L0+1QV+FGM3WMDWFgZGlj+URrqCWRdPGzGn3YL+jFAVNdRwLWEa/U 6tuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xduq6v10; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci15si6693563ejb.363.2021.08.05.11.58.39; Thu, 05 Aug 2021 11:59:03 -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=@gmail.com header.s=20161025 header.b=Xduq6v10; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241703AbhHEPT0 (ORCPT + 99 others); Thu, 5 Aug 2021 11:19:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236413AbhHEPTY (ORCPT ); Thu, 5 Aug 2021 11:19:24 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DEF2C061765; Thu, 5 Aug 2021 08:18:56 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id w197so5286168qkb.1; Thu, 05 Aug 2021 08:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yDxgi4QuDiLFwBjP43H0Okt4+DMON7aEHD6wSYhjwNE=; b=Xduq6v10TZWlZnR8DNL7gSIN7evZHrm8YOqzcBT+ypQvSa6T4lGMk0xX1xDkDPDobT q96qIfSdd2eA/C0BRG0ghA5rQNW8S86ZBXpfWxHx+Fr6rq3IAsZjK/aopxU6gZkD9S4L dzQRGSJP1EktNKnO5Y7f1GpaWgDbxfXC+C2yAZH7VDz40jNtJS9ZoHcdAN5WWpvL9+sn a3im5uNFMjEXG7R909CG62KD4ruCsziZkYBXT0V6XJH8cSVvsdrzqr5tjfsm9GKH271U PwgKZ5SRLz2CZRm1MDBGC2/hL1VQK0fl3ni026MoyiV2ZO6ZTBCSvKKlztIktMyzl6qb UgcQ== 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=yDxgi4QuDiLFwBjP43H0Okt4+DMON7aEHD6wSYhjwNE=; b=DuHMTzGK/J5ImM8k9uYE8FiVzRzCclPPyA+n3crtd+2xIh42PX3AE6j0+99eEWfsyO xcIfyVYe7hRAxUhtb74RS9HbSO9ETPHUfyM1RTc1F9ggweZLZtef7/2w0poOfmFScIm4 V6cqp3Vmo0eX3cXpKgNXyHEKSUIlyZoo7SiZvUWhWaUCTsogcFo5q0PEfHri+xW1Gdyv kfLGOQQ8nxuEiXTAYsHs2ENuqSizZAGOYYM7PIl0qLUsfmcPViof4VFRWFltihdtf4CV sjihXi4JYjN52u0Db8O1dxfz46ezCNjUXT80WwL8QBUy3/zLI1zHW/uvOYAP2ipVoS6y Ue0g== X-Gm-Message-State: AOAM533YLYDcBKwjmse0b6RylYwJ+gDt4JyHjmvu3nzh7WMMvz4TPXH0 rd00Gjqj17MO1Xjzob6N04kaIoURwpsoK97Dnwk= X-Received: by 2002:ae9:f201:: with SMTP id m1mr5279060qkg.381.1628176735385; Thu, 05 Aug 2021 08:18:55 -0700 (PDT) MIME-Version: 1.0 References: <20210802234304.3519577-1-ndesaulniers@google.com> In-Reply-To: From: Khem Raj Date: Thu, 5 Aug 2021 08:18:28 -0700 Message-ID: Subject: Re: [PATCH] scripts/Makefile.clang: default to LLVM_IAS=1 To: Masahiro Yamada Cc: Nick Desaulniers , Nathan Chancellor , Michal Marek , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , clang-built-linux , Linux Kbuild mailing list , "open list:DOCUMENTATION" , Linux Kernel Mailing List , "open list:SIFIVE DRIVERS" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 5, 2021 at 8:16 AM Masahiro Yamada wrote: > > On Tue, Aug 3, 2021 at 8:43 AM Nick Desaulniers wrote: > > > > LLVM_IAS=1 controls enabling clang's integrated assembler via > > -integrated-as. This was an explicit opt in until we could enable > > assembler support in Clang for more architecures. Now we have support > > and CI coverage of LLVM_IAS=1 for all architecures except a few more > > bugs affecting s390 and powerpc. > > > > This commit flips the default from opt in via LLVM_IAS=1 to opt out via > > LLVM_IAS=0. CI systems or developers that were previously doing builds > > with CC=clang or LLVM=1 without explicitly setting LLVM_IAS must now > > explicitly opt out via LLVM_IAS=0, otherwise they will be implicitly > > opted-in. > > > > This finally shortens the command line invocation when cross compiling > > with LLVM to simply: > > > > $ make ARCH=arm64 LLVM=1 > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/1434 > > Signed-off-by: Nick Desaulniers > > --- > > Note: base is: > > https://lore.kernel.org/lkml/20210802183910.1802120-1-ndesaulniers@google.com/ > > > > Documentation/kbuild/llvm.rst | 14 ++++++++------ > > Makefile | 2 +- > > arch/riscv/Makefile | 2 +- > > scripts/Makefile.clang | 6 +++--- > > 4 files changed, 13 insertions(+), 11 deletions(-) > > > > diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst > > index f8a360958f4c..16712fab4d3a 100644 > > --- a/Documentation/kbuild/llvm.rst > > +++ b/Documentation/kbuild/llvm.rst > > @@ -60,17 +60,14 @@ They can be enabled individually. The full list of the parameters: :: > > OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf \ > > HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar HOSTLD=ld.lld > > > > -Currently, the integrated assembler is disabled by default. You can pass > > -``LLVM_IAS=1`` to enable it. > > +Currently, the integrated assembler is enabled by default. You can pass > > +``LLVM_IAS=0`` to disable it. > > > > Omitting CROSS_COMPILE > > ---------------------- > > > > As explained above, ``CROSS_COMPILE`` is used to set ``--target=``. > > > > -Unless ``LLVM_IAS=1`` is specified, ``CROSS_COMPILE`` is also used to derive > > -``--prefix=`` to search for the GNU assembler and linker. > > - > > If ``CROSS_COMPILE`` is not specified, the ``--target=`` is inferred > > from ``ARCH``. > > > > @@ -78,7 +75,12 @@ That means if you use only LLVM tools, ``CROSS_COMPILE`` becomes unnecessary. > > > > For example, to cross-compile the arm64 kernel:: > > > > - make ARCH=arm64 LLVM=1 LLVM_IAS=1 > > + make ARCH=arm64 LLVM=1 > > + > > +If ``LLVM_IAS=0`` is specified, ``CROSS_COMPILE`` is also used to derive > > +``--prefix=`` to search for the GNU assembler and linker. :: > > + > > + make ARCH=arm64 LLVM=1 LLVM_IAS=0 CROSS_COMPILE=aarch64-linux-gnu- > > > > Supported Architectures > > ----------------------- > > diff --git a/Makefile b/Makefile > > index 444558e62cbc..b24b48c9ebb7 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -845,7 +845,7 @@ else > > DEBUG_CFLAGS += -g > > endif > > > > -ifneq ($(LLVM_IAS),1) > > +ifeq ($(LLVM_IAS),0) > > KBUILD_AFLAGS += -Wa,-gdwarf-2 > > endif > > > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile > > index bc74afdbf31e..807f7c94bc6f 100644 > > --- a/arch/riscv/Makefile > > +++ b/arch/riscv/Makefile > > @@ -41,7 +41,7 @@ endif > > ifeq ($(CONFIG_LD_IS_LLD),y) > > KBUILD_CFLAGS += -mno-relax > > KBUILD_AFLAGS += -mno-relax > > -ifneq ($(LLVM_IAS),1) > > +ifeq ($(LLVM_IAS),0) > > KBUILD_CFLAGS += -Wa,-mno-relax > > KBUILD_AFLAGS += -Wa,-mno-relax > > endif > > > > Please drop these two hunks. > > I will apply my patch instead. > https://lore.kernel.org/patchwork/patch/1472580/ > > > > > > > > diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang > > index 1f4e3eb70f88..3ae63bd35582 100644 > > --- a/scripts/Makefile.clang > > +++ b/scripts/Makefile.clang > > @@ -22,12 +22,12 @@ else > > CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) > > endif # CROSS_COMPILE > > > > -ifeq ($(LLVM_IAS),1) > > -CLANG_FLAGS += -integrated-as > > -else > > +ifeq ($(LLVM_IAS),0) > > CLANG_FLAGS += -no-integrated-as > > GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit)) > > CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) > > +else > > +CLANG_FLAGS += -integrated-as > > endif > > CLANG_FLAGS += -Werror=unknown-warning-option > > KBUILD_CFLAGS += $(CLANG_FLAGS) > > > > base-commit: d7a86429dbc691bf540688fcc8542cc20246a85b > > prerequisite-patch-id: 0d3072ecb5fd06ff6fd6ea81fe601f6c54c23910 > > prerequisite-patch-id: 2654829756eb8a094a0ffad1679caa75a4d86619 > > prerequisite-patch-id: a51e7885ca2376d008bbf146a5589da247806f7b > > -- > > 2.32.0.554.ge1b32706d8-goog > > > > > When we negate a flag that is enabled by default, > which is a common way? > - set it to '0' > - set is to empty > > > So, I was wondering if we should support > not only LLVM_IAS=0 but also LLVM_IAS=. > > What do you think? always asking for 0 or 1 is perhaps better. > > > -- > Best Regards > Masahiro Yamada