Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2074826pxy; Mon, 2 Aug 2021 18:43:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwUsN4mRUHzZwHSFSGqVzxKw6z71jt2/sAOv1i7T0cRrsBnLBxBu46wB440JCGUtaMX6bM X-Received: by 2002:a05:6638:62c:: with SMTP id h12mr1469663jar.0.1627955033603; Mon, 02 Aug 2021 18:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627955033; cv=none; d=google.com; s=arc-20160816; b=zUT4Kxw0QwkhotGLT5cx34IhkBnC+A57fS0T0thBFW2KsjqDj9ZJHu6xUtbUYK1GvE pu4q6hnzeGm2ncYXPm5tSm1A61bd9lB4+UWX2BDLfIdC0CRTDKh/btgyaEsx6/hgBVyO D0eEn6IcuMisLH2HU5kGCDahxmQm5C2RrZPErYduTtpZ8GIvTFGkgNl4K+jZdX4ZhvWA FrE9A8eSQFzxGKaKarw71FGI7h8WAC8NYcZpbzthMwvdt8CbYfchL6YEICOdkrzv8pqk 99VqPCgGhRkhJM64mOTZ3Zsl8fEH47YBoPrfWu3GA3muHOB7wzap4pjq7cEMmoStWRnV w4cQ== 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=LhJekVuEhxikT2dkgVUERpPtmPxTduNhkA9B/Qb17as=; b=FfQhsFh1sQFddLt5fo6MktcYbpW6VuyDZX6tjPRSQpSYc+r2uyZ25zi6rkd4W5fcxt O/B4V7HNlK7uys8Hkn1ev0eQ0cS8ER8ldBwkYZuaI3lnM5T+XrqjZNLa9l+j58PhbqVJ eU0l6w15jv+igQ3VZ3D9IfsbBFId2EtHM+OC/pY+ppQXFW9K8nJjQCmf3BO00+LRHFpy rC1embA5F2XW5hAL4xWs2+F5LEIBiXztAxIMi6WX8TWKUPVvGH5YlSerI6OyzI0suY4A Glih+7UahceCK3QI2AONxi+NRBrkgcSbLMi0Ka6BZn30ui1w0eYRf5OfJDqZ6TF+/kas xdAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kIwwj3o6; 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 d131si20212530iog.11.2021.08.02.18.43.41; Mon, 02 Aug 2021 18:43:53 -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=kIwwj3o6; 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 S233394AbhHCBnE (ORCPT + 99 others); Mon, 2 Aug 2021 21:43:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232904AbhHCBnC (ORCPT ); Mon, 2 Aug 2021 21:43:02 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F14EC06175F; Mon, 2 Aug 2021 18:42:51 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id e14so1009625qkg.3; Mon, 02 Aug 2021 18:42:51 -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=LhJekVuEhxikT2dkgVUERpPtmPxTduNhkA9B/Qb17as=; b=kIwwj3o6wwPZAELE5SOdYKdHZcr3NRAwGCFmSnpNErgJ+e2yLyONsr4BLnqSNYYKuk V4dMPHCh11tp3NMkXn+fvrVhOK49hCLHBqpKp7MnnGb+cRnwASYIVWXi4+qlctt69x8C 6BBLBzLeP8b0vpRIvn7ozXGJ0RDUwbJDuC/NQe3TOJ7Vcip3M5Z5pI8i6OuuivSKd5q5 dTAFZIEq0hVIpVSR9a8ij7yAMERWrtBDsA4p0xfH405SrwC9JzSbFox0qtCoxzpAqFT6 /EEZ3vhWhJa68JLUWfn0P75ac0CpTf4UZwrLGWmAfJcoTg+pF9ZR4W0W/wb1/7dvpxdN dlxw== 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=LhJekVuEhxikT2dkgVUERpPtmPxTduNhkA9B/Qb17as=; b=Csx/TGMOhv/ZFuFXbU3MaXeO0TX5JLMfIJTO1TxumhRpZraat8NBaUzTp0AXa6h+w1 3wt5MJ1Q24v5PXkljTw3xEcagRW2uUOX2hfj+4lWykZnj9d0G7BqOVSJmrtwW88G+n36 9+lca99Cxn/pcGEaykqQy+ce37Ax+mIeDJW1eZ5LHJXy5GUm7QFq+0K+JXyOicZPsjGV 4Ta1Cpmkggl1IEPQ1720WKJnB3FInamxcMhVzkhKEhqgAsxbgt/4tWH/ZnTZjMMNC3yo O8dfh3lwvJLEgBdpZljN1GgiIrjODYsGIpxpUzb9WlRDRXB3npO5yxzNXJIpXwZT2dze B7ww== X-Gm-Message-State: AOAM530gOC6rtEoo577d9IJAYAzq6U6cRJuUwbIt1uBQJXNEB5a77/37 oM6ygDLIHMrEW/U+xrPPPJ0ssKAZCS7gHdqg1zM= X-Received: by 2002:a05:620a:109a:: with SMTP id g26mr19016731qkk.25.1627954970697; Mon, 02 Aug 2021 18:42:50 -0700 (PDT) MIME-Version: 1.0 References: <20210802234304.3519577-1-ndesaulniers@google.com> In-Reply-To: <20210802234304.3519577-1-ndesaulniers@google.com> From: Khem Raj Date: Mon, 2 Aug 2021 18:42:24 -0700 Message-ID: Subject: Re: [PATCH] scripts/Makefile.clang: default to LLVM_IAS=1 To: Nick Desaulniers Cc: Masahiro Yamada , Nathan Chancellor , Michal Marek , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , clang-built-linux@googlegroups.com, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 2, 2021 at 4:43 PM 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. :: > + I am not sure if LLVM_IAS should also impacts linker selection > + 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 > 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 >