Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp884744pxt; Fri, 6 Aug 2021 16:57:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0YjEVUhCtUZgK5PEEfcGCIOF7e1qGXh+Ok5MCGqIfQfx2TL3msK3C2hGYg+X/XaOdGa1e X-Received: by 2002:a02:a40f:: with SMTP id c15mr12410994jal.38.1628294272068; Fri, 06 Aug 2021 16:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628294272; cv=none; d=google.com; s=arc-20160816; b=xDrLrPQZz9UsrHaOj5FfrwxtUKigKkt3onQDUcewAlpYmuhyv0zb554Cf8JWAWfRzb +CAO5MH1dvJP0onR7/W/VonIThPKgoGPzP9pLJC0kd5j8WfTXnIWnWa8w3xXh0wXvkj9 NJUTYDxrnF8N+5zkTMKuTJEin+AzlYdGBDo1alnFJRoA8NWsYlqzng1U7Cxp/doZJCsj FTb5x7A3u2u/8SDAYHfDrNWEl1+lwbUY5bTiQCxCwVe8idWplLiEybp/F+wBDPqU8jUb YGykO/xZ9tFcFl9oA5YQ0Y8J8UEdHESKDmqpZ7a8NPysO28imKFSq8x0YLLLVLsSB+qL aGig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=DsQFy/CzTnQXNoNOJwZLuGXsmdWykdOYnmIA1IAJYnI=; b=M2fg9wElKx0tvM0c/lh0eY6S1QVMcRmPAY8g6dn6ggOru9A0HUhwHGoKV/+G66pIHZ m1s5hBbeaQ7bHB3P+YCIpCfdY1psaAaiYTE9NY5684zYkoAffGAI+r5zCFu4t2nHOJ2m PH/yI/FFOzhtPONo+eUmh6IvXdKplofexuaSsTpvMRf4NU7EqiAYBWPhwcG/fyXmoLx+ AG70T5RhJj6ZjFcfcgJq6jnwlQK0SF4EWp1ZJVTD+Lc1GnJZD0CE0iwXeey3cf8HeD2w NC8Fos4wJgCiGOjwxMVTQgtJA5AosnFEPsnqNqf1AosQzikGB7de6D6ioWbW0g65d4B8 /aRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SLKP8QT3; 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 p18si10379353ios.10.2021.08.06.16.57.41; Fri, 06 Aug 2021 16:57:52 -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=SLKP8QT3; 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 S241173AbhHFR1Y (ORCPT + 99 others); Fri, 6 Aug 2021 13:27:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241152AbhHFR1X (ORCPT ); Fri, 6 Aug 2021 13:27:23 -0400 Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75E5CC061799 for ; Fri, 6 Aug 2021 10:27:07 -0700 (PDT) Received: by mail-qt1-x849.google.com with SMTP id h18-20020ac856920000b029025eb726dd9bso4625008qta.8 for ; Fri, 06 Aug 2021 10:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=DsQFy/CzTnQXNoNOJwZLuGXsmdWykdOYnmIA1IAJYnI=; b=SLKP8QT3UTFB+yk0MpS4S2ZYQEJh0gnI+gyTWPJzp356nk7gk9IXC4JqccWo2rsf3/ mxbffoWg83nR9QH0xUW3c93TAvFZeiOCwFnyBppdGNWSrkzG4zWhh3dKLn5YLuKXJbd9 Kxr9PqtKr7EAId4nMlv5kRVsG6V7G9nSeERVDXcCQeZGUpph8uOjFZYcZeihdrdHZ7sG Wijn7xnJJl2Uy1HwettgBfYqHN77gB3BnC3iKU7w8yZgCR0AKo4d/SJOJ/1AHNxoUB8h aEdlTKnQOo9Lyw3ZOZN+g7g29CTXQ76o0jFNXoZOkn8apGIHsDOeY6g/YqPyc8JegjGB qyfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=DsQFy/CzTnQXNoNOJwZLuGXsmdWykdOYnmIA1IAJYnI=; b=FqE7KQR1EqxoZmh7vVY/Ec8bqaWG2kkM5hYp70JY4FaOFoMdcawNdv5H/nPIZS/P5j 3ObcVwPCTFXdQQZrBcBkdFpZZTo5XlXQJbgDiL9LW2RymwAwzSs8MX4CxgrIOGhSVztN Wpt7l8Ug2bCrTRpWQ2cbF1D03/cehCgrUI9FqQ+IezrwvhW/pPQ5TwoJFKLDZuK1ZDcT rsqkmoSOHJQaP4kxKaTPQckxHxi2nh8U5q5HFqZwb1Dzp5P9RqeBdJcb380mQwVqkqnO n0g/JvULwvSXjv5bBKUAgIU5++jQobR/vuz9J7qIeP66MTkE85woPRKHq10D0YBinmdH j8Ww== X-Gm-Message-State: AOAM530WS+iON3S9yBz1jYkotwSI+FRFfmJMLIemEXhkEDaOPPPIBwol SpIREWUSY9c3nJyFOK21BMsO4hOOhHZHV69Np6c= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:d20b:bb87:51cd:edc3]) (user=ndesaulniers job=sendgmr) by 2002:a05:6214:27e4:: with SMTP id jt4mr1006501qvb.45.1628270826503; Fri, 06 Aug 2021 10:27:06 -0700 (PDT) Date: Fri, 6 Aug 2021 10:27:01 -0700 Message-Id: <20210806172701.3993843-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.605.g8dce9f2422-goog Subject: [PATCH v2] scripts/Makefile.clang: default to LLVM_IAS=1 From: Nick Desaulniers To: Masahiro Yamada , Nathan Chancellor Cc: Khem Raj , Matthew Wilcox , Nick Desaulniers , 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 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 Signed-off-by: Nick Desaulniers --- Changes v1 -> v2: * Drop "Currently" from Documentation/, as per Matthew. * Drop Makefile and riscv Makefile, rebase on https://lore.kernel.org/lkml/20210805150102.131008-1-masahiroy@kernel.org/ as per Masahiro. * Base is kbuild/for-next, plus https://lore.kernel.org/lkml/20210802183910.1802120-1-ndesaulniers@google.com/ https://lore.kernel.org/lkml/20210805150102.131008-1-masahiroy@kernel.org/. Documentation/kbuild/llvm.rst | 14 ++++++++------ scripts/Makefile.clang | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst index f8a360958f4c..e87ed5479963 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. +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/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 prerequisite-patch-id: 6a0342755115ec459610657edac1075f069faa3d -- 2.32.0.605.g8dce9f2422-goog