Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3615081imu; Sun, 11 Nov 2018 19:29:53 -0800 (PST) X-Google-Smtp-Source: AJdET5ccOmr8+hpbsF0ubzn0684O4xVwvuqxZx8ropeLHE95Kyg8Q9rY4gQWQk91OZz0d9fWMt5/ X-Received: by 2002:a62:2643:: with SMTP id m64-v6mr18288058pfm.74.1541993393213; Sun, 11 Nov 2018 19:29:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541993393; cv=none; d=google.com; s=arc-20160816; b=rVRrF/95AgDZ2X9GvbzFljgCKDKrgGdaG3UgC7hN47NYzA18hHrYjHz+d8hq5d2fKa ZaAGX+tfCGENgj/JLqo8elhPfq+9DpfibNnf2dOrK3V1/T/7qV6q9RW+kbImBn0/AhO9 8N7AvhiSz/ixWWxIfnRUMLolkeIj5TeWBGQ9RT8kaIMOdOrePWk06TFdmMvYFsFjdlb6 RQmi6Opp0fmRxyxQnUNkje6j+d0aZw/TlHpCHC4UFB4y8ht33cu0g4WC0wEztiPYU4RZ mhv4A5Pcv94HMWQH0ip7HJ7/qi3NhWn6VtT0aExFebt4Od4E32i8Y9b7Wa/PqLgUrO/i Mixw== 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=rrO05wm73tPB3UeW7NA/fPQEeVRu0RZ8cacGop4OV2s=; b=0oBeqE7POxzfx96CI14tnid6xuyUFOqfX0fDTN3SdPOjqbBPdICfhHSv+c6mTFWuOO 1XO8UB2FdGXKL+IDpEf3Qv+5QAlNJt3LI/42DVg3n1PCnMVfRkn34sBTMPLWK5uLjhFw upnY4UGRHcufGJ6MR0+h1UyOUREpah+sKnmz6aAkBvzhH5RpbRUSITBSdCtMy5D3NuBe ky8VkOIkD/SHr7Eo8icNyj8hojMqyEVCg1TeRTutORnCIeXLqWQUfKvjzWphzQPPeVAF Di5g+SEtWZ7RCyGl+NIR4fCECq6PeDv4EKpleLXE/uw0i94xk9kUCknLj3mPd9MnApzS kVdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=EH8wJGh5; 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 s82-v6si17389204pfk.197.2018.11.11.19.29.37; Sun, 11 Nov 2018 19:29:53 -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=EH8wJGh5; 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 S1730485AbeKLNUV (ORCPT + 99 others); Mon, 12 Nov 2018 08:20:21 -0500 Received: from conssluserg-06.nifty.com ([210.131.2.91]:34740 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726619AbeKLNUU (ORCPT ); Mon, 12 Nov 2018 08:20:20 -0500 Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (authenticated) by conssluserg-06.nifty.com with ESMTP id wAC3T2iO002423; Mon, 12 Nov 2018 12:29:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com wAC3T2iO002423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1541993343; bh=rrO05wm73tPB3UeW7NA/fPQEeVRu0RZ8cacGop4OV2s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EH8wJGh5uVd04UX2H91lMeVxCUxjCBRfFrjQ2p+kvjq6ZwvEJDq6EVRj+WY0zgQRq KBRXAZ8h29IzfnGZvoYwox4rDuB1SPeOPMiApSr6Qkh1SAchmW0nFSiECJkWBg6yc7 Th+Q0z3xNjb8Afki/gGtezkfriCi3eu39VW067P7RCGmjgsNqePfaVbiIeAcxj3Bmd 0H4iyxUEKuFRP3qdekqcw0Swbet6dw4078QALisDirqMeKb1nhSjlPjwgCUZU96dZq CXTkHs+p8M2UL0tCzG7+t3o4AZzMlmvOdS9T4yGO2iPGFVxO+izFYOdul0jIGoBV/k 88sQMfbi6iUJQ== X-Nifty-SrcIP: [209.85.222.54] Received: by mail-ua1-f54.google.com with SMTP id p9so2568598uaa.5; Sun, 11 Nov 2018 19:29:03 -0800 (PST) X-Gm-Message-State: AGRZ1gJw+bEkQvjVkN4HgOAZTLiYVsWV51q/4WxgGIWCNoAr9vjReLeo LQj/cSrnbQott1EhXSFZgLrLmn7nAADWyjQ553U= X-Received: by 2002:a9f:3f41:: with SMTP id i1mr7548814uaj.42.1541993341942; Sun, 11 Nov 2018 19:29:01 -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> <9c4868dd-82fa-aa5c-843e-e1f78ffbc7e2@google.com> <87pnvb9kc3.fsf@concordia.ellerman.id.au> In-Reply-To: <87pnvb9kc3.fsf@concordia.ellerman.id.au> From: Masahiro Yamada Date: Mon, 12 Nov 2018 12:28:25 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags To: Michael Ellerman Cc: Greg Hackmann , Joel Stanley , Nick Desaulniers , Linux Kbuild mailing list , Stefan Agner , Matthias Kaehlcke , linuxppc-dev , Michal Marek , Linux Kernel Mailing List , Nathan Chancellor 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 Mon, Nov 12, 2018 at 10:05 AM Michael Ellerman wrote: > > Masahiro Yamada writes: > > On Sat, Nov 10, 2018 at 3:35 AM Greg Hackmann wrote: > >> > >> On 11/09/2018 10:29 AM, Nick Desaulniers wrote: > >> > On Mon, Nov 5, 2018 at 7:05 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 > >> >> --- > >> >> > >> >> 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 > >> >> > >> > > >> > Thanks for this patch, Masahiro, it's a good simplification. > >> > Reviewed-by: Nick Desaulniers > >> > Tested-by: Nick Desaulniers > >> > > >> > Would you mind waiting for a tested-by from Stefan, and maybe an ack > >> > from Greg (added to cc)? > >> > > >> > >> Acked-by: Greg Hackmann > > > > > > Thanks for your review! > > > > > > So, how to organize this series, and Joel's one together? > > > > I'd like Joel to use this series as a base for his work. > > (https://lore.kernel.org/patchwork/patch/1006696/) > > > > It will be much cleaner. > > > > > > Shall I merge all the patches to kbuild tree, or > > maybe will they go through powerpc tree? > > Joel's changes are fairly small so you may as well merge them along with > the rest of the series, if that's OK with you and Joel. OK, I will. Joel, If you send v2, I will merge it to kbuild tree. Thanks. -- Best Regards Masahiro Yamada