Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3646102imu; Sun, 11 Nov 2018 20:23:34 -0800 (PST) X-Google-Smtp-Source: AJdET5d3Ps/7qX4VCa9HlHMAOYnE79rMEDvejtGb3tzRv+QCLe94fCocqMmla6RFlm+Uc+4QjYbs X-Received: by 2002:a62:8145:: with SMTP id t66-v6mr18601056pfd.246.1541996614331; Sun, 11 Nov 2018 20:23:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541996614; cv=none; d=google.com; s=arc-20160816; b=lU6/90BIJspFVOLHPR6uk88RjIeu5xa3kr5Z0GLQc0auFLhOoegrmWfoZg7K//lrRO aay7FHx5eNonuWwgOaJVhL+wbRN10UiSfD8qVvs1J/sB3KRGjYvMfr+thrfZFzJKJZJL YPKF47Z8s1R3/zCxu491KqF2yXJWpfBA5CMWA7Z3Dbql000TfPZMYpBEZtkjFbGZ/KGq Bab7hISCH8q26G9rGSkWlq5Pyiu+CKmEKVkzgIYVSzhJS1cTyoI3pDtBxR7UDGV45ZpX 7BJDsTqRfto8Q2DBFYHWg1q76+W6GXPxvJKXVHXgiGHhzur9kbGn7/FvlGE9sWLLG90i XdAw== 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; bh=aVY2dT2YVwO0dKWfYBFbgGQ3c5QgDz+qnJHqdhsjtuw=; b=MhLu4rp/PYKxoUS00lKk2omJrp0qZUXXAnsKxqi2f1CBfMDl2vqpCQT2591IXbArG0 oYcicRwhbkig8EhOF0BmICyalEclNMIAXFUIZ3xZp1RlhdPIFcl5lbhqqqp4MgiicqNt T1IKxS9iZqJG5ee1hjxmmSaTsjOmtIzgac+kTdJlqL5c8yxitRA3Tp4lXN8/SEl09zH7 iZVVtEGIJ6IujuXnqjrWAO16/5duOuuKvmqPnpsKpAjM2MUvgEL477gJdmLbgxn1TY4a LDNMWPa/mogY4tpSifhHCuFftoDlu+SSO7pyNixFgZ6tRPgMYqVIldpYAwcUB1J/JZSt 7dDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=S3XrCGZS; 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 h6-v6si19007763plk.373.2018.11.11.20.23.19; Sun, 11 Nov 2018 20:23:34 -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=@jms.id.au header.s=google header.b=S3XrCGZS; 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 S1730981AbeKLOOM (ORCPT + 99 others); Mon, 12 Nov 2018 09:14:12 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:47068 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730481AbeKLOOM (ORCPT ); Mon, 12 Nov 2018 09:14:12 -0500 Received: by mail-qk1-f193.google.com with SMTP id q1so11233013qkf.13; Sun, 11 Nov 2018 20:22:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aVY2dT2YVwO0dKWfYBFbgGQ3c5QgDz+qnJHqdhsjtuw=; b=S3XrCGZSOm0EjKb5UMb6m2Pgd4GmXKXFqDOzI9RnpqHlgiYAGdUI1/R3n4enjrOX5E R7aYjyjXupapxRMKsI9dKit38mFFwP1CxSnGeigS+m72Ih5fm4vDZgdaSn1+scfYAuUE kBpCizHhpm2DfCo+2lOP3evazoIIv3l+WBRUU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aVY2dT2YVwO0dKWfYBFbgGQ3c5QgDz+qnJHqdhsjtuw=; b=CH2SnE1oPcOYXFEkPJ6XFA6vv0zlnFW/e7advSf1qjXGji/QMHNqFp0PoUwbgj4r8X DCMbSJonKJ8WTHQV3wFK4X3wuNSplCeB4bYNaY+MfNtXA+xgIdGhu6yKKN/aHDacdzpg +D5+pBUT71A/erfKitl5HMBfD902aA34lN65MxcmHqf2xnCoUdPM9H2fd6cxrRxserbV kN2pdmUA5gpszmln5XwrXCTpfxQbBF4sHzjC+W8l0IBxFAEmcXAUt9tsPsQFRdZ3xl6h U7RYJzSp6XB3KbMLBwdPiZmxSjP7gdOl2+YkuDXVsVgArO01uDNTq8KEWcA8FpscCP1b y6ow== X-Gm-Message-State: AGRZ1gLmTdTpAi3gEokZLkUx81A0lJ24r9bF624gYebAD3I+dCpnQNmM jCN7uPJGd+KrSmbmWb5GYURwUGZsl8njdfDUoco= X-Received: by 2002:a0c:89b4:: with SMTP id 49mr17951894qvr.85.1541996569443; Sun, 11 Nov 2018 20:22:49 -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: From: Joel Stanley Date: Mon, 12 Nov 2018 14:52:37 +1030 Message-ID: Subject: Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags To: Masahiro Yamada Cc: Michael Ellerman , ghackmann@google.com, Nick Desaulniers , linux-kbuild@vger.kernel.org, stefan@agner.ch, mka@chromium.org, linuxppc-dev@lists.ozlabs.org, Michal Marek , Linux Kernel Mailing List , natechancellor@gmail.com 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, 12 Nov 2018 at 13:59, Masahiro Yamada wrote: > > 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, I've done that now. Cheers, Joel