Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1080347imu; Fri, 9 Nov 2018 10:35:14 -0800 (PST) X-Google-Smtp-Source: AJdET5fgjx5ONR5hRcN3XqvlC9cAfbPmd1HdDkdZiPSXRNLBp8v79E8l9KuFDt5DMW2Tsw0IkGtn X-Received: by 2002:a63:1b48:: with SMTP id b8mr8463926pgm.187.1541788514438; Fri, 09 Nov 2018 10:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541788514; cv=none; d=google.com; s=arc-20160816; b=qt7zf0ueVOrLHdvaZFZSzqK7vtCE+foGzD0qYrNu3J/p7OhQWH+y/Qi2F6ldAKBl/H XJ6yjty9Oz2B7QrbNh5QhJL2ulgilqC4hZJzzEWP735YHcE0q+AYpTpRs+j1CeXRmTTQ uQnpK4NOJXP+4U8O1z+2iRB7PgQcdh3HJafSyjefvk8efm3IIlqi6dYTzOUR+NFjdJWF RlGYYSf/W10VWfPWcqWnnuMo8GBsgdGyTQtWoz7CjJ0pARAyY93vNuLVs6d31+5NS95/ /p18vVcJriD4S4mXJgJcPS40lnthe35qwNnYc5IR/KoGXurRIreuhA2rZCCrdXG5e8kQ N0Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=JxD7kSkr4geOJC7eAPZ5I5uWHT9Cuv2yw07CVEu3ka0=; b=zQi2G14LJ1MmOKDGlQMGngigAGTsCOsUUPnV763oTRftohsnZcaKGeqbL5WTtIn2Sm BPlHaT4Xwb+SvN4j586McQ0bNhj1jUKQ+SEpTLpImVDqHODbgjKEzTlm2WN4ag7KdX9D dioqGDKKQVrMUjGWhAjskU31VqoHF357UJR1wkB5+qd9eotzKlXq3X+U5Cb+lx2IQdwl 7wjxPLm9w5WI0BwtUsyr7H1jmmJz8zSZ/PTvkFkd8NWtZgv5O3EbS54FmwtLCfQDDd57 F+BlVgfS4Lx0qEmNr+XLRj2hplx0TKtGlY56yMgpUlIAmPN/jiPr3Kom7OW9CX/OldhT vJRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=t8F0IN0R; 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 q17-v6si7953400pgd.438.2018.11.09.10.34.53; Fri, 09 Nov 2018 10:35:14 -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=t8F0IN0R; 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 S1728668AbeKJEQN (ORCPT + 99 others); Fri, 9 Nov 2018 23:16:13 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43518 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727995AbeKJEQM (ORCPT ); Fri, 9 Nov 2018 23:16:12 -0500 Received: by mail-pg1-f195.google.com with SMTP id n10-v6so1188723pgv.10 for ; Fri, 09 Nov 2018 10:34:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=JxD7kSkr4geOJC7eAPZ5I5uWHT9Cuv2yw07CVEu3ka0=; b=t8F0IN0RccyPgUJchAX8wq6xyLMo1oGUhuAWW8CFx9XB7F6FLFKtKQS4w1SwCo/iuA F0Udee4DAVY/JujMk1ocjUq7iqh7S9Pk8MnVUWzDcoTrzYNkAQVblRxZXgcIYAmg7Sfs GQ2jnE2tCx1FCS+wuv9lZwmEIOMckDEvdvHgNaUedoEZJaToFTNH4tZEj53IeMtQLOYx 0SRJcgJcN+Iqr4mmxtLf3+ZkxmdjGqDiatqM1lXkEJ/S3fzbsv/iSqNRjAzFguIgKA9Z 7ai1qlLAPUtq4nuzgl6GExwgVb30hlGiAb/8KF6tynCFaBCMwqldV/LTRoajgG5fKQu4 zkVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JxD7kSkr4geOJC7eAPZ5I5uWHT9Cuv2yw07CVEu3ka0=; b=thtW5stGgJDFjHmBJ0oC2GEeWwwybPF/WFTEIOsDNgZnzuUo0ODfbu5BgpRLKAAwCi 9ucrv3Xv/vO2EL/Wk/OPqqyICLMbBq+Cm+1VN0MYHFAXa8r9kqmmesHwfl4o1YP6Ps0x YtgxfdD57/wPu/0kS975aGwFj7LP0Xnr9vjuxXETg3kM/3/lJWkPD/XR3wNS70RpkZbB ZoIOk4GQ0dzFGwfLEqsWwbIF6b4Y4yUywDoO8xdM5saPeYtACRUKeDIgEBbZmJxcpAqP vw3afIuyN6uw3c7O2WyWiD87la9+lV9u4kkMmSo3bLUdyR4rGLqbTviiZTOqjAm6g7j0 oEBg== X-Gm-Message-State: AGRZ1gLyGrJnkn2yaBnVxBZ0/skhpL7aoLYFh4dewEM30ExVgsJpSWvL LHN3Cri8m5HKEhY8+yBQ7tU2LA== X-Received: by 2002:a63:d40a:: with SMTP id a10mr8236693pgh.394.1541788464604; Fri, 09 Nov 2018 10:34:24 -0800 (PST) Received: from hackmann.mtv.corp.google.com ([2620:0:1000:1601:82f7:8f1:8c08:a97a]) by smtp.gmail.com with ESMTPSA id q195sm7870491pgq.7.2018.11.09.10.34.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 10:34:23 -0800 (PST) Subject: Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags To: Nick Desaulniers , 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 , Nathan Chancellor References: <1541473495-25262-1-git-send-email-yamada.masahiro@socionext.com> <1541473495-25262-2-git-send-email-yamada.masahiro@socionext.com> From: Greg Hackmann Message-ID: <9c4868dd-82fa-aa5c-843e-e1f78ffbc7e2@google.com> Date: Fri, 9 Nov 2018 10:34:22 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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