Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3216154ybt; Mon, 29 Jun 2020 19:10:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHS0wzo9gm95wmAPVzP6Nlcckc+/FFc+SF5aFz3g6kZbXBKJ1AoqRYGpDjfsPBzAyeP725 X-Received: by 2002:aa7:c1d8:: with SMTP id d24mr20998047edp.178.1593483050517; Mon, 29 Jun 2020 19:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593483050; cv=none; d=google.com; s=arc-20160816; b=ihkCENlcx4Y6a8dPLbNoEGRBH0ke7st/8e92wY/jc+bc79pfbG+XpuDR/bAK84bfv9 RCWTFRTqm+iqSM77zwQRADVA165XROC63NaumD3+b5U2Xlmh5nuH/WX3B8rZrwyRa+WV /umqe9sahYkizY9eakMCcN/yxyGVfXmRDjbUQoYHz7yFXG/I1QmWPOGzmcWilcJ0GuZ0 0ncLkCXoKsLdFTJEiy9QRnjtoKg+u3mo6vAmcn/U0JAE6gnDHgsjqeB6tOHG47naOE6K Oanf8vl7bva7qinhpkX9BZKSqKilakC0I1RIimLTEMcKQ+P0QW4Ry3qmkBEdMIIHhNLi MJAA== 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=8N9eJ+P9q8UjGmkozh+JC0/G8Gi+VtjTGyH41GDG7qQ=; b=AeHCgEmvvZmmteVEGBdxMNVkQWIiZM7yNbgKAu0i9tDlU4u49+IrcXe/k+eLeQKyTM VsSps6fMNzlLnPMNuMromdPJ6BwGopinBG+kqPn0DLKG2L7/I+cbEIokxlGl4wyAb2EZ fyxSeKkFjqU6uYFv/62R1LNyQtdQ87ohQOgsW7UCrvzfRO4Xzog+QRy1PypxMr+eAO30 zF24BVfeR6hGbiJM6wR5KxNfCNN0IG5v2T3/fnffXygoqJlxGOO2obppVrjhiADbFPMW w5N9ny6lcIScDzIb3VZimCa39i9J8VBSpmkWLwTT3wKMEMT+5jKVSg0t//W0YbZSLJc3 m6zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=XBPAVQ+D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si906636ejb.453.2020.06.29.19.10.27; Mon, 29 Jun 2020 19:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=XBPAVQ+D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728164AbgF3CJB (ORCPT + 99 others); Mon, 29 Jun 2020 22:09:01 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:60726 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbgF3CJA (ORCPT ); Mon, 29 Jun 2020 22:09:00 -0400 Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 05U28iKU007918; Tue, 30 Jun 2020 11:08:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 05U28iKU007918 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1593482925; bh=8N9eJ+P9q8UjGmkozh+JC0/G8Gi+VtjTGyH41GDG7qQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XBPAVQ+D67fSeXqHbyyQDokt++S37hhSVW07zeWlL1772G3Pck6+8PzK+i0hf5ZW9 V2LI1trmHpPAJUoeSVpVWzMD5g7oJwbPUiOitRvoNTmUtdWzNvmjyxz2wOaMuyUawF x6w5Y+wMvOIxMl++zTr6sNqmjiUt92Ndp8z1fyFkpmZnqJSY+aFffMfFb2dPJCebDO f3DRiKWYIHuVPb2l3VNLMOEKcry29/159EG4Ai8XlOlrjOARaHR7cuZt54YkRajrvx StoLhTChVQmh/pYjD8ETWkmixOig+IACKG0GBz/PuSQSZtoyQFVQlI6RqCv3zj6ONM gyOCR7S3+nSZA== X-Nifty-SrcIP: [209.85.222.54] Received: by mail-ua1-f54.google.com with SMTP id g14so5971425ual.11; Mon, 29 Jun 2020 19:08:44 -0700 (PDT) X-Gm-Message-State: AOAM533PQffsVU88BIfLTIBcAzE2I3lms0Bynt2OFVzqUIG0aYOGc6Sl 1Vjg4Oi4bh5U1rIeHTsvr3zVVS191wiVHT0DVxo= X-Received: by 2002:a9f:2204:: with SMTP id 4mr13210692uad.40.1593482923565; Mon, 29 Jun 2020 19:08:43 -0700 (PDT) MIME-Version: 1.0 References: <20200628015041.1000002-1-masahiroy@kernel.org> <87imfa8le0.fsf@mpe.ellerman.id.au> In-Reply-To: <87imfa8le0.fsf@mpe.ellerman.id.au> From: Masahiro Yamada Date: Tue, 30 Jun 2020 11:08:07 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: introduce ccflags-remove-y and asflags-remove-y To: Michael Ellerman Cc: Linux Kbuild mailing list , Linux Kernel Mailing List , Sami Tolvanen , Benjamin Herrenschmidt , Ingo Molnar , Michal Marek , Paul Mackerras , Rich Felker , Russell King , Steven Rostedt , Yoshinori Sato , linux-arm-kernel , Linux-sh list , linuxppc-dev 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, Jun 29, 2020 at 2:55 PM Michael Ellerman wrote: > > Masahiro Yamada writes: > > CFLAGS_REMOVE_.o works per object, that is, there is no > > convenient way to filter out flags for every object in a directory. > > > > Add ccflags-remove-y and asflags-remove-y to make it easily. > > > > Use ccflags-remove-y to clean up some Makefiles. > > > > Suggested-by: Sami Tolvanen > > Signed-off-by: Masahiro Yamada > > --- > > > > arch/arm/boot/compressed/Makefile | 6 +----- > > arch/powerpc/xmon/Makefile | 3 +-- > > arch/sh/boot/compressed/Makefile | 5 +---- > > kernel/trace/Makefile | 4 ++-- > > lib/Makefile | 5 +---- > > scripts/Makefile.lib | 4 ++-- > > 6 files changed, 8 insertions(+), 19 deletions(-) > > > > diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile > > index 89c76ca35640..55cbcdd88ac0 100644 > > --- a/arch/powerpc/xmon/Makefile > > +++ b/arch/powerpc/xmon/Makefile > > @@ -7,8 +7,7 @@ UBSAN_SANITIZE := n > > KASAN_SANITIZE := n > > > > # Disable ftrace for the entire directory > > -ORIG_CFLAGS := $(KBUILD_CFLAGS) > > -KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS)) > > +ccflags-remove-y += $(CC_FLAGS_FTRACE) > > This could be: > > ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE) > > Similar to kernel/trace/Makefile below. I fixed it up, and applied to linux-kbuild. Thanks. > I don't mind though. > > Acked-by: Michael Ellerman (powerpc) > > cheers > > > diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile > > index 6575bb0a0434..7492844a8b1b 100644 > > --- a/kernel/trace/Makefile > > +++ b/kernel/trace/Makefile > > @@ -2,9 +2,9 @@ > > > > # Do not instrument the tracer itself: > > > > +ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE) > > + > > ifdef CONFIG_FUNCTION_TRACER > > -ORIG_CFLAGS := $(KBUILD_CFLAGS) > > -KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS)) > > > > # Avoid recursion due to instrumentation. > > KCSAN_SANITIZE := n -- Best Regards Masahiro Yamada