Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2992762ybt; Mon, 29 Jun 2020 12:19:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZMS0BeEf3MIFN/NT6EAfj9EAQ6PDZsPZNV4ubyehlHYvoC4cRuWNg66ZS8YQlOywG4jvI X-Received: by 2002:a50:c181:: with SMTP id m1mr18695865edf.27.1593458370590; Mon, 29 Jun 2020 12:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593458370; cv=none; d=google.com; s=arc-20160816; b=Qaqx0bTaB+eZIYGmZfKBqam6CrdbAnK9ek6epfvMAMvSQ7TGn61INEApYUmbAqnTzx 4O8STJ7gtx8sC1o1f7P9cA6GwqUXjp1tQLizgicz4HumITyYHhMJEjmlWeXPIHsLo2Et EyPdOYEY2UTqdsdpHPkwnQHKtto+ea+4F7UZR+5avNBfbSNomA0v844706EQgNYmKMmz f3eenSM86ukC+HuoZ6jCbtuF11+y9s2lnEl/dpXEkjaSju8b8LPpUzC11VKnAtrTwD9/ awRywMVPBey6uw0tV/3RYuV6GZ0eCiMxbkTjtx3tZXjAnX2DK70nnsKq+3wFag3RnoNt gAJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=AwhZdEsSdSLUd6XqgJJ1yj0zv9jxaQgVkLq2059qkFs=; b=ky460T7BelXtj0kg4jLY8/iAYccFVMYj8Bf8gbnFPXJeMClZx0te5lX7K9HRwmoSNS g1TZU38Pu/RSNK0DtIBsqQxxJzo3kPYc94AiyX+E2ceHOGhVxxIiI8IIYOvid4TSJI5v M/3nuE+dENH7T4fwdANUMiQu3yE7K0KOKAOCT69odDQm1EXccjwX++iazqLHxDSUDCYk Rr54+NS4sctS+komGg5GFbytfxYBsDFyyWD9dZIdYixnGPinF22PntWtv0BwcER+Mwqs C3qBSt+c/aU1dUijjv7ppcMBl7k9JMQFvhHPXfLXRjD/hIrYrBXaUCsxXxXchwoBIC5i 8izw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=BybM+kRz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si277284edv.140.2020.06.29.12.19.06; Mon, 29 Jun 2020 12:19:30 -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=@ellerman.id.au header.s=201909 header.b=BybM+kRz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730721AbgF2TTC (ORCPT + 99 others); Mon, 29 Jun 2020 15:19:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731758AbgF2TOU (ORCPT ); Mon, 29 Jun 2020 15:14:20 -0400 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA549C08EA4D; Sun, 28 Jun 2020 22:55:02 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 49wGsq67rhz9sQt; Mon, 29 Jun 2020 15:54:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1593410101; bh=Jh0SmCOzWGYUXyeIgZMSmN1pyztkyV9tCktpTHdG1i8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=BybM+kRzXXhESpdzgGc8v3JB79Vlzk3vA79SnZQQwaV1CyaostawEhvEsPizyn5ni mjvAYZpXe9D14yRzLQkEWsiwft6LzwUmSLO89yP3t9zLEsD+h7in5CqCItOw3sUnXR XR+PrHFFIh1Ruw6CrJF20kEkaITEUNaIHZC08UfgEZ8Putxpw5kSYKPHNxeYkigt4c wbS4tjp+GQZq9Z2ufwA0RhBt6wAqdoTijQHNpLODJsGwpEFKRWcu7n9lm2IGDlK13B k9wjzdSQGsDp4Wip6l38PVkFqw/f9pFWx+EErzZH+ebnzKJZrzt962Cws7xNX2yiy3 NIHL1cwW1rRiA== From: Michael Ellerman To: Masahiro Yamada , linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Sami Tolvanen , Benjamin Herrenschmidt , Ingo Molnar , Michal Marek , Paul Mackerras , Rich Felker , Russell King , Steven Rostedt , Yoshinori Sato , linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] kbuild: introduce ccflags-remove-y and asflags-remove-y In-Reply-To: <20200628015041.1000002-1-masahiroy@kernel.org> References: <20200628015041.1000002-1-masahiroy@kernel.org> Date: Mon, 29 Jun 2020 15:57:11 +1000 Message-ID: <87imfa8le0.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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