Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5999761imu; Tue, 13 Nov 2018 15:27:54 -0800 (PST) X-Google-Smtp-Source: AJdET5dx2TYbFXTMJBR9wQ1yR9UAXw5ieiiY4LQH4Nf+FWp4AARzc6MYEO0D0inUmCLngUHfXK3r X-Received: by 2002:a17:902:b181:: with SMTP id s1-v6mr7251708plr.51.1542151674565; Tue, 13 Nov 2018 15:27:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542151674; cv=none; d=google.com; s=arc-20160816; b=L+ZP3EsZS1chEviIBHuCsuxXYrq/bmofO4hTzHlNy2nGqVdfhNYJxyxQPjir7V02+F lpRLjtI8uAjuq+l3do5HxRHrmThfuL98vOTO2AlYnOVMWW9H9suCVBMYBtMUYtsaCGMd rD2am6U237z840fF8W0Y/bVaiNZKFKWdK7SRXpmZ2NJfJAbqjxGp9FLQRIo/3H3c7b9e 51+OwE/WwJrhl+58vNLXtId/Bv4D65tt8kuhI+T1RgUxzLrmU2XLacVb52G0AU5s24TT LfBWJyF+eKlxfIuZcoqLt5jSN3ci/96vIP01l1Vr+l53+X4yx070waF9QsA35ZKtgY6H tVmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=vZ9KOIiLmOGK0KOwUdWa8RFaKWmxD4apErxBOXls6LM=; b=oUOMg5J83g2U/7WN4k5YLrSDwZBW1AgCj1WzjZ202IK922j/xZbpL4UFhBw1Ypo9ot 1IQTfH7JWrm9m3xKJDH2iX0hEkiK1T3jwffXXc+PN0NtqALhsxBedZv7krZhyaSZOFAi B+WFsH2UGIDT8N0csyzazl+m29J2luUWi7eOMwPFM2eGKqP2P6YMgdkEhbnrBQN1TFab tQeuhnaWVPiyjkDUVNY41GLoV4Ai0Etizo40JHQ8Orp8RMlE9oyVwSGwSuSCSH4j1Fuv g/rfTU/uggWiZvX2BCR1GMXWU6NWx7qZ3ozqGj0Bsaii+1oPJTA+6MP2lzt7a9H3S609 YrjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="2Qwr/wfD"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1-v6si22869614pld.355.2018.11.13.15.27.39; Tue, 13 Nov 2018 15:27:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="2Qwr/wfD"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731705AbeKNJ0b (ORCPT + 99 others); Wed, 14 Nov 2018 04:26:31 -0500 Received: from conssluserg-04.nifty.com ([210.131.2.83]:59240 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726890AbeKNJ0a (ORCPT ); Wed, 14 Nov 2018 04:26:30 -0500 Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) (authenticated) by conssluserg-04.nifty.com with ESMTP id wADNPs1g012300; Wed, 14 Nov 2018 08:25:55 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com wADNPs1g012300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1542151555; bh=vZ9KOIiLmOGK0KOwUdWa8RFaKWmxD4apErxBOXls6LM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=2Qwr/wfD0fptViNVqAnZly0XVwzNuIUtU04/fTQyefLn20f/nd+hxUhZP9SKaCYJL isQsLNyiOcUpFMs67Ai4huT4hH/kIWh1jJ6WTxruUv011RW4JXp/iTqm04XGhnG2fr UqNBtzxr7F94IjY/QeZOo+KX/Qkf8xkDT9I5puqulYHudzqCKgFInUU02fXVKmbkka J7UEE07b2mqx4LuWGKqzbYQKFM4X7KO2bswX1bAPTjyX+6ivJOeJDhk9ZljeoqUnNT x1Jh0J1JiascICrJO4XgVNxOWycvApYzCWWXJlx7KpFU5cN0MYxPxuv+9omIrhx/Ki Ub5YBukC2RQwg== X-Nifty-SrcIP: [209.85.217.45] Received: by mail-vs1-f45.google.com with SMTP id p74so8440051vsc.0; Tue, 13 Nov 2018 15:25:54 -0800 (PST) X-Gm-Message-State: AGRZ1gKBPvSl92VAJb1KMHkBtSIlS4WgKfZMPdyq3ydiMoihC7K6hYQw 1QLf6isiM0qOY55b/I4O1wdiRYIznt1S2l7kzZg= X-Received: by 2002:a67:f1d6:: with SMTP id v22mr3225348vsm.181.1542151553996; Tue, 13 Nov 2018 15:25:53 -0800 (PST) MIME-Version: 1.0 References: <1541473495-25262-1-git-send-email-yamada.masahiro@socionext.com> <1541473495-25262-2-git-send-email-yamada.masahiro@socionext.com> In-Reply-To: <1541473495-25262-2-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Wed, 14 Nov 2018 08:25:17 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags To: Linux Kbuild mailing list Cc: Nick Desaulniers , Stefan Agner , Matthias Kaehlcke , Joel Stanley , linuxppc-dev , Michael Ellerman , Michal Marek , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 6, 2018 at 12:06 PM Masahiro Yamada wrote: > > Collect basic Clang options such as --target, --prefix, --gcc-toolchain, > -no-integrated-as into a single variable CLANG_FLAGS so that it can be > easily reused in other parts of Makefile. > > Signed-off-by: Masahiro Yamada > --- Applied to linux-kbuild. > Changes in v2: > - Use := flavor instead of = because $(CLANG_FLAGS) is expanded soon anyway > > Makefile | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/Makefile b/Makefile > index da11700..e173a73 100644 > --- a/Makefile > +++ b/Makefile > @@ -487,18 +487,17 @@ endif > > ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) > ifneq ($(CROSS_COMPILE),) > -CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) > +CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%)) > GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD))) > -CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR) > +CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR) > GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..) > endif > ifneq ($(GCC_TOOLCHAIN),) > -CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) > +CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN) > endif > -KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) > -KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) > -KBUILD_CFLAGS += -no-integrated-as > -KBUILD_AFLAGS += -no-integrated-as > +CLANG_FLAGS += -no-integrated-as > +KBUILD_CFLAGS += $(CLANG_FLAGS) > +KBUILD_AFLAGS += $(CLANG_FLAGS) > endif > > RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register > -- > 2.7.4 > -- Best Regards Masahiro Yamada