Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3523606imu; Sun, 11 Nov 2018 17:06:27 -0800 (PST) X-Google-Smtp-Source: AJdET5d1zm8oCK9OhTKr44nFVVD8G3Z9jE8ITULZgUqnOr3IuBG08LrodYW44Swj6xv+ULa6j/Xz X-Received: by 2002:aa7:858b:: with SMTP id w11-v6mr18646248pfn.77.1541984786967; Sun, 11 Nov 2018 17:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541984786; cv=none; d=google.com; s=arc-20160816; b=D4+sTtJJJxvc5BSxaPqhE8ZdcnrtGLVfu4rdae85AQ/4glFj4QHU1XNpBXtRUAQzds bbZfbLpKl6EDHt0C2Ojrt2qcindZPbm7i2y2oyZoQr8+eV57n/74gTi2ui6AUN1Mzi2b 8qxqF2NN5OZPq42BrmF4K0A+5mvIyRHFnXWdWAPVEcX3Fr0LjaDD47h3FO/kl+2zo7jS BlaaQ8o/ygnwEPy6QyaLSeto0JZvgho6/fJfa8AEcvBp1KfSaPr8v1N0rZdfLyiokDGc ikSgbmCVN1saxem0ns7b+FYbTX1FWtK9T/lJphpgWLqUKDo2c6IcCGVxpqMvCNHnVkK3 3BJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=PkpEouCS4dUYHOPoT4T/1hVkE4An/obAOwva52eF4yY=; b=ONZ27mrFaYweaYkCzEQlpYoFHF/ystDS99OoZbHNPR8wiiSlWW1zcU51VJxNm1p8WR 4cpILCzs/Wdh54rLFekP1K4KrtK2tX3PJs8KSU4p6p0NXuuCEg16ryRL7+5wablkwYFj kNB+apsUhgVUM4+NkS4k8jRsrvZ9m+RkYW3VqyxKUDzznqccTfp4hK8K+aTpPQc0Hwof /t+jPzoc45RZjx7u8xEEoe1BDbe2bEHvW42of1wOyiREVnXPORMYMlOJR+QyX2VsjYlj fTDJShbxNzbVedbzogUwzHJW5SoG8MzpYv5pEtIu3p4nN5i0c9orXt1wLftIQZv3nDKX 6v5A== ARC-Authentication-Results: i=1; mx.google.com; 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 p9si12252273pgc.448.2018.11.11.17.05.52; Sun, 11 Nov 2018 17:06:26 -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; 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 S1729812AbeKLK4B (ORCPT + 99 others); Mon, 12 Nov 2018 05:56:01 -0500 Received: from ozlabs.org ([203.11.71.1]:47801 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727556AbeKLK4B (ORCPT ); Mon, 12 Nov 2018 05:56:01 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42tXcD5z1fz9s8F; Mon, 12 Nov 2018 12:05:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Masahiro Yamada , Greg Hackmann , Joel Stanley , Nick Desaulniers Cc: Linux Kbuild mailing list , Stefan Agner , Matthias Kaehlcke , linuxppc-dev , Michal Marek , Linux Kernel Mailing List , Nathan Chancellor Subject: Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags In-Reply-To: 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> Date: Mon, 12 Nov 2018 12:05:16 +1100 Message-ID: <87pnvb9kc3.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. cheers