From: Michael Ellerman <mpe@ellerman•id.au>
To: Masahiro Yamada <masahiroy@kernel•org>, linux-kbuild@vger•kernel.org
Cc: Michal Marek <michal.lkml@markovi•net>,
Yoshinori Sato <ysato@users•sourceforge.jp>,
linux-sh@vger•kernel.org, Masahiro Yamada <masahiroy@kernel•org>,
linuxppc-dev@lists•ozlabs.org, linux-kernel@vger•kernel.org,
Steven Rostedt <rostedt@goodmis•org>,
Russell King <linux@armlinux•org.uk>,
Ingo Molnar <mingo@redhat•com>, Paul Mackerras <paulus@samba•org>,
Sami Tolvanen <samitolvanen@google•com>,
Rich Felker <dalias@libc•org>,
linux-arm-kernel@lists•infradead.org
Subject: Re: [PATCH] kbuild: introduce ccflags-remove-y and asflags-remove-y
Date: Mon, 29 Jun 2020 15:57:11 +1000 [thread overview]
Message-ID: <87imfa8le0.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20200628015041.1000002-1-masahiroy@kernel.org>
Masahiro Yamada <masahiroy@kernel•org> writes:
> CFLAGS_REMOVE_<file>.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 <samitolvanen@google•com>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel•org>
> ---
>
> 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 <mpe@ellerman•id.au> (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
next prev parent reply other threads:[~2020-06-29 5:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-28 1:50 [PATCH] kbuild: introduce ccflags-remove-y and asflags-remove-y Masahiro Yamada
2020-06-28 19:07 ` Steven Rostedt
2020-06-29 5:57 ` Michael Ellerman [this message]
2020-06-30 2:08 ` Masahiro Yamada
2020-07-06 11:24 ` Anders Roxell
2020-07-06 12:00 ` Anders Roxell
2020-07-06 18:14 ` Masahiro Yamada
2020-07-05 7:58 ` [kbuild] fbb020c0d4: WARNING:at_kernel/trace/trace.c:#run_tracer_selftest kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87imfa8le0.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=dalias@libc$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kbuild@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-sh@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=masahiroy@kernel$(echo .)org \
--cc=michal.lkml@markovi$(echo .)net \
--cc=mingo@redhat$(echo .)com \
--cc=paulus@samba$(echo .)org \
--cc=rostedt@goodmis$(echo .)org \
--cc=samitolvanen@google$(echo .)com \
--cc=ysato@users$(echo .)sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox