Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp764956pxt; Thu, 5 Aug 2021 11:04:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM5W4/AmqBoavlk+Q5TUpAwil8sYkJ2wNm7MTVGWRwoeLVYlFYGnDml/UWBP2QU1xLBAfF X-Received: by 2002:a05:6e02:1bc7:: with SMTP id x7mr322659ilv.116.1628186661653; Thu, 05 Aug 2021 11:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628186661; cv=none; d=google.com; s=arc-20160816; b=OkTEkUWW5KcgEZrRMe741zMyEXZtxBMkrWOP5WvgwYSb3ivIsh7CqSNl/0MSBFOBqE I2wZCmdeGS7XtPPb09sd6N1gUZSM4MUqmCYQu+XEO7LXTK3g6dokhV6vRoDPwgTq1guG oprRe/V7r2NulBw8jcp1E752CAT4DmywyBSlnhUARowseu8+ztyp1Fz6B/qqN7MlNjFZ SpVoG7f2V0amMONpHXFSjSjnv9YJMa8G7zdut8g25XKKh/XImUwP4qFkCz5RvHnXfdRM ShJmcYQE2nGQ5FjChUjBorfPyx+e+fSJDEDyNP4nK0aM0LHoFEg8D/rDwxJe/v7g27Cy dvNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:dkim-filter; bh=/8/3wCfLu/4cFvkS/DxXUoTejOJZixLrqpyNHz7+H/k=; b=yGc9bUxeymnwCRtLr+QXcJ5RHq87UpfR9WFs9GorFk8wScrfYY26jdTB4H5zQ61ttm Z4IQ3qd0sctzN7qCRhf1TOe+hTWmwSMeEEW+rZ/w3PqkpYI05Nrw7EuetiHS/QT/uBrZ gkATScCIjjWVMO1u+pp899yL4XS1ov5iwwjP9VVlAYYZ0BOY6i5j/eSBzHSEDWZS2amD bW7/8gcM1i9P70VKF3uq3poV0YGfX80RLZE4Ck2I77YpFf9OgrSi2Lzg8Denrmpsiwez pEkfH2PKDklpmpfulrHMGBIsxyJuKKeg9M5lkhb/1W6SBk8KONTs3ZTQWUnD0AxoZfhE pNRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=FCGRuPzW; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si6647186jak.102.2021.08.05.11.03.44; Thu, 05 Aug 2021 11:04:21 -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=@nifty.com header.s=dec2015msa header.b=FCGRuPzW; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241449AbhHEM4z (ORCPT + 99 others); Thu, 5 Aug 2021 08:56:55 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:25229 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232615AbhHEM4y (ORCPT ); Thu, 5 Aug 2021 08:56:54 -0400 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 175CuNhC014299; Thu, 5 Aug 2021 21:56:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 175CuNhC014299 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1628168184; bh=/8/3wCfLu/4cFvkS/DxXUoTejOJZixLrqpyNHz7+H/k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=FCGRuPzW2ZdOkpr1FDIjYrWAaUQWM+HNlOPFh99beLhWIXJW1PBIC1iJzQjteiEOs FmCP3LEs363NVX0VTREBIckBk5cYAyUVHvHuU6bzkG2YcN71KnM1FKZ79S4D1J4QVt kT/Bui1zSKl80/7ANnQ2qu61O9NDYTGO49s6103eflKXLGKifG8B1N78nlToutnyZX H4Qhr1GwbkN4632NEdi6n6QVPTaf9bEHIBr1bbQfqMacuoLzRDSQhQaCRruJ2EtdUW LX5pe6Ki3yYOp+BXx5wjEZVABbp0zV7YjJMgVsrF2UYqZSqq7COpLp81ySoml+L1Ly xley5dWU5pGPA== X-Nifty-SrcIP: [209.85.216.48] Received: by mail-pj1-f48.google.com with SMTP id t7-20020a17090a5d87b029017807007f23so11328278pji.5; Thu, 05 Aug 2021 05:56:24 -0700 (PDT) X-Gm-Message-State: AOAM532DrIpz6kEiZowAylET5D9hnJgV0ji52SEzhHPfIVo5Xlwm/1dC mONVQtq2EFL9akTrQU9WjkMYlereqY1QtkRGLCg= X-Received: by 2002:a17:902:a5c5:b029:12c:a867:a839 with SMTP id t5-20020a170902a5c5b029012ca867a839mr1763754plq.71.1628168183373; Thu, 05 Aug 2021 05:56:23 -0700 (PDT) MIME-Version: 1.0 References: <20210802183910.1802120-1-ndesaulniers@google.com> <20210802183910.1802120-2-ndesaulniers@google.com> In-Reply-To: From: Masahiro Yamada Date: Thu, 5 Aug 2021 21:55:46 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 1/3] Makefile: move initial clang flag handling into scripts/Makefile.clang To: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Cc: Nick Desaulniers , Miguel Ojeda , Michal Marek , Arnd Bergmann , Linux Kernel Mailing List , Linux Kbuild mailing list , clang-built-linux , Geert Uytterhoeven , Christoph Hellwig , Linus Torvalds , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 3, 2021 at 6:06 AM 'F=C4=81ng-ru=C3=AC S=C3=B2ng' via Clang Bui= lt Linux wrote: > > On Mon, Aug 2, 2021 at 11:39 AM Nick Desaulniers > wrote: > > > > With some of the changes we'd like to make to CROSS_COMPILE, the initia= l > > block of clang flag handling which controls things like the target trip= le, > > whether or not to use the integrated assembler and how to find GAS, > > and erroring on unknown warnings is becoming unwieldy. Move it into its > > own file under scripts/. > > > > Reviewed-by: Nathan Chancellor > > Signed-off-by: Nick Desaulniers > > --- > > MAINTAINERS | 1 + > > Makefile | 15 +-------------- > > scripts/Makefile.clang | 14 ++++++++++++++ > > 3 files changed, 16 insertions(+), 14 deletions(-) > > create mode 100644 scripts/Makefile.clang > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index 19135a9d778e..3af8d39f43ef 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -4501,6 +4501,7 @@ B: https://github.com/ClangBuiltLinux/linu= x/issues > > C: irc://chat.freenode.net/clangbuiltlinux > > F: Documentation/kbuild/llvm.rst > > F: include/linux/compiler-clang.h > > +F: scripts/Makefile.clang > > F: scripts/clang-tools/ > > K: \b(?i:clang|llvm)\b > > > > diff --git a/Makefile b/Makefile > > index 6b555f64df06..444558e62cbc 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -586,20 +586,7 @@ endif > > CC_VERSION_TEXT =3D $(subst $(pound),,$(shell $(CC) --version 2>/dev/n= ull | head -n 1)) > > > > ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) > > -ifneq ($(CROSS_COMPILE),) > > -CLANG_FLAGS +=3D --target=3D$(notdir $(CROSS_COMPILE:%-=3D%)) > > -endif > > -ifeq ($(LLVM_IAS),1) > > -CLANG_FLAGS +=3D -integrated-as > > -else > > -CLANG_FLAGS +=3D -no-integrated-as > > -GCC_TOOLCHAIN_DIR :=3D $(dir $(shell which $(CROSS_COMPILE)elfedit)) > > -CLANG_FLAGS +=3D --prefix=3D$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_CO= MPILE)) > > -endif > > -CLANG_FLAGS +=3D -Werror=3Dunknown-warning-option > > -KBUILD_CFLAGS +=3D $(CLANG_FLAGS) > > -KBUILD_AFLAGS +=3D $(CLANG_FLAGS) > > -export CLANG_FLAGS > > +include $(srctree)/scripts/Makefile.clang > > endif > > > > # Include this also for config targets because some architectures need > > diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang > > new file mode 100644 > > index 000000000000..297932e973d4 > > --- /dev/null > > +++ b/scripts/Makefile.clang > > @@ -0,0 +1,14 @@ > > +ifneq ($(CROSS_COMPILE),) > > +CLANG_FLAGS +=3D --target=3D$(notdir $(CROSS_COMPILE:%-=3D%)) > > +endif > > +ifeq ($(LLVM_IAS),1) > > +CLANG_FLAGS +=3D -integrated-as > > -i* options are for includes. -fintegrated-as is the canonical spelling. If -fintegrated-as is preferred to -integrated-as, please send a patch. (on top of this series) Thanks. > Since -fintegrated-as is the default (for most llvm/lib/Target/ > targets and the ones clang builds actually support), > it can even be deleted. > > > +else > > +CLANG_FLAGS +=3D -no-integrated-as > > +GCC_TOOLCHAIN_DIR :=3D $(dir $(shell which $(CROSS_COMPILE)elfedit)) > > +CLANG_FLAGS +=3D --prefix=3D$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_CO= MPILE)) > > +endif > > +CLANG_FLAGS +=3D -Werror=3Dunknown-warning-option > > +KBUILD_CFLAGS +=3D $(CLANG_FLAGS) > > +KBUILD_AFLAGS +=3D $(CLANG_FLAGS) > > +export CLANG_FLAGS > > -- > > 2.32.0.554.ge1b32706d8-goog > > > > -- > You received this message because you are subscribed to the Google Groups= "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgi= d/clang-built-linux/CAFP8O3Jc%3DiwzAQojgBZZzdT8iVBY9TO6GLTq%2B0vkXoo6L5JJ-A= %40mail.gmail.com. --=20 Best Regards Masahiro Yamada