Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1075423imu; Fri, 9 Nov 2018 10:30:47 -0800 (PST) X-Google-Smtp-Source: AJdET5fQ7Bhlldr6zC8LZtDG9A0NsyX9WhG7TmZ4neQSIPZt1xbsXF9yzTcpHZhLbdPHS2DbTF1o X-Received: by 2002:a65:63d3:: with SMTP id n19mr8544659pgv.179.1541788247374; Fri, 09 Nov 2018 10:30:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541788247; cv=none; d=google.com; s=arc-20160816; b=OdaqDDKU9mMadk5reR1126ehlj2YliE7DWqD9LWRDiJ/2xBkRoW0x601CbA9z8sVLq Vp8IsPaE1mU27z0JY+CrO5RxUyc90gYYi+5Nt6caaYEdohGuPZtqg5A6NrJ+OuJ04Z1W u8hk2dFNY9nM9NG4cAT8YirD1+MOCuYuq+I9whA1k/aVel1hP26UbHV7wfn7hen1U/el y+M+lcQWN5DOa6dZjfVPJRETjuOBY4ss6HGBdMNSZdveHurjBi04TPRDEXJxpuBwZZiJ IZSMTHg9Z4AT9WH+aLT+CqJlxGfQDUs0pYX2GMcf1XocPTX9AaSsqKlFmzINm9L5atf+ aU1g== 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=oO+HpkLidr/CeyCYN5af7zvbZoEkI1LAH8/hbiIoRMM=; b=ycCK4lWITnmrbdQaIyW7i5VmM3YxwyIlD8cLsa8GpbgJAQZ/jhJbWJ91YUwCCZkdgi l7JtUbu7ciggIyVFIuuUL7yZXK08YvhvQYFKbZgaN/9VfpzKGiLgAAhlRsJJ5TtonLn2 J6qa4xA3nqrXHQE8SYd9WqCYCVfoaWWQ8R917jS7So44JHaXzf/A+RlHRfYXTqGw2sca ZPuFV7Ryu+vCNHAH+lQ6A6iZ37xLvsIXCvJUetbj35d6lFojr/y0IoMemO7EV8Dcbl0/ iXc33GiVPsVCkDGUyKbd8dE3adzvsSkEdOhUuXRoKmfP0eJEtZ08yrev8Xf5d8JUQA1T kdfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EHwfvC4p; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj11-v6si8374242plb.55.2018.11.09.10.30.25; Fri, 09 Nov 2018 10:30:47 -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=@google.com header.s=20161025 header.b=EHwfvC4p; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728661AbeKJELd (ORCPT + 99 others); Fri, 9 Nov 2018 23:11:33 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41607 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727995AbeKJELd (ORCPT ); Fri, 9 Nov 2018 23:11:33 -0500 Received: by mail-pg1-f193.google.com with SMTP id 70so1187444pgh.8 for ; Fri, 09 Nov 2018 10:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oO+HpkLidr/CeyCYN5af7zvbZoEkI1LAH8/hbiIoRMM=; b=EHwfvC4pP8WkPe68hfbEAlVnco5DhCMjbh+GSZdeTxVtAZow7aqK1QlpCWf+RMiA0r UmwFD9sxQHOA5xxQYZxl4xlAgdH5gMb3Igyg8TlrMuW8GJV/5+BXDMAzWK0cojjDnOGB QnY/OB6V42G+e2b1TfFGdl7XafFOssUJj7rhArVct5Mh9tWqoVdFXuWVTiRus+5ZKa9Q ADyddMBbA2IOqpVTkJhWCMx1RQwEYD2hiLp3SiYyymNj6Sk+bNhhHgpPcclvuMFWil3l QvP0Mm6GgXKaVFZv6JFsZvubzCxB2BYhsIaYsGPue2VmG/OYbWTXN1ynRwpYzYXOPdYn L09w== 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=oO+HpkLidr/CeyCYN5af7zvbZoEkI1LAH8/hbiIoRMM=; b=dTWwevyW+N4km/t+j2hbDQYuXoV1C0hCPizDDf1dq6GhQTVw1so/2WcgTN/9lBTDDp zQdNNQO66BXP+ge20K05KAVjNR+YG91XEQ23dHMvpsX/nwrWoAMzh79qZ5EpAG0qXfLK MtYF6twwJIRavSM2FOCffKVMkimT0+J9G3mcb6GrDfno99t5R1NawtQoWG4NXcZ+X7bT 1WzznaMctjbyuOeJmey50lBZ97Em9x5gtC2825CJETFyjDjz/gmFzz0MZkGIw6UuQWPE NUIKcFp2Gjtyg0zEceglUxbhgVF/9SM9WfYrOu9Nh7dQ/s0V35ez1ar9jt5hzYFsA2A5 tR1A== X-Gm-Message-State: AGRZ1gKd+CKFtAZlGdEG6wmKQHUxF8lXsyqr67fuzAGAzTtfAi/mEztq cEBDUnPvid72OeY7KKweCaGDynAR/WefcE+he7y8ww== X-Received: by 2002:a62:1095:: with SMTP id 21-v6mr9933616pfq.227.1541788186599; Fri, 09 Nov 2018 10:29:46 -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: Nick Desaulniers Date: Fri, 9 Nov 2018 10:29:35 -0800 Message-ID: Subject: Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags To: Masahiro Yamada Cc: Linux Kbuild mailing list , Stefan Agner , Matthias Kaehlcke , joel@jms.id.au, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, Michal Marek , LKML , Greg Hackmann , 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 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)? -- Thanks, ~Nick Desaulniers