Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3022741imu; Sun, 11 Nov 2018 06:08:37 -0800 (PST) X-Google-Smtp-Source: AJdET5dfd0o8kMfHtiLuUiCd4YScsYfGxL/18xGOCdYgkoTZ+/cM124TftGhrxImaB6Xp9gP4KRr X-Received: by 2002:a63:7e5b:: with SMTP id o27mr14078162pgn.214.1541945317559; Sun, 11 Nov 2018 06:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541945317; cv=none; d=google.com; s=arc-20160816; b=AX2vSWW47bOtbXYEzjmuNJ7Syrzk6vZwKjPQ9yvGzhoRnwvxoKGr65+x5fUY2BAnCz fG++zlByauNftQ1jGXy9yHlZ2LGoisaRLhktGhVcnOERbihiFmEBJ4I0n+k37VSTcii2 MPNLKL4ykBOZtlr7hg12Lel0jk4BOqEIfXWSWrLtngKtHSfVQMVFHp8xoLi+mqPQCkA0 LKuHRuXDigqVV5ly77UZ3iFFP1hTMpu+xg51ejSWXaUJWJx/Noj9jk2Yf5sQXCpSWxRM 1mpLWimUEsQQXVUuDph7lSxpU56SlTslOJSiucxKH/Oq44GFymfvzaTdSTHQcxjgX2SW BLJg== 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=kGjnAxcaEdU5iOxpNNvXA/L0FC0uvXp1eA+Et/kr9W4=; b=Znxg2Z0x1lzdEbJa5MVeiN9pa9fvp8nZE2TTeChWHwkNIn3hStX8N7swBRg4cTpB2P J4ztykSByXoPkPr3RZ3T+QKaFHxgyOwY+QuqQbL354k1FLfQRjIC3JCZhjIFojSqmyq0 4eSHhEjc5wOH6OiHaHBPwBzZ4IxmXmEJMtC1Bifczz9nUJs8ZgMCFb2QXkkSvsUWgRF1 g8yqt/L7cOpscdZAf7VZ6J+joad4o78ob7dwSCxTKRI80CB95JnifUK4t2vGUa1jk7Zz D1vfkHP7JSuxPpr+b4aVRxxnomFp8Rk7KCC7B/rPqpf372cYk/om6vPwSKS1Kf5UF8oy fenw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=pq0RY8UA; 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 go18si561768plb.130.2018.11.11.06.07.55; Sun, 11 Nov 2018 06:08:37 -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=pq0RY8UA; 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 S1728195AbeKKXw6 (ORCPT + 99 others); Sun, 11 Nov 2018 18:52:58 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:39791 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728091AbeKKXw6 (ORCPT ); Sun, 11 Nov 2018 18:52:58 -0500 Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) (authenticated) by conssluserg-03.nifty.com with ESMTP id wABE4Bbm007854; Sun, 11 Nov 2018 23:04:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com wABE4Bbm007854 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1541945052; bh=kGjnAxcaEdU5iOxpNNvXA/L0FC0uvXp1eA+Et/kr9W4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=pq0RY8UAfc1b92qez0/aYUQrDFBsacMgZPVrCH9irpmEY3GEVKdXCmuQgAkiAW6jU Fz3UgGsStzCHfGKUiVUUpn1t74glQzNLGVVOI0EXzvRuLy2tqSClQqpVghL9sRnH3j 4InTa/QXqeNPRZTlSWS3ONmghZyQucgGjC15WwXo7ev04m7HtKEw/S5w1aX7e7TMB9 uaBXBuIxEXbeFgoTGoLeTH41O20QmPQtimiXnx+XyzEfSapufr+IICVTABXpQYks7N x6NmZByFGfG/2TDqSGWDWzE/E2CIsj8PGoCWJZqsbhNmu8Sy/FZwY6XCCxoK9787gP U227ChpavTRcg== X-Nifty-SrcIP: [209.85.217.43] Received: by mail-vs1-f43.google.com with SMTP id h18so3655375vsj.4; Sun, 11 Nov 2018 06:04:11 -0800 (PST) X-Gm-Message-State: AGRZ1gIi1FANJ6c37HLIKisYrwJeirYyJpxuKd+RGjpcrnFFOscmAcN6 0mPhglUttckwJsuZUiCp0sGZMsUyzyCo3hHUQoA= X-Received: by 2002:a67:f1d6:: with SMTP id v22mr6690623vsm.181.1541945050069; Sun, 11 Nov 2018 06:04:10 -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> In-Reply-To: <9c4868dd-82fa-aa5c-843e-e1f78ffbc7e2@google.com> From: Masahiro Yamada Date: Sun, 11 Nov 2018 23:03:33 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] kbuild: consolidate Clang compiler flags To: Greg Hackmann , Joel Stanley , Nick Desaulniers Cc: Linux Kbuild mailing list , Stefan Agner , Matthias Kaehlcke , linuxppc-dev , Michael Ellerman , 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 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? -- Best Regards Masahiro Yamada